check-types
Advanced tools
Comparing version 5.1.0 to 6.0.0
{ | ||
"name": "check-types", | ||
"version": "5.1.0", | ||
"version": "6.0.0", | ||
"main": "src/check-types.min.js", | ||
@@ -5,0 +5,0 @@ "ignore": [ |
{ | ||
"name": "check-types", | ||
"version": "5.1.0", | ||
"version": "6.0.0", | ||
"description": "A tiny library for asserting types and values.", | ||
@@ -5,0 +5,0 @@ "repo": "philbooth/check-types.js", |
# History | ||
## 6.0 | ||
* Breaking change: | ||
* `either` modifier removed. | ||
* Eliminated some string duplication. | ||
## 5.1 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "check-types", | ||
"version": "5.1.0", | ||
"version": "6.0.0", | ||
"description": "A little library for asserting types and values.", | ||
@@ -32,6 +32,6 @@ "homepage": "https://github.com/philbooth/check-types.js", | ||
"devDependencies": { | ||
"jshint": "2.8.x", | ||
"jshint": "2.9.x", | ||
"mocha": "2.3.x", | ||
"chai": "3.3.x", | ||
"uglify-js": "2.4.x" | ||
"chai": "3.4.x", | ||
"uglify-js": "2.6.x" | ||
}, | ||
@@ -38,0 +38,0 @@ "scripts": { |
@@ -55,3 +55,3 @@ # check-types.js | ||
21 kb unminified with comments, 6.5 kb minified, 2.2 kb minified + gzipped. | ||
20 kb unminified with comments, 5.9 kb minified, 2.1 kb minified + gzipped. | ||
@@ -142,8 +142,2 @@ ## How do I install it? | ||
* `check.either.xxx(thing).or.yyy(thang)`: | ||
The `either` modifier | ||
returns `true` if either predicate is true, | ||
it will only return `false` | ||
when both predicates are false. | ||
* `check.assert.xxx(thing, message)`: | ||
@@ -155,8 +149,6 @@ The `assert` modifier | ||
It can be applied | ||
to the `not`, `maybe` and `either` modifiers | ||
to the `not` and `maybe` modifiers | ||
using the forms | ||
`check.assert.not.xxx(thing, message)`, | ||
`check.assert.maybe.xxx(thing, message)` | ||
and | ||
`check.assert.either.xxx(thing, message).or.yyy(thang)`. | ||
`check.assert.not.xxx(thing, message)` and | ||
`check.assert.maybe.xxx(thing, message)`. | ||
It is also itself a function, | ||
@@ -470,8 +462,2 @@ which simply throws | ||
* `check.either.xxx(...).or.yyy(...)`: | ||
Returns `true` | ||
if either predicate is true. | ||
Returns `false` | ||
if both predicates are false. | ||
* `check.array.of.xxx(value)`: | ||
@@ -511,3 +497,3 @@ Returns `true` | ||
to be set on the `Error` instance. | ||
Also works with the `not`, `maybe`, `either` and `...of` modifiers. | ||
Also works with the `not`, `maybe` and `...of` modifiers. | ||
@@ -567,7 +553,2 @@ #### Batch operations | ||
```javascript | ||
check.either.even(3).or.odd(3); | ||
// Returns true | ||
``` | ||
```javascript | ||
check.assert.like({ foo: 'bar' }, { baz: 'qux' }, 'Invalid object'); | ||
@@ -574,0 +555,0 @@ // Throws new Error('Invalid object') |
@@ -6,88 +6,67 @@ /*globals define, module, Symbol */ | ||
var messages, predicates, functions, | ||
assert, not, maybe, either, | ||
collections, slice; | ||
var strings, messages, predicates, functions, | ||
assert, not, maybe, collections, slice; | ||
messages = { | ||
equal: 'Invalid value', | ||
undefined: 'Invalid value', | ||
null: 'Invalid value', | ||
assigned: 'Invalid value', | ||
zero: 'Invalid number', | ||
infinity: 'Invalid number', | ||
number: 'Invalid number', | ||
integer: 'Invalid number', | ||
even: 'Invalid number', | ||
odd: 'Invalid number', | ||
greater: 'Invalid number', | ||
less: 'Invalid number', | ||
between: 'Invalid number', | ||
greaterOrEqual: 'Invalid number', | ||
lessOrEqual: 'Invalid number', | ||
inRange: 'Invalid number', | ||
positive: 'Invalid number', | ||
negative: 'Invalid number', | ||
string: 'Invalid string', | ||
emptyString: 'Invalid string', | ||
nonEmptyString: 'Invalid string', | ||
contains: 'Invalid string', | ||
match: 'Invalid string', | ||
boolean: 'Invalid boolean', | ||
object: 'Invalid object', | ||
emptyObject: 'Invalid object', | ||
instance: 'Invalid type', | ||
builtIn: 'Invalid type', | ||
userDefined: 'Invalid type', | ||
like: 'Invalid type', | ||
array: 'Invalid array', | ||
emptyArray: 'Invalid array', | ||
arrayLike: 'Invalid array-like object', | ||
iterable: 'Invalid iterable', | ||
includes: 'Invalid value', | ||
hasLength: 'Invalid length', | ||
date: 'Invalid date', | ||
function: 'Invalid function' | ||
strings = { | ||
v: 'value', | ||
n: 'number', | ||
s: 'string', | ||
b: 'boolean', | ||
o: 'object', | ||
t: 'type', | ||
a: 'array', | ||
al: 'array-like', | ||
i: 'iterable', | ||
d: 'date', | ||
f: 'function', | ||
l: 'length' | ||
}; | ||
predicates = { | ||
equal: equal, | ||
undefined: isUndefined, | ||
null: isNull, | ||
assigned: assigned, | ||
zero: zero, | ||
infinity: infinity, | ||
number: number, | ||
integer : integer, | ||
even: even, | ||
odd: odd, | ||
greater: greater, | ||
less: less, | ||
between: between, | ||
greaterOrEqual: greaterOrEqual, | ||
lessOrEqual: lessOrEqual, | ||
inRange: inRange, | ||
positive: positive, | ||
negative: negative, | ||
string: string, | ||
emptyString: emptyString, | ||
nonEmptyString: nonEmptyString, | ||
contains: contains, | ||
match: match, | ||
boolean: boolean, | ||
object: object, | ||
emptyObject: emptyObject, | ||
instance: instance, | ||
builtIn: builtIn, | ||
userDefined: userDefined, | ||
like: like, | ||
array: array, | ||
emptyArray: emptyArray, | ||
arrayLike: arrayLike, | ||
iterable: iterable, | ||
includes: includes, | ||
hasLength: hasLength, | ||
date: date, | ||
function: isFunction | ||
}; | ||
messages = {}; | ||
predicates = {}; | ||
[ | ||
{ n: 'equal', f: equal, s: 'v' }, | ||
{ n: 'undefined', f: isUndefined, s: 'v' }, | ||
{ n: 'null', f: isNull, s: 'v' }, | ||
{ n: 'assigned', f: assigned, s: 'v' }, | ||
{ n: 'includes', f: includes, s: 'v' }, | ||
{ n: 'zero', f: zero, s: 'n' }, | ||
{ n: 'infinity', f: infinity, s: 'n' }, | ||
{ n: 'number', f: number, s: 'n' }, | ||
{ n: 'integer', f: integer, s: 'n' }, | ||
{ n: 'even', f: even, s: 'n' }, | ||
{ n: 'odd', f: odd, s: 'n' }, | ||
{ n: 'greater', f: greater, s: 'n' }, | ||
{ n: 'less', f: less, s: 'n' }, | ||
{ n: 'between', f: between, s: 'n' }, | ||
{ n: 'greaterOrEqual', f: greaterOrEqual, s: 'n' }, | ||
{ n: 'lessOrEqual', f: lessOrEqual, s: 'n' }, | ||
{ n: 'inRange', f: inRange, s: 'n' }, | ||
{ n: 'positive', f: positive, s: 'n' }, | ||
{ n: 'negative', f: negative, s: 'n' }, | ||
{ n: 'string', f: string, s: 's' }, | ||
{ n: 'emptyString', f: emptyString, s: 's' }, | ||
{ n: 'nonEmptyString', f: nonEmptyString, s: 's' }, | ||
{ n: 'contains', f: contains, s: 's' }, | ||
{ n: 'match', f: match, s: 's' }, | ||
{ n: 'boolean', f: boolean, s: 'b' }, | ||
{ n: 'object', f: object, s: 'o' }, | ||
{ n: 'emptyObject', f: emptyObject, s: 'o' }, | ||
{ n: 'instance', f: instance, s: 't' }, | ||
{ n: 'builtIn', f: builtIn, s: 't' }, | ||
{ n: 'userDefined', f: userDefined, s: 't' }, | ||
{ n: 'like', f: like, s: 't' }, | ||
{ n: 'array', f: array, s: 'a' }, | ||
{ n: 'emptyArray', f: emptyArray, s: 'a' }, | ||
{ n: 'arrayLike', f: arrayLike, s: 'al' }, | ||
{ n: 'iterable', f: iterable, s: 'i' }, | ||
{ n: 'date', f: date, s: 'd' }, | ||
{ n: 'function', f: isFunction, s: 'f' }, | ||
{ n: 'hasLength', f: hasLength, s: 'l' }, | ||
].map(function (data) { | ||
messages[data.n] = 'Invalid ' + strings[data.s]; | ||
predicates[data.n] = data.f; | ||
}); | ||
functions = { | ||
@@ -107,6 +86,4 @@ apply: apply, | ||
maybe = createModifiedPredicates(maybeModifier, maybeImpl); | ||
either = createModifiedPredicates(eitherModifier); | ||
assert.not = createModifiedModifier(assertModifier, not); | ||
assert.maybe = createModifiedModifier(assertModifier, maybe); | ||
assert.either = createModifiedModifier(assertEitherModifier, predicates); | ||
@@ -121,4 +98,3 @@ collections.forEach(createOfPredicates); | ||
not: not, | ||
maybe: maybe, | ||
either: either | ||
maybe: maybe | ||
})); | ||
@@ -726,28 +702,2 @@ | ||
function assertEitherModifier (predicate, defaultMessage) { | ||
return function () { | ||
var error; | ||
try { | ||
assertPredicate(predicate, arguments, defaultMessage); | ||
} catch (e) { | ||
error = e; | ||
} | ||
return { | ||
or: Object.keys(predicates).reduce(delayedAssert, {}) | ||
}; | ||
function delayedAssert (result, key) { | ||
result[key] = function () { | ||
if (error && !predicates[key].apply(null, arguments)) { | ||
throw error; | ||
} | ||
}; | ||
return result; | ||
} | ||
}; | ||
} | ||
/** | ||
@@ -801,26 +751,2 @@ * Public modifier `not`. | ||
/** | ||
* Public modifier `either`. | ||
* | ||
* Returns true if either predicate is true. | ||
*/ | ||
function eitherModifier (predicate) { | ||
return function () { | ||
var shortcut = predicate.apply(null, arguments); | ||
return { | ||
or: Object.keys(predicates).reduce(nopOrPredicate, {}) | ||
}; | ||
function nopOrPredicate (result, key) { | ||
result[key] = shortcut ? nop : predicates[key]; | ||
return result; | ||
} | ||
}; | ||
function nop () { | ||
return true; | ||
} | ||
} | ||
/** | ||
* Public modifier `of`. | ||
@@ -827,0 +753,0 @@ * |
@@ -1,1 +0,1 @@ | ||
!function(n){"use strict";function t(n,t){return n===t}function e(n){return void 0===n}function r(n){return null===n}function u(n){return!e(n)&&!r(n)}function i(n){return 0===n}function a(n){return n===Number.POSITIVE_INFINITY||n===Number.NEGATIVE_INFINITY}function o(n){return"number"==typeof n&&isNaN(n)===!1&&n!==Number.POSITIVE_INFINITY&&n!==Number.NEGATIVE_INFINITY}function c(n){return o(n)&&n%1===0}function f(n){return o(n)&&n%2===0}function l(n){return c(n)&&!f(n)}function d(n,t){return o(n)&&n>t}function s(n,t){return o(n)&&t>n}function y(n,t,e){return e>t?d(n,t)&&s(n,e):s(n,t)&&d(n,e)}function b(n,t){return o(n)&&n>=t}function v(n,t){return o(n)&&t>=n}function m(n,t,e){return e>t?b(n,t)&&v(n,e):v(n,t)&&b(n,e)}function p(n){return d(n,0)}function I(n){return s(n,0)}function g(n){return"string"==typeof n}function h(n){return""===n}function j(n){return g(n)&&""!==n}function O(n,t){return g(n)&&-1!==n.indexOf(t)}function E(n,t){return g(n)&&!!n.match(t)}function N(n){return n===!1||n===!0}function k(n){return"[object Object]"===Object.prototype.toString.call(n)}function w(n){return k(n)&&0===Object.keys(n).length}function S(n,t){try{return n instanceof t}catch(e){return!1}}function T(n,t){try{return S(n,t)||Object.prototype.toString.call(n)==="[object "+t.name+"]"}catch(e){return!1}}function A(n,t){try{return S(n,t)||n.constructor.name===t.name}catch(e){return!1}}function q(n,t){var e;for(e in t)if(t.hasOwnProperty(e)){if(n.hasOwnProperty(e)===!1||typeof n[e]!=typeof t[e])return!1;if(k(n[e])&&q(n[e],t[e])===!1)return!1}return!0}function L(n){return Array.isArray(n)}function P(n){return L(n)&&0===n.length}function _(n){return u(n)&&o(n.length)}function x(n){return"undefined"==typeof Symbol?_(n):u(n)&&D(n[Symbol.iterator])}function F(n,t){var e,r;if(pn.assigned(n))return!1;try{if("undefined"!=typeof Symbol&&n[Symbol.iterator]&&D(n.values)){e=n.values();do if(r=e.next(),r.value===t)return!0;while(!r.done);return!1}Object.keys(n).forEach(function(e){if(n[e]===t)throw 0})}catch(u){return!0}return!1}function V(n,t){return u(n)&&n.length===t}function Y(n){return T(n,Date)&&!isNaN(n.getTime())}function D(n){return"function"==typeof n}function z(n,t){return mn.array(n),D(t)?n.map(function(n){return t(n)}):(mn.array(t),mn.hasLength(n,t.length),n.map(function(n,e){return t[e](n)}))}function G(n,t){return mn.object(n),D(t)?M(n,t):(mn.object(t),R(n,t))}function M(n,t){var e={};return Object.keys(n).forEach(function(r){e[r]=t(n[r])}),e}function R(n,t){var e={};return Object.keys(t).forEach(function(r){var u=t[r];D(u)?pn.assigned(n)?e[r]=!!u._isMaybefied:e[r]=u(n[r]):k(u)&&(e[r]=R(n[r],u))}),e}function B(n){return L(n)?C(n,!1):(mn.object(n),H(n,!1))}function C(n,t){var e;for(e=0;e<n.length;e+=1)if(n[e]===t)return t;return!t}function H(n,t){var e,r;for(e in n)if(n.hasOwnProperty(e)){if(r=n[e],k(r)&&H(r,t)===t)return t;if(r===t)return t}return!t}function J(n){return L(n)?C(n,!0):(mn.object(n),H(n,!0))}function K(n,t){return Object.keys(t).forEach(function(e){n[e]=t[e]}),n}function Q(n,t){return function(){U(n,arguments,t)}}function U(n,t,e){var r=t[t.length-1];W(n.apply(null,t),j(r)?r:e)}function W(n,t){if(n===!1)throw new Error(t||"Assertion failed")}function X(n,t){return function(){function e(n,t){return n[t]=function(){if(r&&!bn[t].apply(null,arguments))throw r},n}var r;try{U(n,arguments,t)}catch(u){r=u}return{or:Object.keys(bn).reduce(e,{})}}}function Z(n){return function(){return $(n.apply(null,arguments))}}function $(n){return!n}function nn(n){var t=function(){return pn.assigned(arguments[0])?!0:n.apply(null,arguments)};return t._isMaybefied=!0,t}function tn(n){return u(n)===!1?!0:n}function en(n){function t(){return!0}return function(){function e(n,e){return n[e]=r?t:bn[e],n}var r=n.apply(null,arguments);return{or:Object.keys(bn).reduce(e,{})}}}function rn(n,t,e){return function(){var r,i;if(r=arguments[0],"maybe"===n&&pn.assigned(r))return!0;if(!t(r))return!1;r=un(t,r),i=jn.call(arguments,1);try{r.forEach(function(t){if(("maybe"!==n||u(t))&&!e.apply(null,[t].concat(i)))throw 0})}catch(a){return!1}return!0}}function un(n,t){switch(n){case _:return jn.call(t);case k:return Object.keys(t).map(function(n){return t[n]});default:return t}}function an(n,t){return on([n,bn,t])}function on(n){var t,e,r,u;return t=n.shift(),e=n.pop(),r=n.pop(),u=e||{},Object.keys(r).forEach(function(e){Object.defineProperty(u,e,{configurable:!1,enumerable:!0,writable:!1,value:t.apply(null,n.concat(r[e],yn[e]))})}),u}function cn(n,t){return on([n,t,null])}function fn(n){bn[n].of=on([rn.bind(null,null),bn[n],bn,null])}function ln(n,t){hn.forEach(function(e){n[e].of=cn(t,bn[e].of)})}function dn(n){In[n].of=on([rn.bind(null,"maybe"),bn[n],bn,null]),mn.maybe[n].of=cn(Q,In[n].of),mn.not[n].of=cn(Q,pn[n].of)}function sn(t){"function"==typeof define&&define.amd?define(function(){return t}):"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:n.check=t}var yn,bn,vn,mn,pn,In,gn,hn,jn;yn={equal:"Invalid value",undefined:"Invalid value","null":"Invalid value",assigned:"Invalid value",zero:"Invalid number",infinity:"Invalid number",number:"Invalid number",integer:"Invalid number",even:"Invalid number",odd:"Invalid number",greater:"Invalid number",less:"Invalid number",between:"Invalid number",greaterOrEqual:"Invalid number",lessOrEqual:"Invalid number",inRange:"Invalid number",positive:"Invalid number",negative:"Invalid number",string:"Invalid string",emptyString:"Invalid string",nonEmptyString:"Invalid string",contains:"Invalid string",match:"Invalid string","boolean":"Invalid boolean",object:"Invalid object",emptyObject:"Invalid object",instance:"Invalid type",builtIn:"Invalid type",userDefined:"Invalid type",like:"Invalid type",array:"Invalid array",emptyArray:"Invalid array",arrayLike:"Invalid array-like object",iterable:"Invalid iterable",includes:"Invalid value",hasLength:"Invalid length",date:"Invalid date","function":"Invalid function"},bn={equal:t,undefined:e,"null":r,assigned:u,zero:i,infinity:a,number:o,integer:c,even:f,odd:l,greater:d,less:s,between:y,greaterOrEqual:b,lessOrEqual:v,inRange:m,positive:p,negative:I,string:g,emptyString:h,nonEmptyString:j,contains:O,match:E,"boolean":N,object:k,emptyObject:w,instance:S,builtIn:T,userDefined:A,like:q,array:L,emptyArray:P,arrayLike:_,iterable:x,includes:F,hasLength:V,date:Y,"function":D},vn={apply:z,map:G,all:B,any:J},hn=["array","arrayLike","iterable","object"],jn=Array.prototype.slice,vn=K(vn,bn),mn=an(Q,W),pn=an(Z,$),In=an(nn,tn),gn=an(en),mn.not=cn(Q,pn),mn.maybe=cn(Q,In),mn.either=cn(X,bn),hn.forEach(fn),ln(mn,Q),ln(pn,Z),hn.forEach(dn),sn(K(vn,{assert:mn,not:pn,maybe:In,either:gn}))}(this); | ||
!function(n){"use strict";function t(n,t){return n===t}function r(n){return void 0===n}function e(n){return null===n}function u(n){return!r(n)&&!e(n)}function f(n){return 0===n}function o(n){return n===Number.POSITIVE_INFINITY||n===Number.NEGATIVE_INFINITY}function i(n){return"number"==typeof n&&isNaN(n)===!1&&n!==Number.POSITIVE_INFINITY&&n!==Number.NEGATIVE_INFINITY}function c(n){return i(n)&&n%1===0}function a(n){return i(n)&&n%2===0}function s(n){return c(n)&&!a(n)}function l(n,t){return i(n)&&n>t}function y(n,t){return i(n)&&t>n}function b(n,t,r){return r>t?l(n,t)&&y(n,r):y(n,t)&&l(n,r)}function p(n,t){return i(n)&&n>=t}function m(n,t){return i(n)&&t>=n}function d(n,t,r){return r>t?p(n,t)&&m(n,r):m(n,t)&&p(n,r)}function h(n){return l(n,0)}function g(n){return y(n,0)}function v(n){return"string"==typeof n}function j(n){return""===n}function I(n){return v(n)&&""!==n}function O(n,t){return v(n)&&-1!==n.indexOf(t)}function E(n,t){return v(n)&&!!n.match(t)}function N(n){return n===!1||n===!0}function k(n){return"[object Object]"===Object.prototype.toString.call(n)}function w(n){return k(n)&&0===Object.keys(n).length}function S(n,t){try{return n instanceof t}catch(r){return!1}}function T(n,t){try{return S(n,t)||Object.prototype.toString.call(n)==="[object "+t.name+"]"}catch(r){return!1}}function A(n,t){try{return S(n,t)||n.constructor.name===t.name}catch(r){return!1}}function P(n,t){var r;for(r in t)if(t.hasOwnProperty(r)){if(n.hasOwnProperty(r)===!1||typeof n[r]!=typeof t[r])return!1;if(k(n[r])&&P(n[r],t[r])===!1)return!1}return!0}function _(n){return Array.isArray(n)}function x(n){return _(n)&&0===n.length}function F(n){return u(n)&&i(n.length)}function L(n){return"undefined"==typeof Symbol?F(n):u(n)&&D(n[Symbol.iterator])}function V(n,t){var r,e;if(dn.assigned(n))return!1;try{if("undefined"!=typeof Symbol&&n[Symbol.iterator]&&D(n.values)){r=n.values();do if(e=r.next(),e.value===t)return!0;while(!e.done);return!1}Object.keys(n).forEach(function(r){if(n[r]===t)throw 0})}catch(u){return!0}return!1}function Y(n,t){return u(n)&&n.length===t}function q(n){return T(n,Date)&&!isNaN(n.getTime())}function D(n){return"function"==typeof n}function G(n,t){return mn.array(n),D(t)?n.map(function(n){return t(n)}):(mn.array(t),mn.hasLength(n,t.length),n.map(function(n,r){return t[r](n)}))}function M(n,t){return mn.object(n),D(t)?z(n,t):(mn.object(t),R(n,t))}function z(n,t){var r={};return Object.keys(n).forEach(function(e){r[e]=t(n[e])}),r}function R(n,t){var r={};return Object.keys(t).forEach(function(e){var u=t[e];D(u)?dn.assigned(n)?r[e]=!!u._isMaybefied:r[e]=u(n[e]):k(u)&&(r[e]=R(n[e],u))}),r}function B(n){return _(n)?C(n,!1):(mn.object(n),H(n,!1))}function C(n,t){var r;for(r=0;r<n.length;r+=1)if(n[r]===t)return t;return!t}function H(n,t){var r,e;for(r in n)if(n.hasOwnProperty(r)){if(e=n[r],k(e)&&H(e,t)===t)return t;if(e===t)return t}return!t}function J(n){return _(n)?C(n,!0):(mn.object(n),H(n,!0))}function K(n,t){return Object.keys(t).forEach(function(r){n[r]=t[r]}),n}function Q(n,t){return function(){U(n,arguments,t)}}function U(n,t,r){var e=t[t.length-1];W(n.apply(null,t),I(e)?e:r)}function W(n,t){if(n===!1)throw new Error(t||"Assertion failed")}function X(n){return function(){return Z(n.apply(null,arguments))}}function Z(n){return!n}function $(n){var t=function(){return dn.assigned(arguments[0])?!0:n.apply(null,arguments)};return t._isMaybefied=!0,t}function nn(n){return u(n)===!1?!0:n}function tn(n,t,r){return function(){var e,f;if(e=arguments[0],"maybe"===n&&dn.assigned(e))return!0;if(!t(e))return!1;e=rn(t,e),f=vn.call(arguments,1);try{e.forEach(function(t){if(("maybe"!==n||u(t))&&!r.apply(null,[t].concat(f)))throw 0})}catch(o){return!1}return!0}}function rn(n,t){switch(n){case F:return vn.call(t);case k:return Object.keys(t).map(function(n){return t[n]});default:return t}}function en(n,t){return un([n,bn,t])}function un(n){var t,r,e,u;return t=n.shift(),r=n.pop(),e=n.pop(),u=r||{},Object.keys(e).forEach(function(r){Object.defineProperty(u,r,{configurable:!1,enumerable:!0,writable:!1,value:t.apply(null,n.concat(e[r],yn[r]))})}),u}function fn(n,t){return un([n,t,null])}function on(n){bn[n].of=un([tn.bind(null,null),bn[n],bn,null])}function cn(n,t){gn.forEach(function(r){n[r].of=fn(t,bn[r].of)})}function an(n){hn[n].of=un([tn.bind(null,"maybe"),bn[n],bn,null]),mn.maybe[n].of=fn(Q,hn[n].of),mn.not[n].of=fn(Q,dn[n].of)}function sn(t){"function"==typeof define&&define.amd?define(function(){return t}):"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:n.check=t}var ln,yn,bn,pn,mn,dn,hn,gn,vn;ln={v:"value",n:"number",s:"string",b:"boolean",o:"object",t:"type",a:"array",al:"array-like",i:"iterable",d:"date",f:"function",l:"length"},yn={},bn={},[{n:"equal",f:t,s:"v"},{n:"undefined",f:r,s:"v"},{n:"null",f:e,s:"v"},{n:"assigned",f:u,s:"v"},{n:"includes",f:V,s:"v"},{n:"zero",f:f,s:"n"},{n:"infinity",f:o,s:"n"},{n:"number",f:i,s:"n"},{n:"integer",f:c,s:"n"},{n:"even",f:a,s:"n"},{n:"odd",f:s,s:"n"},{n:"greater",f:l,s:"n"},{n:"less",f:y,s:"n"},{n:"between",f:b,s:"n"},{n:"greaterOrEqual",f:p,s:"n"},{n:"lessOrEqual",f:m,s:"n"},{n:"inRange",f:d,s:"n"},{n:"positive",f:h,s:"n"},{n:"negative",f:g,s:"n"},{n:"string",f:v,s:"s"},{n:"emptyString",f:j,s:"s"},{n:"nonEmptyString",f:I,s:"s"},{n:"contains",f:O,s:"s"},{n:"match",f:E,s:"s"},{n:"boolean",f:N,s:"b"},{n:"object",f:k,s:"o"},{n:"emptyObject",f:w,s:"o"},{n:"instance",f:S,s:"t"},{n:"builtIn",f:T,s:"t"},{n:"userDefined",f:A,s:"t"},{n:"like",f:P,s:"t"},{n:"array",f:_,s:"a"},{n:"emptyArray",f:x,s:"a"},{n:"arrayLike",f:F,s:"al"},{n:"iterable",f:L,s:"i"},{n:"date",f:q,s:"d"},{n:"function",f:D,s:"f"},{n:"hasLength",f:Y,s:"l"}].map(function(n){yn[n.n]="Invalid "+ln[n.s],bn[n.n]=n.f}),pn={apply:G,map:M,all:B,any:J},gn=["array","arrayLike","iterable","object"],vn=Array.prototype.slice,pn=K(pn,bn),mn=en(Q,W),dn=en(X,Z),hn=en($,nn),mn.not=fn(Q,dn),mn.maybe=fn(Q,hn),gn.forEach(on),cn(mn,Q),cn(dn,X),gn.forEach(an),sn(K(pn,{assert:mn,not:dn,maybe:hn}))}(this); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115137
2291
750