{"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":{"integrity":"sha512-l298+rQLx33JiaFBJ/4GJoSc1bou+COScif8asoAZqkX0Wz25jmJc4vqJV7NqCsj3ZuGkeODkNFJg/I4/vo4xg==","shasum":"7f337b1e9a292e5aaf59c879933be1172915eaeb","tarball":"http://registry-npm.ywwl.com/allowlist/download/allowlist-0.1.1.tgz","fileCount":8,"unpackedSize":11020,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzUVFCRA9TVsSAnZWagAAHZwQAIwdpHW6/z4C63tGQxZ7\nlcG1YFZczEBsutyb1EY8hiRFkfvIEqukbEJUAz3b94MB/e00Trwapoxsu0E5\nGm5T7XaNXQsoZhAU2GJjY5lnV9kTLrEk7boGRm5Q5RV8mAQhZ+Y+L/J4rPR+\nfGP/xWLqUJFR848xCx1NMzKCa6E+3ExQjIFw29r8WQXqeIFOeC7uBBgxgI/E\nh1NYWIBAUlKedFXqIGvXpItoikICh4CEcj/tOvYQAY5lgLC3jb3u3sRQYqbp\nE98sOl6hMkpMhnr2h5Q9KWvZv+pqSQ/axh/I6/BOb8zUfxQ0CdJA3Z8FEoEL\naATnom7wsZ2lLM1MJsgEmzunirkbDMFbQBsP/a9L1k+1xfQJ2IbqDOK9CrE2\n1cURB6UEFN7N1WxGJaewvRsS/Z2Ahsy//xS9c6YtC/B0ax8iBOuIX5gUYyES\nebd01VgtW5aVOyOPOTArHgd7PBXsmxrskof+qJomL5Jwh7Y5LYmP09nLgNtU\nvQfcq8uJD5DjDKcvIFJJtB1Dv5VEnonGpxi0JzKjTEsfvLiIk5S77nj8/Dax\nMEQdyI7tWH/Log3/tlWJHAqVbDn6olCYODNf0WvA8lYExgJYg++TSEjRG6Gv\nfD1xWU3cM4XcbSyL4IwXVoVa/fC49Y5AlfGN8cUB9GHtJM+fGsQRzFMB94Ah\n/eZX\r\n=vJx4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxdRB3YlZp31eFrmY5HBMtSzZpWLet6QKH8K6dPbH5qQIgIIW8BLuhcwE3EqFrDUXssivNc3baWK/PE1k5giVFXpA="}],"size":3530,"noattachment":false,"key":"/allowlist/-/allowlist-0.1.1.tgz"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"directories":{},"maintainers":[{"name":"farnabaz","email":"farnabaz@gmail.com"},{"name":"pi0","email":"pyapar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/allowlist_0.1.1_1607288133030_0.8521554884722449"},"_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":1607288133147,"_cnpm_publish_time":1607288133147,"dist-tags":{"latest":"0.1.1"}}