{"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":{"integrity":"sha512-cLtXHQugtU6XxNz+UwrywVJi+dI0UbrP7X46wlY3iis5Edmj33ru2sgWtm0jK5r+5QWEK7wFnKUmB3jQruxa5A==","shasum":"964be076487109ebefa9e7b6fa702861d52a8a8d","tarball":"http://registry-npm.ywwl.com/allowlist/download/allowlist-0.0.3.tgz","fileCount":6,"unpackedSize":6569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxK/lCRA9TVsSAnZWagAAYEYP/RyX8him/nrzxhcQ32k1\nn0UeP7KRhwCiMXD8RtJK+6sk5oVl3es2vYaNrmVLBeKIWnWRaP++dBuOm1ke\nHC6LH6jRRDonkYM+xhuCDzb0Am3h03BSUrCyEVa94uwZmql4zDUPWIRjoQJQ\n3KyxFhujN4cnlnngHbNdi3pOdCqWEl0pG0T66xS1vrgJCSzUwc3Dkljciv3w\nz4uw9cCXATtlIchcSKz5uZ4Mm5cKezE6uj4LpTrIlv3/Dl0udXRVXZwZUVNa\n6Ddl7Q5lIO4ivTULDDWB/wpLhpYl2xogVGYJTia9C4ZHBhJ1ASyoWFEQfHDx\nxb7kXX4isSeEg6TBP5cAmS8/b/8eQdTp6uROjroGfAdifWbmyHa3h3JdwHRo\n3fiGXdSyXr2AOL4v4ejAhIEYHPUlb77FLxIQb/CZVdTJwEGnOKvbXX8wdnG5\nrbmjEcSybIRS7Lu7ZUPKbuKmA2oWRnvLFlDzPsdaB67/YWQmG4phVXSO0IFc\nZPUDe4v9RIfhqZKZ7D/ANbTN4rr/T3Cpv5lZIgjZqPYDIX+OUEJ/belPzCki\nyC8c0OAIr83tN9uMI/sWOYVOPCm/N0O+CCSvrYPkV5ftLI7MoClaZyvB4RD3\nUmndsTzha5o3/rOz4Ozn65bLUzkMPFXfspqMKycZP4Bxp4ZmgE2ZV2uROCtr\n5TQx\r\n=oIY8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBBY23AFAW+lRzXnmAANHcSM7U2wQaJIGA/d7O5cjBw4AiA0C7XRIuK5ld6b1GyzCBew+XDeJ7pP+q8ew+FEODNrcw=="}],"size":2882,"noattachment":false,"key":"/allowlist/-/allowlist-0.0.3.tgz"},"_npmUser":{"name":"farnabaz","email":"farnabaz@gmail.com"},"directories":{},"maintainers":[{"name":"farnabaz","email":"farnabaz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/allowlist_0.0.3_1606725605090_0.6003392073676275"},"_hasShrinkwrap":false,"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","publish_time":1606725605255,"_cnpm_publish_time":1606725605255,"dist-tags":{"latest":"0.1.1"}}