Skip to content

Commit f457b09

Browse files
authored
Fix CI failure caused by typicode#1394 (typicode#1406)
1 parent e371afd commit f457b09

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

__tests__/server/validate-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('validateData', () => {
77
})
88

99
test('should throw an error if data is an array', () => {
10-
assert.throws(() => validateData([]), /Data must be an object. Found array./)
10+
assert.throws(() => validateData([]), /Data must be an object. Found array/)
1111
})
1212

1313
test("shouldn't throw an error", () => {

src/server/router/validate-data.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ module.exports = (obj) => {
1717
Object.keys(obj).forEach(validateKey)
1818
} else {
1919
throw new Error(
20-
`Data must be an object. Found ${Array.isArray(obj) ? 'array' : typeof obj}.` +
21-
'See https://github.com/typicode/json-server for example.'
20+
`Data must be an object. Found ${
21+
Array.isArray(obj) ? 'array' : typeof obj
22+
}
23+
'See https://github.com/typicode/json-server for example.`
2224
)
2325
}
2426
}

0 commit comments

Comments
 (0)