{"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":{"integrity":"sha512-YeTju3HzqJvbfqkSlxfCV65+SfO/o8H1u7b/Max9GN3Funq2ZGDnR1r+xOYTo/8NMIAbEC4z2N5zy+MEXe/rOg==","shasum":"456f5959f66820007fe9f17e332a93093648e87a","tarball":"http://registry-npm.ywwl.com/allowlist/download/allowlist-0.0.1.tgz","fileCount":6,"unpackedSize":6393,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfwVGvCRA9TVsSAnZWagAApyEP/joTeND3y0paPbzmukPj\n09ikOIIqkbNWY8brUGhVbq/XduVKfcapWUmtNzYy8rh5HCITV/7/v4sV+mFL\niFp0aU39FHz7pKW+hmtCtiMiNv4nWoBU9296JQO/3Ia84mUrgSpcY+BXlblz\na0WfpiK6AfF8WpoJmBRjkLOh23pRBSMOMSYrXT7nLcxfn4SGLuBWHjcI/Sle\nEFpLAdNzXr6EfOcg7Of0BR49ot7fGnJ+LByYJn9y3oUtR6sDAd0h3oLA59tG\ngGXWdSJ02MSNwrWfaIggiqiPyGE3Se11MPQV3NlSNixrCCN+FHwRT0EnFQHl\nBaZ2wpGF9PgKjLtNtp+xsRvlk9BI9M3L6s+3xfFLmJ+rW+nePkr9bBmc6RlI\n6SnX/aIrQwsQrTaEdea1yHy1KfWfV+kOm8HEKqjYfT7juDCMJOjr0uYSw2Vo\nUG7vkU5wOx3l/++87OcdInRhQuuxLCTnaMPWbcG+4YLhg7E3Tlm3bgtPMb4O\nDyoRhnHKOcisfXE5Rum/GiLb3ZgR5TMBbIcDwpc2LKcWciByfJZIP4pJABqU\nR7arIWO/DjwAWafG1xOn0bEtrK/IiM5U/m62BvfTc9AenoxjbLgk5bSfWYRs\nNNKoNu9Sueua9WCBf4olD1f+oQtL8MVOMCZNgGoWQVKAx4ooXnaKy0xzrZDo\nk6R8\r\n=GqiY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF0x1aVaTB+DkfVsLT89G4JT1YWmBNo5tgmo8i/LusKtAiAhx/3JoDW9kjMCQsuc8etCYp6p0Og21PXRo64Qu8c4ew=="}],"size":2834,"noattachment":false,"key":"/allowlist/-/allowlist-0.0.1.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.1_1606504878656_0.5991162143049922"},"_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":1606504878795,"_cnpm_publish_time":1606504878795,"dist-tags":{"latest":"0.1.1"}}