Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions flow-typed/npm/indent-string_v3.2.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// flow-typed signature: a08042e1cdd3c4a5f6619492d6bba137
// flow-typed version: 3581491ac8/indent-string_v3.2.x/flow_>=v0.25.x

declare module 'indent-string' {
declare module.exports: (
input: string,
count?: number,
opts?: {|
+includeEmptyLines?: bool,
+indent?: string,
|}
) => string;
}
10 changes: 0 additions & 10 deletions flow-typed/npm/indent-string_v3.x.x.js

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"eslint-plugin-flowtype": "^3.2.0",
"eslint-plugin-prettier": "^3.0.0",
"eslint-plugin-react": "^7.11.1",
"flow-bin": "^0.85.0",
"flow-bin": "^0.95.1",
"flow-typed": "^2.5.1",
"husky": "^1.1.2",
"mocha": "^5.2.0",
"mocha-doctest": "^0.3.4",
Expand Down
2 changes: 1 addition & 1 deletion src/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class Message {
return this.children.map(m => m.toString()).join(NEWLINE);
} else {
return [this.message]
.concat(this.children.map(m => indent(m.toString(), 1, INDENT)))
.concat(this.children.map(m => indent(m.toString(), 1, {indent: INDENT})))
.join(NEWLINE);
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ export class ConstantNode<V> extends Node<V> {
return context.unwrap(value => {
if (!this.eq(value, this.value)) {
throw context.error(
`Expected ${JSON.stringify(this.value)} but got ${JSON.stringify(value)}`,
`Expected ${JSON.stringify(this.value) || 'undefined'} but got ${JSON.stringify(
value,
) || 'undefined'}`,
);
}
return (value: any);
Expand Down Expand Up @@ -373,8 +375,8 @@ export class EnumerationNode<V> extends Node<V> {
return (value: any);
}
}
let expectation = this.values.map(v => JSON.stringify(v)).join(', ');
let repr = JSON.stringify(value);
let expectation = this.values.map(v => JSON.stringify(v) || 'undefined').join(', ');
let repr = JSON.stringify(value) || 'undefined';
throw context.error(`Expected value to be one of ${expectation} but got ${repr}`);
});
}
Expand Down
Loading