{"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":{"integrity":"sha512-ecjG3lQzo/H91PWyRdwhrFRcu5jsZENpa6eY0j6/zqJk02+fQpRoXT/o3hOtlebQsoDdKK0PoxNtj7pcXz/s/g==","shasum":"e9ee50e8485b800d5bc6675d68384333954b30a9","tarball":"http://registry-npm.ywwl.com/allowlist/download/allowlist-0.0.2.tgz","fileCount":6,"unpackedSize":6487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxKgOCRA9TVsSAnZWagAAV9cP/0VspfZKPsDYp+6mgsF5\nIAoB6ss4go18IuA92WxJVTXI/4Kh4qZwEw2ueF62dWKJor2q8DnlIWBY/EhC\neaL3AYAyg1nEwQ1DAxtV8jNMkxiXimEJPaDnPintujonIEz5kDNZIgL6cLhF\nH8kbF1bhp7DAqr9Bb1FQlSWNAee7b60jzUZwuI95ZrqtKcxwZ+9FCq2tCvWj\nRRMLEkVbqY8otyqcp94uG+lif5GKak1xLE6b+BoX0GxcdUWRmQTebuhVqt5y\n7X2It87+1PHtH7hnlDGkdnufg2hOblZLMJvUdY/O4T1osAINrIWli9snUFrZ\nyvIph3/G60korbj3vpOSMIrkrZnFJEb8aMxJsjUvSa9CEW97v1S26FGTVwnN\nVpL5itghsJAyw1EKNu3yvlYIR/rBIiC782rZQRU+rv1zN2Hi12cxC5nAwNRh\nhaXC4RrpEmtbM58iBXVKdHCh4jWK2upx6ldIzI+U2d5Nko/hEqti3vf7kvan\nTFRZpH7atsYmgN/QyWMvhr2oEpWNKK3NM2Oc8yziTHFEwY//yyFvzsD4j8I0\n3+zdWUWJirXdyfp1jCrAPN0Nmj54+HLYHhiH8vgXvzDw9JbPi1O3L1L/RSxi\nQSdyJWVOrlsVUt5jIXfxLBDqc7o4qD31ji3Ol/XGTPIc+EvBUaLKtT3U7x+Z\n4LDg\r\n=SmQ7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE6pT30Ap2UVMRZUwIJR+DrtvNJuetNwF5aEUKY0/9HXAiEAyG00uP6H9sGSsEGQJXaVX8/tnXfJkgyZORGy0ccYi24="}],"size":2873,"noattachment":false,"key":"/allowlist/-/allowlist-0.0.2.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.2_1606723598034_0.8540335095316405"},"_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":1606723598147,"_cnpm_publish_time":1606723598147,"dist-tags":{"latest":"0.1.1"}}