Node.js:
npm install is_js
Bower:
bower install is_js
Build:
npm run build
Test:
npm test
Thanks for considering to contribute. Check here
Many thanks to our contributors: https://github.com/arasatasaygin/is.js/graphs/contributors
interfaces: not, all, any
var getArguments = function() {
return arguments;
};
var arguments = getArguments();
is.arguments(arguments);
=> true
is.not.arguments({foo: 'bar'});
=> true
is.all.arguments(arguments, 'bar');
=> false
is.any.arguments(['foo'], arguments);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.arguments([arguments, 'foo', 'bar']);
=> false
interfaces: not, all, any
is.array(['foo', 'bar', 'baz']);
=> true
is.not.array({foo: 'bar'});
=> true
is.all.array(['foo'], 'bar');
=> false
is.any.array(['foo'], 'bar');
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.array([[1, 2], 'foo', 'bar']);
=> false
interfaces: not, all, any
is.boolean(true);
=> true
is.not.boolean({foo: 'bar'});
=> true
is.all.boolean(true, 'bar');
=> false
is.any.boolean(true, 'bar');
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.boolean([true, 'foo', 'bar']);
=> false
interfaces: not, all, any
is.date(new Date());
=> true
is.not.date({foo: 'bar'});
=> true
is.all.date(new Date(), 'bar');
=> false
is.any.date(new Date(), 'bar');
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.date([new Date(), 'foo', 'bar']);
=> false
interfaces: not, all, any
var obj = document.createElement('div');
is.domNode(obj);
=> true
is.domNode({nope: 'nope'});
=> false
is.not.domNode({});
=> true
is.all.domNode(obj, obj);
=> true
is.any.domNode(obj, {nope: 'nope'});
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.domNode([obj, {nope: 'nope'}]);
=> false
interfaces: not, all, any
is.error(new Error());
=> true
is.not.error({foo: 'bar'});
=> true
is.all.error(new Error(), 'bar');
=> false
is.any.error(new Error(), 'bar');
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.error([new Error(), 'foo', 'bar']);
=> false
interfaces: not, all, any
is.function(toString);
=> true
is.not.function({foo: 'bar'});
=> true
is.all.function(toString, 'bar');
=> false
is.any.function(toString, 'bar');
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.function([toString, 'foo', 'bar']);
=> false
interfaces: not, all, any
is.nan(NaN);
=> true
is.not.nan(42);
=> true
is.all.nan(NaN, 1);
=> false
is.any.nan(NaN, 2);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.nan([NaN, 'foo', 1]);
=> false
interfaces: not, all, any
is.null(null);
=> true
is.not.null(42);
=> true
is.all.null(null, 1);
=> false
is.any.null(null, 2);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.null([null, 'foo', 1]);
=> false
interfaces: not, all, any
is.number(42);
=> true
is.number(NaN);
=> false
is.not.number('42');
=> true
is.all.number('foo', 1);
=> false
is.any.number({}, 2);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.number([42, 'foo', 1]);
=> false
interfaces: not, all, any
is.object({foo: 'bar'});
=> true
// functions are also returning as true
is.object(toString);
=> true
is.not.object('foo');
=> true
is.all.object({}, 1);
=> false
is.any.object({}, 2);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.object([{}, new Object()]);
=> true
interfaces: not, all, any
is.json({foo: 'bar'});
=> true
// functions are returning as false
is.json(toString);
=> false
is.not.json([]);
=> true
is.all.json({}, 1);
=> false
is.any.json({}, 2);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.json([{}, {foo: 'bar'}]);
=> true
interfaces: not, all, any
is.regexp(/test/);
=> true
is.not.regexp(['foo']);
=> true
is.all.regexp(/test/, 1);
=> false
is.any.regexp(new RegExp('ab+c'), 2);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.regexp([{}, /test/]);
=> false
interfaces: not, all, any
is.string('foo');
=> true
is.not.string(['foo']);
=> true
is.all.string('foo', 1);
=> false
is.any.string('foo', 2);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.string([{}, 'foo']);
=> false
interfaces: not, all, any
is.char('f');
=> true
is.not.char(['foo']);
=> true
is.all.char('f', 1);
=> false
is.any.char('f', 2);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.char(['f', 'o', 'o']);
=> true
interfaces: not, all, any
is.undefined(undefined);
=> true
is.not.undefined(null);
=> true
is.all.undefined(undefined, 1);
=> false
is.any.undefined(undefined, 2);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.undefined([{}, undefined]);
=> false
interface: not
is.sameType(42, 7);
=> true
is.sameType(42, '7');
=> false
is.not.sameType(42, 7);
=> false
interfaces: not, all, any
is.windowObject(window);
=> true
is.windowObject({nope: 'nope'});
=> false
is.not.windowObject({});
=> true
is.all.windowObject(window, {nope: 'nope'});
=> false
is.any.windowObject(window, {nope: 'nope'});
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.windowObject([window, {nope: 'nope'}]);
=> false
interfaces: not, all, any
is.empty({});
=> true
is.empty([]);
=> true
is.empty('');
=> true
is.not.empty(['foo']);
=> true
is.all.empty('', {}, ['foo']);
=> false
is.any.empty([], 42);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.empty([{}, 'foo']);
=> false
interfaces: not, all, any
is.existy({});
=> true
is.existy(null);
=> false
is.not.existy(undefined);
=> true
is.all.existy(null, ['foo']);
=> false
is.any.existy(undefined, 42);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.existy([{}, 'foo']);
=> true
interfaces: not, all, any
is.truthy(true);
=> true
is.truthy(null);
=> false
is.not.truthy(false);
=> true
is.all.truthy(null, true);
=> false
is.any.truthy(undefined, true);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.truthy([{}, true]);
=> true
interfaces: not, all, any
is.falsy(false);
=> true
is.falsy(null);
=> true
is.not.falsy(true);
=> true
is.all.falsy(null, false);
=> true
is.any.falsy(undefined, true);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.falsy([false, true, undefined]);
=> false
interfaces: not, all, any
is.space(' ');
=> true
is.space('foo');
=> false
is.not.space(true);
=> true
is.all.space(' ', 'foo');
=> false
is.any.space(' ', true);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.space([' ', 'foo', undefined]);
=> false
interfaces: not, all, any
is.url('http://www.test.com');
=> true
is.url('foo');
=> false
is.not.url(true);
=> true
is.all.url('http://www.test.com', 'foo');
=> false
is.any.url('http://www.test.com', true);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.url(['http://www.test.com', 'foo', undefined]);
=> false
interfaces: not, all, any
is.email('test@test.com');
=> true
is.email('foo');
=> false
is.not.email('foo');
=> true
is.all.email('test@test.com', 'foo');
=> false
is.any.email('test@test.com', 'foo');
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.email(['test@test.com', 'foo', undefined]);
=> false
interfaces: not, all, any
is.creditCard(378282246310005);
=> true
is.creditCard(123);
=> false
is.not.creditCard(123);
=> true
is.all.creditCard(378282246310005, 123);
=> false
is.any.creditCard(378282246310005, 123);
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.creditCard([378282246310005, 123, undefined]);
=> false
interfaces: not, all, any
is.alphaNumeric('alphaNu3er1k');
=> true
is.alphaNumeric('*?');
=> false
is.not.alphaNumeric('*?');
=> true
is.all.alphaNumeric('alphaNu3er1k', '*?');
=> false
is.any.alphaNumeric('alphaNu3er1k', '*?');
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.alphaNumeric(['alphaNu3er1k', '*?']);
=> false
interfaces: not, all, any
is.timeString('13:45:30');
=> true
is.timeString('90:90:90');
=> false
is.not.timeString('90:90:90');
=> true
is.all.timeString('13:45:30', '90:90:90');
=> false
is.any.timeString('13:45:30', '90:90:90');
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.timeString(['13:45:30', '90:90:90']);
=> false
interfaces: not, all, any
is.dateString('11/11/2011');
=> true
is.dateString('10-21-2012');
=> true
is.dateString('90/11/2011');
=> false
is.not.dateString('90/11/2011');
=> true
is.all.dateString('11/11/2011', '90/11/2011');
=> false
is.any.dateString('11-11-2011', '90/11/2011');
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.dateString(['11/11/2011', '90/11/2011']);
=> false
interfaces: not, all, any
is.usZipCode('02201-1020');
=> true
is.usZipCode('123');
=> false
is.not.usZipCode('123');
=> true
is.all.usZipCode('02201-1020', '123');
=> false
is.any.usZipCode('02201-1020', '123');
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.usZipCode(['02201-1020', '123']);
=> false
interfaces: not, all, any
is.caPostalCode('L8V3Y1');
=> true
is.caPostalCode('L8V 3Y1');
=> true
is.caPostalCode('123');
=> false
is.not.caPostalCode('123');
=> true
is.all.caPostalCode('L8V3Y1', '123');
=> false
is.any.caPostalCode('L8V3Y1', '123');
=> true
// 'all' and 'any' interfaces can also take array parameter
is.all.caPostalCode(['L8V3Y1', '123']);
=> false
interfaces: not, all, any
```javascript is.ukPostCode('B184BJ'); => true
is.ukPostCode('123'); => false
is.not.ukPostCode('123'); => true
is.all.ukPostCode('B184BJ', '123'); => false
is.any.ukPostCode('B184BJ', '123'); => true
// 'all' and 'any' interfaces can also take array p
$ claude mcp add is.js \
-- python -m otcore.mcp_server <graph>