"use strict"; const iftype = require('../lib'), arrayreduce = require('arrayreduce'); function CustomType() { } module.exports = { force: true, mode: '444', data: { get is() { var args = [ {text: '123', val: 123}, { text: 'function foo(){}', val: function foo() { } }, { text: 'new CustomType()', val: new CustomType() }, {text: '["foo", "bar"]', val: ["foo", "bar"]}, {text: '"bar"', val: "bar"}, {text: "null", val: null}, {text: "undefined", val: undefined} ]; var types = [ "'string'", "'number'", "'object'", "'array'", "'function'", "CustomType" ]; return types.map(function (type) { return { type: type, tests: args.map(function (arg) { return { arg: arg.text, type: type, result: iftype(arg.val).is(eval(type)) } }) } }); } } }; if (!module.parent) { require('coz').render(__filename); }