diff --git a/.flowconfig b/.flowconfig index 6d28fce5..3a932b37 100644 --- a/.flowconfig +++ b/.flowconfig @@ -6,6 +6,7 @@ decl .*/dist/.* .*/docs/.* .*/scripts/.* +.*/examples/.* .*/node_modules/bcryptjs/* [options] diff --git a/appveyor.yml b/appveyor.yml index 7c6931f8..758c5d56 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,10 +16,6 @@ environment: services: - mysql -cache: - - C:\projects\lux\node_modules - - C:\projects\lux\test\test-app\node_modules - install: - ps: C:\projects\lux\scripts\appveyor\install.ps1 diff --git a/package.json b/package.json index 58431c74..8bceea69 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "documentation": "4.0.0-beta9", "eslint-plugin-flowtype": "2.19.0", "faker": "3.1.0", - "flow-bin": "0.32.0", + "flow-bin": "0.33.0", "mocha": "3.1.0", "node-fetch": "1.6.3", "nyc": "8.3.0", diff --git a/src/packages/jsonapi/interfaces.js b/src/packages/jsonapi/interfaces.js index 642e6fac..c607c29e 100644 --- a/src/packages/jsonapi/interfaces.js +++ b/src/packages/jsonapi/interfaces.js @@ -19,6 +19,7 @@ interface JSONAPI$LinkObject { type JSONAPI$Link = ?(string | JSONAPI$LinkObject); interface JSONAPI$ResourceLinksObject { + // $FlowIgnore self?: JSONAPI$Link; related?: JSONAPI$Link; } @@ -74,7 +75,8 @@ export interface JSONAPI$ErrorObject { } export interface JSONAPI$Document { - data?: JSONAPI$ResourceObject | Array; + // $FlowIgnore + data?: Array | JSONAPI$ResourceObject; links?: JSONAPI$DocumentLinks; errors?: Array; included?: Array; diff --git a/src/packages/router/route/params/errors/resource-mismatch-error.js b/src/packages/router/route/params/errors/resource-mismatch-error.js index 35c9ec75..31fb69a2 100644 --- a/src/packages/router/route/params/errors/resource-mismatch-error.js +++ b/src/packages/router/route/params/errors/resource-mismatch-error.js @@ -7,9 +7,12 @@ import { createServerError } from '../../../../server'; class ResourceMismatchError extends TypeError { constructor(path: string, expected: mixed, actual: mixed) { if (typeof actual === 'string') { - actual = `'${actual}'`; + actual = `'${String(actual)}'`; } + actual = String(actual); + expected = String(expected); + super(`Expected '${expected}' for parameter '${path}' but got ${actual}.`); } }