{"_id":"allowlist","_rev":"2779726","name":"allowlist","description":"Create allow/deny matcher with Patterns, Regex and Functions","dist-tags":{"latest":"0.1.1"},"maintainers":[{"name":"npm:farnabaz","email":""},{"name":"npm:pi0","email":""},{"name":"pi0","email":"pooya@pi0.ir"}],"time":{"modified":"2022-06-06T08:22:45.000Z","created":"2020-11-27T19:21:18.795Z","0.1.1":"2020-12-06T20:55:33.147Z","0.0.4":"2020-12-01T23:18:07.900Z","0.0.3":"2020-11-30T08:40:05.255Z","0.0.2":"2020-11-30T08:06:38.147Z","0.0.1":"2020-11-27T19:21:18.795Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/nuxt-contrib/allowlist.git"},"versions":{"0.1.1":{"name":"allowlist","version":"0.1.1","description":"Create allow/deny matcher with Patterns, Regex and Functions","repository":{"type":"git","url":"git+https://github.com/nuxt-contrib/allowlist.git"},"license":"MIT","sideEffects":false,"main":"dist/index.js","module":"dist/index.mjs","browser":"dist/index.browser.js","types":"dist/index.d.ts","scripts":{"build":"siroc build","lint":"eslint --ext .ts .","release":"yarn test && yarn build && standard-version && git push --follow-tags && npm publish","test":"yarn lint && jest"},"dependencies":{},"devDependencies":{"@nuxtjs/eslint-config-typescript":"latest","@types/jest":"latest","eslint":"latest","jest":"latest","siroc":"latest","standard-version":"latest","ts-jest":"latest","typescript":"latest"},"gitHead":"bb8ea85fde61ddeb949b1e4a34e47da0e43a4d29","bugs":{"url":"https://github.com/nuxt-contrib/allowlist/issues"},"homepage":"https://github.com/nuxt-contrib/allowlist#readme","_id":"allowlist@0.1.1","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"shasum":"7f337b1e9a292e5aaf59c879933be1172915eaeb","size":3530,"noattachment":false,"key":"/allowlist/-/allowlist-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/allowlist/download/allowlist-0.1.1.tgz"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"directories":{},"maintainers":[{"name":"npm:farnabaz","email":""},{"name":"npm:pi0","email":""},{"name":"pi0","email":"pooya@pi0.ir"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/allowlist_0.1.1_1607288133030_0.8521554884722449"},"_hasShrinkwrap":false,"publish_time":1607288133147,"_cnpm_publish_time":1607288133147,"_cnpmcore_publish_time":"2021-12-16T23:25:15.032Z"},"0.0.4":{"name":"allowlist","version":"0.0.4","description":"Allow","repository":{"type":"git","url":"git+https://github.com/farnabaz/allowlist.git"},"license":"MIT","sideEffects":false,"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"siroc build","lint":"eslint --ext .ts .","release":"yarn test && yarn build && standard-version && git push --follow-tags && npm publish","test":"yarn lint && jest"},"dependencies":{},"devDependencies":{"@nuxtjs/eslint-config-typescript":"latest","@types/jest":"latest","eslint":"latest","jest":"latest","rollup-plugin-typescript2":"latest","siroc":"latest","standard-version":"latest","ts-jest":"latest","typescript":"latest"},"gitHead":"140de05caae1f9c12294380d44f22b9aa5f08560","bugs":{"url":"https://github.com/farnabaz/allowlist/issues"},"homepage":"https://github.com/farnabaz/allowlist#readme","_id":"allowlist@0.0.4","_nodeVersion":"14.3.0","_npmVersion":"6.14.5","dist":{"shasum":"9e7f4aed3bc56348d4a25e1da9c835b30f38aaa7","size":2941,"noattachment":false,"key":"/allowlist/-/allowlist-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/allowlist/download/allowlist-0.0.4.tgz"},"_npmUser":{"name":"farnabaz","email":"farnabaz@gmail.com"},"directories":{},"maintainers":[{"name":"npm:farnabaz","email":""},{"name":"npm:pi0","email":""},{"name":"pi0","email":"pooya@pi0.ir"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/allowlist_0.0.4_1606864687724_0.3244958955811419"},"_hasShrinkwrap":false,"publish_time":1606864687900,"_cnpm_publish_time":1606864687900,"_cnpmcore_publish_time":"2021-12-16T23:25:15.262Z"},"0.0.3":{"name":"allowlist","version":"0.0.3","description":"Allow","repository":{"type":"git","url":"git+https://github.com/farnabaz/allowlist.git"},"license":"MIT","sideEffects":false,"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"siroc build","lint":"eslint --ext .ts .","release":"yarn test && yarn build && standard-version && git push --follow-tags && npm publish","test":"yarn lint && jest"},"dependencies":{},"devDependencies":{"@nuxtjs/eslint-config-typescript":"latest","@types/jest":"latest","eslint":"latest","jest":"latest","rollup-plugin-typescript2":"latest","siroc":"latest","standard-version":"latest","ts-jest":"latest","typescript":"latest"},"gitHead":"e8614e4664801ca5788288c74caa0b9acd26bca6","bugs":{"url":"https://github.com/farnabaz/allowlist/issues"},"homepage":"https://github.com/farnabaz/allowlist#readme","_id":"allowlist@0.0.3","_nodeVersion":"14.3.0","_npmVersion":"6.14.5","dist":{"shasum":"964be076487109ebefa9e7b6fa702861d52a8a8d","size":2882,"noattachment":false,"key":"/allowlist/-/allowlist-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/allowlist/download/allowlist-0.0.3.tgz"},"_npmUser":{"name":"farnabaz","email":"farnabaz@gmail.com"},"directories":{},"maintainers":[{"name":"npm:farnabaz","email":""},{"name":"npm:pi0","email":""},{"name":"pi0","email":"pooya@pi0.ir"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/allowlist_0.0.3_1606725605090_0.6003392073676275"},"_hasShrinkwrap":false,"publish_time":1606725605255,"_cnpm_publish_time":1606725605255,"_cnpmcore_publish_time":"2021-12-16T23:25:15.472Z"},"0.0.2":{"name":"allowlist","version":"0.0.2","description":"Allow","repository":{"type":"git","url":"git+https://github.com/farnabaz/allowlist.git"},"license":"MIT","sideEffects":false,"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"siroc build","lint":"eslint --ext .ts .","release":"yarn test && yarn build && standard-version && git push --follow-tags && npm publish","test":"yarn lint && jest"},"dependencies":{},"devDependencies":{"@nuxtjs/eslint-config-typescript":"latest","@types/jest":"latest","eslint":"latest","jest":"latest","rollup-plugin-typescript2":"latest","siroc":"latest","standard-version":"latest","ts-jest":"latest","typescript":"latest"},"gitHead":"f76280c48484a0617f59e5c56e844ca603ad4baa","bugs":{"url":"https://github.com/farnabaz/allowlist/issues"},"homepage":"https://github.com/farnabaz/allowlist#readme","_id":"allowlist@0.0.2","_nodeVersion":"14.3.0","_npmVersion":"6.14.5","dist":{"shasum":"e9ee50e8485b800d5bc6675d68384333954b30a9","size":2873,"noattachment":false,"key":"/allowlist/-/allowlist-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/allowlist/download/allowlist-0.0.2.tgz"},"_npmUser":{"name":"farnabaz","email":"farnabaz@gmail.com"},"directories":{},"maintainers":[{"name":"npm:farnabaz","email":""},{"name":"npm:pi0","email":""},{"name":"pi0","email":"pooya@pi0.ir"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/allowlist_0.0.2_1606723598034_0.8540335095316405"},"_hasShrinkwrap":false,"publish_time":1606723598147,"_cnpm_publish_time":1606723598147,"_cnpmcore_publish_time":"2021-12-16T23:25:15.731Z"},"0.0.1":{"name":"allowlist","version":"0.0.1","description":"Allow","repository":{"type":"git","url":"git+https://github.com/farnabaz/allowlist.git"},"license":"MIT","sideEffects":false,"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"siroc build","lint":"eslint --ext .ts .","release":"yarn test && yarn build && standard-version && git push --follow-tags && npm publish","test":"yarn lint && jest"},"dependencies":{},"devDependencies":{"@nuxtjs/eslint-config-typescript":"latest","@types/jest":"latest","eslint":"latest","jest":"latest","rollup-plugin-typescript2":"latest","siroc":"latest","standard-version":"latest","ts-jest":"latest","typescript":"latest"},"gitHead":"1bc502ff6b72fedd18f3326b5b5f2f2739772b85","bugs":{"url":"https://github.com/farnabaz/allowlist/issues"},"homepage":"https://github.com/farnabaz/allowlist#readme","_id":"allowlist@0.0.1","_nodeVersion":"14.3.0","_npmVersion":"6.14.5","dist":{"shasum":"456f5959f66820007fe9f17e332a93093648e87a","size":2834,"noattachment":false,"key":"/allowlist/-/allowlist-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/allowlist/download/allowlist-0.0.1.tgz"},"_npmUser":{"name":"farnabaz","email":"farnabaz@gmail.com"},"directories":{},"maintainers":[{"name":"npm:farnabaz","email":""},{"name":"npm:pi0","email":""},{"name":"pi0","email":"pooya@pi0.ir"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/allowlist_0.0.1_1606504878656_0.5991162143049922"},"_hasShrinkwrap":false,"publish_time":1606504878795,"_cnpm_publish_time":1606504878795,"_cnpmcore_publish_time":"2021-12-16T23:25:15.938Z"}},"readme":"# Allowlist\n\n> Create allow/deny matcher with Patterns, Regex and Functions\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![Github Actions][github-actions-src]][github-actions-href]\n[![Codecov][codecov-src]][codecov-href]\n\n## Install\n\nInstall using npm or yarn:\n\n```bash\nnpm i allowlist\n# or\nyarn add allowlist\n```\n\nImport:\n\n```js\n// CommonJS\nconst { allowlist } = require('allowlist')\n\n// ESM\nimport { allowlist } from 'allowlist'\n```\n\n**Note:** You may need to transpile library!\n\n## Usage\n\n**Create a matcher:**\n\n```js\n// Allow a good string\nconst allow = allowlist('good')\n\n// Allow a good string ignore case\nconst allow = allowlist('good', true)\n\n// Allow a better regex\nconst allow = allowlist(/better/)\n\n// Allow list of good values\nconst allow = allowlist([\n    'good',\n    /better/,\n    /best/i\n])\n\n// Allow good values with your logic\nconst allow = allowlist((value) => {\n    return value.includes('good')\n})\n\n// Deny bad values\nconst allow = allowlist({\n    reject: [\n        'bad',\n        /awful/,\n        /worse/i\n    ]\n})\n\n// Allow good values and deny bads\nconst allow = allowlist({\n    accept: [\n        'good',\n        /better/,\n        /best/i\n    ],\n    reject: [\n        'bad',\n        /awful/,\n        /worse/i\n    ]\n})\n```\n\n**Use matcher:**\n\n```js\nif (allow('Sometimes good things fall apart so better things can fall together.')) {\n    // cool stuff\n}\n```\n\n\n## License\n\nMIT. Made with ????\n\n<!-- Badges -->\n[npm-version-src]: https://img.shields.io/npm/v/allowlist?style=flat-square\n[npm-version-href]: https://npmjs.com/package/allowlist\n\n[npm-downloads-src]: https://img.shields.io/npm/dm/allowlist?style=flat-square\n[npm-downloads-href]: https://npmjs.com/package/allowlist\n\n[github-actions-src]: https://img.shields.io/github/workflow/status/farnabaz/allowlist/ci/master?style=flat-square\n[github-actions-href]: https://github.com/farnabaz/allowlist/actions?query=workflow%3Aci\n\n[codecov-src]: https://img.shields.io/codecov/c/gh/farnabaz/allowlist/master?style=flat-square\n[codecov-href]: https://codecov.io/gh/farnabaz/allowlist\n","_attachments":{},"homepage":"https://github.com/nuxt-contrib/allowlist#readme","bugs":{"url":"https://github.com/nuxt-contrib/allowlist/issues"},"license":"MIT"}