{"_id":"@yokotak0527/kensho","_rev":"38-8e9ea22fc0349afd4c45fc8a3e3de1cb","time":{"1.0.0":"2021-11-11T10:18:24.759Z","1.0.1":"2021-11-11T10:18:24.759Z","1.0.2":"2021-11-11T10:18:24.759Z","1.0.3":"2021-11-11T10:18:24.759Z","1.1.0":"2021-11-11T10:18:24.759Z","1.2.0":"2021-11-11T10:18:24.759Z","1.2.1":"2021-11-11T10:18:24.759Z","2.0.0":"2021-11-11T10:18:24.759Z","2.0.1":"2021-11-11T10:18:24.759Z","2.0.2":"2021-11-11T10:18:24.759Z","2.1.0":"2021-11-11T10:18:24.759Z","2.1.1":"2021-11-11T10:18:24.759Z","2.1.2":"2021-11-11T10:18:24.759Z","2.1.3":"2021-11-11T10:18:24.759Z","2.1.4":"2021-11-11T10:18:24.759Z","2.1.5":"2021-11-11T10:18:24.759Z","2.2.0":"2021-11-11T10:18:24.759Z","2.3.0":"2021-11-11T10:18:24.759Z","2.3.1":"2021-11-11T10:18:24.759Z","2.3.2":"2021-11-11T10:18:24.759Z","2.4.0":"2021-11-11T10:18:24.759Z","2.4.1":"2021-11-11T10:18:24.759Z","2.4.2":"2021-11-11T10:18:24.759Z","2.4.3":"2021-11-11T10:18:24.759Z","2.4.4":"2021-11-11T10:18:24.759Z","2.4.5":"2021-11-11T10:18:24.759Z","2.5.0":"2021-11-11T10:18:24.759Z","2.5.1":"2021-11-11T10:18:24.759Z","2.6.0":"2021-11-11T10:18:24.759Z","2.6.1":"2021-11-11T10:18:24.759Z","created":"2021-11-11T10:18:49.759Z","3.0.0":"2021-11-11T10:18:49.986Z","modified":"2022-04-11T11:10:50.404Z","3.0.1":"2021-11-11T10:25:41.107Z","3.0.2":"2021-11-20T10:04:49.109Z","3.0.3":"2021-11-20T17:45:00.586Z"},"name":"@yokotak0527/kensho","dist-tags":{"latest":"3.0.3"},"versions":{"3.0.0":{"name":"@yokotak0527/kensho","version":"3.0.0","description":"![NPM Download](https://img.shields.io/npm/dt/@yokotak0527/kensho) ![TravisCI](https://travis-ci.org/yokotak0527/kensho.svg?branch=master) ![open issue](https://img.shields.io/github/issues/yokotak0527/kensho) ![MIT licence](https://img.shields.io/github/","main":"./dist/bundle.cjs.js","module":"./dist/bundle.es.js","browser":"./dist/bundle.umd.js","exports":{"import":"./dist/bundle.es.js","require":"./dist/bundle.cjs.js","node":"./dist/bundle.es.js","browser":"./dist/bundle.umd.js","default":"./dist/bundle.cjs.js"},"types":"index.d.ts","scripts":{"build:es":"cross-env OUTPUT=es rollup -c","build:cjs":"cross-env OUTPUT=cjs rollup -c","build:umd":"cross-env OUTPUT=umd rollup -c","build:iife":"cross-env OUTPUT=iife rollup -c","build":"npm run build:es && npm run build:cjs && npm run build:umd && npm run build:iife","watch":"npm start","lint":"eslint ./","start":"npm run build:es -- -w","clean":"rm -rf ./dist","test":"jest","preversion":"npm run test && npm run lint","version":"npm run clean && npm run build && git add -A","postversion":"git push && git push --tags"},"keywords":["validation","TypeScript"],"repository":{"type":"git","url":"git+https://github.com/yokotak0527/kensho.git"},"homepage":"https://github.com/yokotak0527/kensho#readme","author":{"name":"yokotak0527"},"license":"MIT","devDependencies":{"@rollup/plugin-babel":"5.3.0","@rollup/plugin-commonjs":"21.0.1","@rollup/plugin-node-resolve":"13.0.6","@rollup/plugin-typescript":"8.3.0","@types/jest":"27.0.2","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","cross-env":"7.0.3","eslint":"8.1.0","jest":"27.3.1","rollup":"2.59.0","rollup-plugin-terser":"7.0.2","ts-jest":"27.0.7","typescript":"4.4.4"},"volta":{"node":"14.18.1","npm":"6.14.15"},"gitHead":"2257e6ddd74f1512925c8d1f15396ffcc46d173c","bugs":{"url":"https://github.com/yokotak0527/kensho/issues"},"_id":"@yokotak0527/kensho@3.0.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-aGlDwSaGqEi/JYz8nyaNFdgB08PSmAHzaY9cEpb13CWmEFNjBdyTVzocK+M/kR1wDs/QtToiD1gb1nt2lQM3pA==","shasum":"1afc209d199d58b27e28691f127bf77e2129ce50","tarball":"https://registry.npmjs.org/@yokotak0527/kensho/-/kensho-3.0.0.tgz","fileCount":19,"unpackedSize":59268,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJp760E5gDbAgC4s9VpK9RZWpymVOKvcw5DrOULEik6AIhAKse87gZ0qebNvEKhxZwXpFocJeC6hqx5HTjv+mKjIFR"}]},"_npmUser":{"name":"yokotak0527","email":"noreply@yokotakenji.me"},"directories":{},"maintainers":[{"name":"yokotak0527","email":"noreply@yokotakenji.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kensho_3.0.0_1636625929805_0.846016481782065"},"_hasShrinkwrap":false},"3.0.1":{"name":"@yokotak0527/kensho","version":"3.0.1","description":"![NPM Download](https://img.shields.io/npm/dt/@yokotak0527/kensho) ![TravisCI](https://travis-ci.org/yokotak0527/kensho.svg?branch=master) ![open issue](https://img.shields.io/github/issues/yokotak0527/kensho) ![MIT licence](https://img.shields.io/github/","main":"./dist/bundle.cjs.js","module":"./dist/bundle.es.js","browser":"./dist/bundle.umd.js","exports":{"import":"./dist/bundle.es.js","require":"./dist/bundle.cjs.js","node":"./dist/bundle.es.js","browser":"./dist/bundle.umd.js","default":"./dist/bundle.cjs.js"},"types":"index.d.ts","scripts":{"build:es":"cross-env OUTPUT=es rollup -c","build:cjs":"cross-env OUTPUT=cjs rollup -c","build:umd":"cross-env OUTPUT=umd rollup -c","build:iife":"cross-env OUTPUT=iife rollup -c","build":"npm run build:es && npm run build:cjs && npm run build:umd && npm run build:iife","watch":"npm start","lint":"eslint ./","start":"npm run build:es -- -w","clean":"rm -rf ./dist","test":"jest","preversion":"npm run test && npm run lint","version":"npm run clean && npm run build && git add -A","postversion":"git push && git push --tags"},"keywords":["validation","TypeScript"],"repository":{"type":"git","url":"git+https://github.com/yokotak0527/kensho.git"},"homepage":"https://github.com/yokotak0527/kensho#readme","author":{"name":"yokotak0527"},"license":"MIT","devDependencies":{"@rollup/plugin-babel":"5.3.0","@rollup/plugin-commonjs":"21.0.1","@rollup/plugin-node-resolve":"13.0.6","@rollup/plugin-typescript":"8.3.0","@types/jest":"27.0.2","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","cross-env":"7.0.3","eslint":"8.1.0","jest":"27.3.1","rollup":"2.59.0","rollup-plugin-terser":"7.0.2","ts-jest":"27.0.7","typescript":"4.4.4"},"volta":{"node":"14.18.1","npm":"6.14.15"},"gitHead":"c959b90d36ea8c155de24edc4f6b32e5de2ab550","bugs":{"url":"https://github.com/yokotak0527/kensho/issues"},"_id":"@yokotak0527/kensho@3.0.1","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-/AduHjwvje0Sy0LlUDiENyJ10PiW8v2Qf96fTGqnLJXryUxTlumX5TAxKq1dSVLBJzt56WrFgQW/IuAK4G+dKQ==","shasum":"4dc36c3ca1caae774fcd07e94f57e465df9060bf","tarball":"https://registry.npmjs.org/@yokotak0527/kensho/-/kensho-3.0.1.tgz","fileCount":20,"unpackedSize":59519,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGf8+5/tYEqxjAdKCKnM0IyolkdFsohnYGOrc6LtQuebAiBdBN+5nPB3IHOFXwvGqXKlBaQwF+9t1cu8pAu7Ix0pvw=="}]},"_npmUser":{"name":"yokotak0527","email":"noreply@yokotakenji.me"},"directories":{},"maintainers":[{"name":"yokotak0527","email":"noreply@yokotakenji.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kensho_3.0.1_1636626340959_0.1758132062712594"},"_hasShrinkwrap":false},"3.0.2":{"name":"@yokotak0527/kensho","version":"3.0.2","description":"![NPM Download](https://img.shields.io/npm/dt/@yokotak0527/kensho) ![TravisCI](https://travis-ci.org/yokotak0527/kensho.svg?branch=master) ![open issue](https://img.shields.io/github/issues/yokotak0527/kensho) ![MIT licence](https://img.shields.io/github/","main":"./dist/bundle.cjs.js","module":"./dist/bundle.es.js","browser":"./dist/bundle.umd.js","exports":{"import":"./dist/bundle.es.js","require":"./dist/bundle.cjs.js","node":"./dist/bundle.es.js","browser":"./dist/bundle.umd.js","default":"./dist/bundle.cjs.js"},"types":"index.d.ts","scripts":{"build:es":"cross-env OUTPUT=es rollup -c","build:cjs":"cross-env OUTPUT=cjs rollup -c","build:umd":"cross-env OUTPUT=umd rollup -c","build:iife":"cross-env OUTPUT=iife rollup -c","build":"npm run build:es && npm run build:cjs && npm run build:umd && npm run build:iife","watch":"npm start","lint":"eslint ./","start":"npm run build:es -- -w","clean":"rm -rf ./dist","test":"jest","preversion":"npm run test && npm run lint","version":"npm run clean && npm run build && git add -A","postversion":"git push && git push --tags"},"keywords":["validation","TypeScript"],"repository":{"type":"git","url":"git+https://github.com/yokotak0527/kensho.git"},"homepage":"https://github.com/yokotak0527/kensho#readme","author":{"name":"yokotak0527"},"license":"MIT","devDependencies":{"@rollup/plugin-babel":"5.3.0","@rollup/plugin-commonjs":"21.0.1","@rollup/plugin-node-resolve":"13.0.6","@rollup/plugin-typescript":"8.3.0","@types/jest":"27.0.2","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","cross-env":"7.0.3","eslint":"8.1.0","jest":"27.3.1","rollup":"2.59.0","rollup-plugin-terser":"7.0.2","ts-jest":"27.0.7","typescript":"4.4.4"},"volta":{"node":"14.18.1","npm":"6.14.15"},"gitHead":"e87f6d720d8817029eedff4d4aa16ec4ba06a3bf","bugs":{"url":"https://github.com/yokotak0527/kensho/issues"},"_id":"@yokotak0527/kensho@3.0.2","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-w+Gs1nckzunMQz9Pn3gIlFeRJ3fmXSJL40RA6G1Gxq3bbrzUtMKsixgwwABBblDrn7RuctWEAHh7VvWqrSeong==","shasum":"92eb788ebc6d8dc56c2ccc7f4e2ab3dc0d872c37","tarball":"https://registry.npmjs.org/@yokotak0527/kensho/-/kensho-3.0.2.tgz","fileCount":20,"unpackedSize":59686,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmMhBCRA9TVsSAnZWagAAzxYP/0MI4ZEa2ahKBk1/CWMB\nGwVaqrpX58gSGH4t73Di+aEgo4xvDaiJZJ4F5z54Djip6BEVIe4BQRGoQNYj\n7FPKARBwhXijQZbtZk+Nx2OVVbwJ4C8Ve3jJDztZUWhPCUS79+IVWJ8wS7eV\nGB4TdeJyjqTAao64IOf/+ZWUtTzZW6uwE/os6R292kzXjIAA9cybWGG9fpbG\nzKsMAKfI68qggfASg5hjBjskKVYG1AXkFoTIe/QfBW6gBon4rQKPIONSJe8x\nvQLvy3z1YUpyAWTvW/FMErqotaQhyXE8xbOAAq3Hkx8yt49lhPIYcW0tfMTd\nSGcmkyOQPtQAKMmMJ2UNgeZw2Gil5Hp9Xhk5OE4oa34c2DbxaNkwOhK0Tyg9\nsPo5RPx2DGGXViZ2m9Yn1sV9dPnvt7mgjgqnOb0tulQmFSpIzsPHI3MP9Yb2\n6sgzegobCVxUbHOES7AAXeJFjK3L1oVJDmT0zQf5MiISaDZL25oT7f3kEzVJ\n5F+aVccfn/86QwRzcjE1Zfm+LflSttuVxc17S0lah6LPGbczTQ7eeoxXmTSF\nBG6hR/gcIXIjVa55kQ0nDd9UQlMquyWsgirusLjOzpWPjSr2Lgtt9DyiH4gi\nPfEnSd3SFCKwLlonRpBZvn/4dNh6Ni6zQW/VBdnICbWhbPBE+m0ply+oSoVT\n5AvD\r\n=M+72\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGoOwMAtAHD+J8NDqKWbT9V23aIVqzP6+phkP8yH++R0AiBPTg2/VxT2mKLXYycK+OKPYiT25hDC65TPsbmNvldGig=="}]},"_npmUser":{"name":"yokotak0527","email":"noreply@yokotakenji.me"},"directories":{},"maintainers":[{"name":"yokotak0527","email":"noreply@yokotakenji.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kensho_3.0.2_1637402688947_0.8735387001304815"},"_hasShrinkwrap":false},"3.0.3":{"name":"@yokotak0527/kensho","version":"3.0.3","description":"![NPM Download](https://img.shields.io/npm/dt/@yokotak0527/kensho) ![TravisCI](https://travis-ci.org/yokotak0527/kensho.svg?branch=master) ![open issue](https://img.shields.io/github/issues/yokotak0527/kensho) ![MIT licence](https://img.shields.io/github/","main":"./dist/bundle.cjs.js","module":"./dist/bundle.es.js","exports":{"import":"./dist/bundle.es.js","require":"./dist/bundle.cjs.js","node":"./dist/bundle.es.js","default":"./dist/bundle.cjs.js"},"types":"index.d.ts","scripts":{"build:es":"cross-env OUTPUT=es rollup -c","build:cjs":"cross-env OUTPUT=cjs rollup -c","build":"npm run build:es && npm run build:cjs","watch":"npm start","lint":"eslint ./","start":"npm run build:es -- -w","clean":"rm -rf ./dist","test":"jest","preversion":"npm run test && npm run lint","version":"npm run clean && npm run build && git add -A","postversion":"git push && git push --tags"},"keywords":["validation","TypeScript"],"repository":{"type":"git","url":"git+https://github.com/yokotak0527/kensho.git"},"homepage":"https://github.com/yokotak0527/kensho#readme","author":{"name":"yokotak0527"},"license":"MIT","devDependencies":{"@rollup/plugin-babel":"5.3.0","@rollup/plugin-commonjs":"21.0.1","@rollup/plugin-node-resolve":"13.0.6","@rollup/plugin-typescript":"8.3.0","@types/jest":"27.0.2","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","cross-env":"7.0.3","eslint":"8.1.0","jest":"27.3.1","rollup":"2.59.0","ts-jest":"27.0.7","typescript":"4.4.4"},"volta":{"node":"14.18.1","npm":"6.14.15"},"gitHead":"ed4c7af6ab6e946b54bfc5ee5fb32ba5df22cac4","bugs":{"url":"https://github.com/yokotak0527/kensho/issues"},"_id":"@yokotak0527/kensho@3.0.3","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-pvrcRjgNY/CYT1wGfnTCvo3X03lKA13gEKrZodNcJ6EXq2mOGmIPBH9sNyEwpECAHAbUkI6RN0p9KSGH8uLjaA==","shasum":"80b947e42c6a53815c2cf2be4017adffab077c96","tarball":"https://registry.npmjs.org/@yokotak0527/kensho/-/kensho-3.0.3.tgz","fileCount":12,"unpackedSize":33012,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhmTQcCRA9TVsSAnZWagAAQwwP/jfDYYuGbkIEPPwm8mAD\nI6x/JgFsvuB9KL4LGfj+Dez5MaExYIGkWJKozl7P4B9yiPfhhHPG3xgKO/AP\nzJsvLLb01MNQLPcJrhjwgMl40r++9x1u6ei7Y5XfMIoijMIDLSEiSAywV9CC\nQ06wLdYC0PtIZfXaW/zlNuqM1oDTNKHQ8C/twB3WD5NlAwVlYWwdMcTYJ/F9\nYKUNTnEAM+9ihXWj5YFwuJNvpRQGVdC9COJMrzDacedEf+YBJCDyyxqQh79y\nwvywgqSQp7nr8XAaf9Wsz8oeeo0leskuMRudfqdqCcSEXPEYzAMnHeFi+2Zf\nH2kxlBMpEsbJT55BlEgnawT9F6IlwpVafaxcbjSge45BCa3btSNoxhwnxjYF\nSZYyPIdQwUAdywZUXk/qNgH3pnXKugLs4ZYs/bV1VRhaWqK1fiHgIFep231D\n2RvDMCsb+acvByWyCw6yRzbW1DtB7BKD3rvrQ9paTvYGLmijjrBu3XNayVAZ\nzJxV2zTwLgppiIfDeJyHfXWqu7eoRlaOLKJQp5IhGFDBRQuIrXpdY9tPjhYN\n0JPEK4G74cop13175ovj9Pn8aDtSOsiW28xpkmfTl1yIAD+1GHQbYSS5RMc8\ny/DgmtJjTU1pkgHgBJTt9qIX9mH9eJ/Bx+qNmDOzt2g34jUKSV+NsYn06Q3X\n6HKk\r\n=Re1L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAL3JLLrnrLBcFpk1obo+KmaQqjcCadBpHp8/mbhTQ2gAiA0aNvgvZvARwqm2pdIuPZCMXokdkB1LIMxaKa8CtN7GA=="}]},"_npmUser":{"name":"yokotak0527","email":"noreply@yokotakenji.me"},"directories":{},"maintainers":[{"name":"yokotak0527","email":"noreply@yokotakenji.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kensho_3.0.3_1637430300420_0.2057167041511181"},"_hasShrinkwrap":false}},"maintainers":[{"name":"yokotak0527","email":"noreply@yokotakenji.me"}],"description":"![NPM Download](https://img.shields.io/npm/dt/@yokotak0527/kensho) ![TravisCI](https://travis-ci.org/yokotak0527/kensho.svg?branch=master) ![open issue](https://img.shields.io/github/issues/yokotak0527/kensho) ![MIT licence](https://img.shields.io/github/","homepage":"https://github.com/yokotak0527/kensho#readme","keywords":["validation","TypeScript"],"repository":{"type":"git","url":"git+https://github.com/yokotak0527/kensho.git"},"author":{"name":"yokotak0527"},"bugs":{"url":"https://github.com/yokotak0527/kensho/issues"},"license":"MIT","readme":"# Kensho\n\n![NPM Download](https://img.shields.io/npm/dt/@yokotak0527/kensho)\n![TravisCI](https://travis-ci.org/yokotak0527/kensho.svg?branch=master)\n![open issue](https://img.shields.io/github/issues/yokotak0527/kensho)\n![MIT licence](https://img.shields.io/github/license/yokotak0527/kensho)\n\nThe JavaScript validation package.\n\nThis plugin can't validate form values. If you want to it, use [Kensho-form](https://www.npmjs.com/package/@yokotak0527/kensho-form).\n\n**Note** :  \nDestructive changes have been made since version 2.X. It is not compatible. If you need an older version, please use [Kensho-legacy](https://www.npmjs.com/package/@yokotak0527/kensho-legacy). 🙇‍♂️\n\nThis package works with the rule that validates values and the converter that converts values before validating them.  \nThey are not included in this package, so you will need to import them from outside to actually validate the values.  \nHow to import and create it is explained below. There is also a generic rule and converter available as a separate module, if you want to use it.\n\n- [kensho-rulebook-default](https://www.npmjs.com/package/@yokotak0527/kensho-rulebook-default)\n- [kensho-convbox-default](https://www.npmjs.com/package/@yokotak0527/kensho-convbox-default)\n\n# Install\n\n```bash\n$ npm i @yokotak0527/kensho\n```\n\n# Setup\n\n```js\nimport Kensho from '@yokotak0527/kensho'\n// or if you are using CommonJS\nconst Kensho = require('@yokotak0527/kensho')\n```\n\n# Usage\n\n```js\nKensho.rule.add('isNumber', value => typeof value === 'number')\nKensho.validate('isNumber', 10) // true\n\n// with to use a converter\nKensho.converter.add('stringToNumber', value => {\n  if (typeof value !=== 'string') throw new Error('value is not a string.')\n  return Number(value)\n})\nKensho.validate('isNumber', Kensho.convert('stringToNumber', \"10\")) // true\n\n// with to use multiple converters\nKensho.converter.add('numberToString', value => {\n  if (typeof value !=== 'number') throw new Error('value is not a number.')\n  return value.toString()\n})\nKensho.validate('isNumber', Kensho.convert(['numberToString', 'stringToNumber'], 2)) // true\n\n// if you add an alias to `Kensho.convert`, it will be easier to read.\nconst to = Kensho.convert\nKensho.validate('isNumber', to(['numberToString', 'stringToNumber'], 2)) // true\n```\n\nThe above example shows the sequential addition of rules and converters, but in actual use, you will probably have to import them from external sources.\n\n# Rule\n\nThe rule is the logic used to validate a value.\n\nKensho provide general rules as external rules [kensho-rulebook-default](https://www.npmjs.com/package/@yokotak0527/kensho-rulebook-default),\nbut also you can add your original rules.\n\n## Add your original rules\n\n```js\nimport Kensho from '@yokotak0527/kensho'\n\n// The rule function takes the value to be verified as the first argument, the\n// function option as the second argument as an object, and returns a boolean\n// value. The options are not required. If there are options, please set the\n// default values for all properties.\nKensho.rule.add('isBoolean', val => typeof val === 'boolean')\n\nKensho.validate('isBoolean', false) // -> true\n```\n\n### With TypeScript\n\nYou can extend RuleBook(rule list kvs) with your `*.d.ts` file.\n\n```typescript\n// your *.d.ts file\ndeclare namespace Kensho {\n  interface RuleBook {\n    'isBoolean' : (val:any)=>boolean\n  }\n}\n```\n\n```typescript\nimport Kensho from '@yokotak0527/kensho'\n\nKensho.rule.add('isBoolean', val => typeof val === 'boolean')\n```\n\nIf you create a declaration file, the arguments will be inferred when you run `Kensho.validate()`.\n\n# RuleBook\n\nThe ruleBook is a key-value store for rules. It is used for distributing rules or for bulk registration.\n\n## create / use the RuleBook\n\n```js\nconst ruleBook = {\n  'isBoolean': value => typeof value === 'boolean',\n  'isString': value => typeof value === 'string',\n  'isNaturalNumber': (value, { zero = true }) => zero ? value >= 0 : value > 0\n}\n\nKensho.rule.import(ruleBook)\n```\n\n# Converter\n\nThe converter is a logic that converts a passed value into another value or types.\n\nKensho provide general converters as external convertes [kensho-convbox-default](https://www.npmjs.com/package/@yokotak0527/kensho-convbox-default),\nbut also you can add your original converters.\n\n## Add your original converters\n\n```js\nimport Kensho from '@yokotak0527/kensho'\n\n// The converter function takes the value to be converted and returns the converted value.\nKensho.converter.add('stringToNumber', value => {\n  if (typeof value !== 'string') throw new Error('value is not a string.')\n  return Number(value)\n})\n\nKensho.convert('stringToNumber', \"2\") // -> 2\n```\n\n### with TypeScript\n\nYou can extend ConverterBox(converter list kvs) with your `*.d.ts` file.\n\n```typescript\n// your *.d.ts file\ndeclare namespace Kensho {\n  interface ConverterBox {\n    'stringToNumber' : (val:string)=>number\n  }\n}\n```\n\n```typescript\nimport Kensho from '@yokotak0527/kensho'\n\nKensho.converter.add('stringToNumber', value => {\n  if (typeof value !== 'string') throw new Error('value is not a string.')\n  return Number(value)\n})\n```\n\n\n## `Kensho.convert(converter, value)`\n\nThe argument `converter` can be of type `string` or `Array<string>`.\n\n### with TypeScript\n\nWhen using TypeScript, generics can be used to specify the types of input and output values.\n\n```typescript\nKensho.convert<string, number>('stringToNumber', '2') // -> 2\n```\n\nHowever, if the declaration file extends ConverterBox, it will be inferred.\n\n```typescript\nKensho.convert('stringToNumber', 2) // tsc catched a error\n```\n\nIf an array of strings is passed as the first argument, no inference will be performed, but passing the array `as const` will enable the inference.\n\n```typescript\nKensho.convert(['stringToNumber', 'numberToString'] as const, 2) //  // tsc catched a error\n```\n\n# ConverterBox\n\nThe converterBox is a key-value store for converter. It is used for distributing converter or for bulk registration.\n\n## create / use the ConverterBox\n\n```js\nconst converterBox = {\n}\n\nKensho.converter.import(converterBox)\n```\n\n# `Kensho.validate()`\n\nThe arguments of this function is.\n\n1. `ruleName:string` - to be use.\n2. `value:any` - to be validated.\n3. `ruleOption?:Object`- is `ruleName` option.\n4. `validateOption?:Object` - is validating options.\n\n## validateOption\n\n| props                | default | desc. |\n|----------------------|---------|-------|\n| `throughEmptyString` | `false` | Returns `true` if the value is empty string before validating it. |\n| `throughNull`        | `false` | Returns `true` if the value is null before validating it. |\n| `throughUndefined`   | `false` | Returns `true` if the value is undefined before validating it. |\n| `throughNaN`         | `false` | Returns `true` if the value is undefined before validating it. |\n\nThese values can be set in the global configuration and do not need to be specified each time.\n\n# Global config.\n\n```js\nKensho.config = {\n  validate : {\n    throughEmptyString : false,\n    throughNull        : false,\n    throughUndefined   : false,\n    throughNaN         : false\n  }\n}\n```","readmeFilename":"README.md"}