diff --git a/dist/types.js b/dist/types.js index 50dd545..4161b0a 100644 --- a/dist/types.js +++ b/dist/types.js @@ -11,7 +11,7 @@ var isString = exports.isString = function isString(value) { if (typeof value === 'string' || value instanceof String) { return { value: value, - typeof: 'string' + type: 'string' }; } return false; @@ -22,7 +22,7 @@ var isNumber = exports.isNumber = function isNumber(value) { if (typeof value === 'number' && isFinite(value)) { return { value: value, - typeof: 'number' + type: 'number' }; } return false; @@ -33,7 +33,7 @@ var isArray = exports.isArray = function isArray(value) { if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.constructor === Array) { return { value: value, - typeof: 'array' + type: 'array' }; } return false; @@ -44,7 +44,7 @@ var isObject = exports.isObject = function isObject(value) { if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.constructor === Object) { return { value: value, - typeof: 'object' + type: 'object' }; } return false; @@ -55,7 +55,7 @@ var isNull = exports.isNull = function isNull(value) { if (value === null) { return { value: value, - typeof: 'null' + type: 'null' }; } return false; @@ -66,7 +66,7 @@ var isUndefined = exports.isUndefined = function isUndefined(value) { if (typeof value === 'undefined') { return { value: value, - typeof: 'undefined' + type: 'undefined' }; } return false; @@ -77,7 +77,7 @@ var isBoolean = exports.isBoolean = function isBoolean(value) { if (typeof value === 'boolean') { return { value: value, - typeof: 'boolean' + type: 'boolean' }; } return false; @@ -88,7 +88,7 @@ var isDate = exports.isDate = function isDate(value) { if (value instanceof Date) { return { value: value, - typeof: 'date' + type: 'date' }; } return false; diff --git a/dist/types.js.flow b/dist/types.js.flow index 7ac6205..43c819e 100644 --- a/dist/types.js.flow +++ b/dist/types.js.flow @@ -2,7 +2,7 @@ export type ValueDescription = { value: any, - typeof: string + type: string } export type ValidationResult = ValueDescription | false; @@ -12,7 +12,7 @@ export const isString = (value: any): ValidationResult => { if (typeof value === 'string' || value instanceof String) { return { value, - typeof: 'string' + type: 'string' } } return false @@ -23,7 +23,7 @@ export const isNumber = (value: any): ValidationResult => { if (typeof value === 'number' && isFinite(value)) { return { value, - typeof: 'number' + type: 'number' } } return false @@ -34,7 +34,7 @@ export const isArray = (value: any): ValidationResult => { if (value && typeof value === 'object' && value.constructor === Array) { return { value, - typeof: 'array' + type: 'array' } } return false @@ -45,7 +45,7 @@ export const isObject = (value: any): ValidationResult => { if (value && typeof value === 'object' && value.constructor === Object) { return { value, - typeof: 'object' + type: 'object' } } return false @@ -56,7 +56,7 @@ export const isNull = (value: any): ValidationResult => { if (value === null) { return { value, - typeof: 'null' + type: 'null' } } return false @@ -67,7 +67,7 @@ export const isUndefined = (value: any): ValidationResult => { if (typeof value === 'undefined') { return { value, - typeof: 'undefined' + type: 'undefined' } } return false @@ -78,7 +78,7 @@ export const isBoolean = (value: any): ValidationResult => { if (typeof value === 'boolean') { return { value, - typeof: 'boolean' + type: 'boolean' } } return false @@ -89,7 +89,7 @@ export const isDate = (value: any): ValidationResult => { if (value instanceof Date) { return { value, - typeof: 'date' + type: 'date' } } return false diff --git a/lib/types.js b/lib/types.js index 7ac6205..43c819e 100644 --- a/lib/types.js +++ b/lib/types.js @@ -2,7 +2,7 @@ export type ValueDescription = { value: any, - typeof: string + type: string } export type ValidationResult = ValueDescription | false; @@ -12,7 +12,7 @@ export const isString = (value: any): ValidationResult => { if (typeof value === 'string' || value instanceof String) { return { value, - typeof: 'string' + type: 'string' } } return false @@ -23,7 +23,7 @@ export const isNumber = (value: any): ValidationResult => { if (typeof value === 'number' && isFinite(value)) { return { value, - typeof: 'number' + type: 'number' } } return false @@ -34,7 +34,7 @@ export const isArray = (value: any): ValidationResult => { if (value && typeof value === 'object' && value.constructor === Array) { return { value, - typeof: 'array' + type: 'array' } } return false @@ -45,7 +45,7 @@ export const isObject = (value: any): ValidationResult => { if (value && typeof value === 'object' && value.constructor === Object) { return { value, - typeof: 'object' + type: 'object' } } return false @@ -56,7 +56,7 @@ export const isNull = (value: any): ValidationResult => { if (value === null) { return { value, - typeof: 'null' + type: 'null' } } return false @@ -67,7 +67,7 @@ export const isUndefined = (value: any): ValidationResult => { if (typeof value === 'undefined') { return { value, - typeof: 'undefined' + type: 'undefined' } } return false @@ -78,7 +78,7 @@ export const isBoolean = (value: any): ValidationResult => { if (typeof value === 'boolean') { return { value, - typeof: 'boolean' + type: 'boolean' } } return false @@ -89,7 +89,7 @@ export const isDate = (value: any): ValidationResult => { if (value instanceof Date) { return { value, - typeof: 'date' + type: 'date' } } return false