nativemodels
Advanced tools
@@ -11,3 +11,3 @@ const createType = require('./../createType'); | ||
| throw new Error(`Property ${key} is not in the list of enumerable values`); | ||
| throw new Error(`NativeModels - Property ${key} is not in the list of enumerable values`); | ||
| }, | ||
@@ -14,0 +14,0 @@ }); |
@@ -14,3 +14,3 @@ const createType = require('./../createType'); | ||
| throw new Error(`Property ${key} is not a GUID`); | ||
| throw new Error(`NativeModels - Property ${key} is not a GUID`); | ||
| }, | ||
@@ -17,0 +17,0 @@ }); |
@@ -13,6 +13,6 @@ const createType = require('./../createType'); | ||
| if (!isRegex(expression)) { | ||
| throw new Error(`Regex expression provided isn't a valid regex`); | ||
| throw new Error(`NativeModels - Regex expression provided isn't a valid regex`); | ||
| } | ||
| throw new Error(`Property ${key} (${value}) is not a/an ${typeName}`); | ||
| throw new Error(`NativeModels - Property ${key} (${value}) is not a/an ${typeName}`); | ||
| }, | ||
@@ -19,0 +19,0 @@ }); |
@@ -14,3 +14,3 @@ const createType = require('./../createType'); | ||
| throw new Error(`Property ${key} is not an array`); | ||
| throw new Error(`NativeModels - Property ${key} is not an array`); | ||
| }, | ||
@@ -17,0 +17,0 @@ }); |
@@ -9,3 +9,3 @@ const overrides = { | ||
| throw new Error(`Property: '${key}' is required`); | ||
| throw new Error(`NativeModels - Property: '${key}' is required`); | ||
| }, | ||
@@ -12,0 +12,0 @@ strictCheck: () => true, |
@@ -10,3 +10,3 @@ const createType = require('./../createType'); | ||
| if (isUndefined(value) || value === '' || value === null) { | ||
| throw new Error(`Property: '${key}' is required`); | ||
| throw new Error(`NativeModels - Property: '${key}' is required`); | ||
| } | ||
@@ -21,3 +21,3 @@ | ||
| throw new Error(`Property ${key} is not a boolean`); | ||
| throw new Error(`NativeModels - Property ${key} is not a boolean`); | ||
| }, | ||
@@ -24,0 +24,0 @@ }); |
@@ -17,3 +17,3 @@ const createType = require('./../createType'); | ||
| throw new Error(`Property ${key} is not a date`); | ||
| throw new Error(`NativeModels - Property ${key} is not a date`); | ||
| }; | ||
@@ -20,0 +20,0 @@ |
@@ -16,3 +16,3 @@ const createType = require('./../createType'); | ||
| throw new Error(`Property ${key} is not a float`); | ||
| throw new Error(`NativeModels - Property ${key} is not a float`); | ||
| }; | ||
@@ -19,0 +19,0 @@ |
+2
-2
@@ -12,3 +12,3 @@ const createType = require('./../createType'); | ||
| throw new Error(`Property ${key} is not an int`); | ||
| throw new Error(`NativeModels - Property ${key} is not an int`); | ||
| }; | ||
@@ -25,3 +25,3 @@ | ||
| throw new Error(`Property: '${key}' is required`); | ||
| throw new Error(`NativeModels - Property: '${key}' is required`); | ||
| }, | ||
@@ -28,0 +28,0 @@ strictCheck: (key, value) => isValidInt(key, value, true), |
@@ -14,3 +14,3 @@ const createType = require('./../createType'); | ||
| throw new Error(`Property ${key} is not an object`); | ||
| throw new Error(`NativeModels - Property ${key} is not an object`); | ||
| }, | ||
@@ -17,0 +17,0 @@ }); |
@@ -17,3 +17,3 @@ const createType = require('./../createType'); | ||
| if (options.length && value.length > options.length) { | ||
| throw new Error(`Property ${key} is longer than ${options.length}`); | ||
| throw new Error(`NativeModels - Property ${key} is longer than ${options.length}`); | ||
| } | ||
@@ -23,3 +23,3 @@ return true; | ||
| throw new Error(`Property ${key} is not a string`); | ||
| throw new Error(`NativeModels - Property ${key} is not a string`); | ||
| }, | ||
@@ -26,0 +26,0 @@ }); |
@@ -13,3 +13,3 @@ const invalidTypeCheck = require('./checks/invalidType'); | ||
| if (!checks[name](type, key, value)) { | ||
| throw new Error(`Failed ${name} check. Key: ${key} | Value: ${value}`); | ||
| throw new Error(`NativeModels - Failed ${name} check. Key: ${key} | Value: ${value}`); | ||
| } | ||
@@ -16,0 +16,0 @@ }); |
@@ -23,3 +23,3 @@ /* eslint max-params: off */ | ||
| if (!schema[property]) { | ||
| throw new Error(`${property} is not a property of model`); | ||
| throw new Error(`NativeModels - ${property} is not a property of model`); | ||
| } | ||
@@ -26,0 +26,0 @@ |
| const strictCheck = (schema, record) => | ||
| Object.keys(record).forEach((key) => { | ||
| if (!schema[key]) { | ||
| throw new Error(`Property: '${key}' is not defined in the schema`); | ||
| throw new Error(`NativeModels - Property: '${key}' is not defined in the schema`); | ||
| } | ||
@@ -6,0 +6,0 @@ }); |
@@ -10,3 +10,3 @@ const buildType = require('./build'); | ||
| throw new Error(`${value} is not a valid type`); | ||
| throw new Error(`NativeModels - ${value} is not a valid type`); | ||
| } else if (types[value.type]) { | ||
@@ -18,3 +18,3 @@ const type = buildType(value, types, fns); | ||
| throw new Error(`${value} is not a valid type`); | ||
| throw new Error(`NativeModels - ${value} is not a valid type`); | ||
| }; |
+1
-1
@@ -50,3 +50,3 @@ { | ||
| }, | ||
| "version": "2.3.1" | ||
| "version": "2.3.2" | ||
| } |
36030
0.84%