{"_id":"type-func","_rev":"6-33dbf8e2277ebdf06ae26ac9fad166d2","name":"type-func","description":"Type functions","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"type-func","version":"1.0.0","description":"Type functions","main":"dist/bundle.js","jsnext:main":"dist/bundle.es.js","directories":{"test":"test"},"scripts":{"test":"cd test && node run","build":"node ./rollit"},"author":{"name":"Quentin Engles","email":"hollowdoor99@gmail.com"},"license":"MIT","devDependencies":{"babel-preset-es2015-rollup":"^1.2.0","rollup-plugin-babel":"^2.6.1"},"gitHead":"d81670f40ba1a36541563c2d7f2cbe7068fc3adc","_id":"type-func@1.0.0","_shasum":"160159bbf9b0772cd9f51aa003cc763454a3ada8","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"hollowdoor","email":"hollowdoor99@gmail.com"},"maintainers":[{"name":"hollowdoor","email":"hollowdoor99@gmail.com"}],"dist":{"shasum":"160159bbf9b0772cd9f51aa003cc763454a3ada8","tarball":"https://registry.npmjs.org/type-func/-/type-func-1.0.0.tgz","integrity":"sha512-JMYXeH5cTkKFnYf394KAbxW+9Sr+t5Kvj+aDf4ed0GE1f1MpcGIciR5ThXBD+ICpWg1MkPVT5hHnTJJdUn80wg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDKoXOBC+Yq1UuXK4G4oAdUvNYXghwsfyAxsntIu9Yo/AiEA31zvaDw8ZQPSKViskroor1CsDr1nil6r8i4Lgqf3bYk="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/type-func-1.0.0.tgz_1478059422942_0.12530271243304014"}},"1.0.1":{"name":"type-func","version":"1.0.1","description":"Type functions","main":"dist/bundle.js","jsnext:main":"dist/bundle.es.js","directories":{"test":"test"},"scripts":{"test":"cd test && node run","build":"node ./rollit"},"author":{"name":"Quentin Engles","email":"hollowdoor99@gmail.com"},"license":"MIT","devDependencies":{"babel-preset-es2015-rollup":"^1.2.0","rollup-plugin-babel":"^2.6.1"},"gitHead":"2da3b7fd5a54174001378a3b5338ed6f85af0616","_id":"type-func@1.0.1","_shasum":"f78a204962a3de908d3a52a0c1f90187e6051712","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"hollowdoor","email":"hollowdoor99@gmail.com"},"maintainers":[{"name":"hollowdoor","email":"hollowdoor99@gmail.com"}],"dist":{"shasum":"f78a204962a3de908d3a52a0c1f90187e6051712","tarball":"https://registry.npmjs.org/type-func/-/type-func-1.0.1.tgz","integrity":"sha512-mSXFsgaMXhUdo3iI7jQu5EnO7M+WcG+DoAYo9FWNAKVjXKYIUqi2yU/59S+IBFzHAH4ugWA7hv+G7wqb1XjfXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQUwrkwjdVDQjfqa8ICynBQIU+uyqKi7GtHwAP9l1EMAiEA9Ntrne41v9bD0WMzUdzdQGSNNOwJczzXnvodk/G3Wdo="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/type-func-1.0.1.tgz_1478059544855_0.147042564349249"}},"1.0.2":{"name":"type-func","version":"1.0.2","description":"Type functions","main":"dist/bundle.js","jsnext:main":"dist/bundle.es.js","directories":{"test":"test"},"scripts":{"test":"cd test && node run","build":"node ./rollit"},"author":{"name":"Quentin Engles","email":"hollowdoor99@gmail.com"},"license":"MIT","devDependencies":{"babel-preset-es2015-rollup":"^1.2.0","rollup-plugin-babel":"^2.6.1"},"gitHead":"53571e8a044dacb3652cafc38cdebb536a5d2ac2","_id":"type-func@1.0.2","_shasum":"7baafa63834f2a981efce106295ae9d1c7a203c4","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"hollowdoor","email":"hollowdoor99@gmail.com"},"dist":{"shasum":"7baafa63834f2a981efce106295ae9d1c7a203c4","tarball":"https://registry.npmjs.org/type-func/-/type-func-1.0.2.tgz","integrity":"sha512-4KXw8sdcQ9CSgg9ag+NcycST7EpSBI40FbysKMuEnNs443/VUuIqJ9LM37lPcET70xy87q8ygZZigWeFmNiqdQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlaq7yZ320pQMg05bI896UGr5Uz5jBqLOFPS4GELpg4gIgeDOXNeEljqoKT7MZb7IIZhZrP1zcRy+nl76TgYvORoQ="}]},"maintainers":[{"name":"hollowdoor","email":"hollowdoor99@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/type-func-1.0.2.tgz_1479412545279_0.19526707148179412"}},"1.0.3":{"name":"type-func","version":"1.0.3","description":"Type functions","main":"dist/bundle.js","jsnext:main":"dist/bundle.es.js","directories":{"test":"test"},"scripts":{"test":"cd test && node run","build":"node ./rollit"},"author":{"name":"Quentin Engles","email":"hollowdoor99@gmail.com"},"license":"MIT","devDependencies":{"babel-preset-es2015-rollup":"^1.2.0","rollup-plugin-babel":"^2.6.1"},"gitHead":"e65c4986880fc0cd2a982f1ebb9d4175577047b5","_id":"type-func@1.0.3","_shasum":"ab184234ae80d8d50057cefeff3b2d97d08ae9b0","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"hollowdoor","email":"hollowdoor99@gmail.com"},"dist":{"shasum":"ab184234ae80d8d50057cefeff3b2d97d08ae9b0","tarball":"https://registry.npmjs.org/type-func/-/type-func-1.0.3.tgz","integrity":"sha512-YA90CUk+i00tWESPNRMahywXhAz+12NLJLKlOWrgHIbqaFXjdZrWstRghaibOW/IxhPjui4SmXxO/03XSGRIjA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxojioSWF8WOI81Mm4XFPYBhnDi7+dwGp2ODUY+53OkwIgZzHTrnsQ3zAoupttNdQbvpIPeRdWNmxor2OP+UvR6Qc="}]},"maintainers":[{"name":"hollowdoor","email":"hollowdoor99@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/type-func-1.0.3.tgz_1479412654867_0.7220882952678949"}}},"readme":"Install\n-------\n\n`npm install --save type-func`\n\nAbout\n-----\n\n\nThis is a collection of functions that return functions that return certain types of values.\n\nThe signature is:\n\n```javascript\ntypeFunc(func|value, default|undefined)\n```\n\n`typeFunc` is one of these types.\n\n-\t`boolean(func|boolean, default|undefined) -> fn(...args)`\n-\t`integer(func|integer, default|undefined) -> fn(...args)`\n-\t`string(func|string, default|undefined) -> fn(...args)`\n\nThe `fn` function returned by one of the above type functions returns the value of that type.\n\nExample:\n\n```javascript\nimport { boolean } from 'type-func';\nlet bool1 = boolean(true);\n\nlet bool2 = boolean(()=>false);\n\n```\n\nThe variables bool1, and bool2 in the above example are functions that return a boolean.\n\nAll returned types are converted from the input to the respective type.\n\nExample:\n\n```javascript\nimport { boolean } from 'type-func';\nlet zero1 = boolean(0);\nconsole.log(zero1());// prints false\nlet zero2 = boolean(()=>0);\nconsole.log(zero2());// also prints false\n```\n\nWhen `undefined` is passed a default value is used. If there is no default value set then `undefined` will be converted as needed.\n\n```javascript\nimport { boolean } from 'type-func';\n\nlet defaultToFalse = boolean(undefined, false)\nconsole.log(defaultToFalse());// prints false\nlet undef = boolean(undefined);\nconsole.log(undef()); // prints false\n```\n\nWhat's this good for?\n---------------------\n\nDefault options. Examples:\n\n```javascript\nimport { boolean } from 'type-func';\n\nfunction myClass(options){\n    this.opt = boolean(options.opt, false);\n}\n```\n\n```javascript\nimport { boolean } from 'type-func';\n\nfunction myClass({opt: opt} = {opt: false}){\n    this.opt = boolean(options.opt);\n}\n```\n\n```javascript\nimport { boolean } from 'type-func';\n\nfunction myClass(opt = boolean(true)){\n    this.opt = boolean(opt);\n}\n```\n\nAbout\n-----\n\nJust some helper functions that return consistent types.\n","maintainers":[{"name":"hollowdoor","email":"hollowdoor99@gmail.com"}],"time":{"modified":"2022-06-28T00:43:00.955Z","created":"2016-11-02T04:03:44.860Z","1.0.0":"2016-11-02T04:03:44.860Z","1.0.1":"2016-11-02T04:05:46.505Z","1.0.2":"2016-11-17T19:55:45.893Z","1.0.3":"2016-11-17T19:57:35.378Z"},"author":{"name":"Quentin Engles","email":"hollowdoor99@gmail.com"},"license":"MIT","readmeFilename":"README.md"}