{"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":{"integrity":"sha512-GMqrqkf8BP2p6nizhtTTdlPuoePBXaxJ2FOv5OxL2okgTWC+02XmbWNBWOQChZUTnSKbIjMFkyT8WdiGyPhBug==","shasum":"9e7f4aed3bc56348d4a25e1da9c835b30f38aaa7","tarball":"http://registry-npm.ywwl.com/allowlist/download/allowlist-0.0.4.tgz","fileCount":6,"unpackedSize":6693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxs8wCRA9TVsSAnZWagAA87oP/2uRCi7t++Z9Vto+Ln+J\nA49OicGYpoM/kKh3zMDVB/gYJ46IVEti9+RWgwOsaDIYZ/IlJ1wHxoVbNiD0\nwQJYDOj0fKT6j2obspeMID428rhQ5ROm7Vx4OPq4WimBwx2JdiYqUbQ6YD/F\n4oBkZ+sOAGids2n4dOV2TULI+gkqtoTiWhCpPinPjetY4S3F4UWweRmZis/R\nA3GXRuXC7r8IwhWrW6oHD6CfKg21+Ee7bNFXketaabIOfAYnHCwZUstN8g18\nYwPc4XegNLA3V2HPKbDp7DeRAuT1vv12ig5RbM4Z8ZwhPT+VIfGKEUta1Y/W\nDaNSeRmh4+zQRb29xlo89uNuDyP2/D3cmDTZOiDc4zfcCc74K92u2/aylAlx\nHT8kdq5c63aJQtCIFAanGU9JUcB7zY5l+BPHmEi5X0LXlEQj8xCgq+BV8S4x\nqxruLk8aJP1Hg3JbUEY/ylRJYkNSBuO4WCz+nUkV4kMD++ENf0Jy0YymkzwJ\njyMDFhZjf0oZ0pQubLC+t2gz2FwVPggHfWTt3xADUllBNDDY9o1ZU5PWTJ0U\nU7F1Hstu3Zv/f2a6v8Qwx91Q+dz+N+jpHS7DU0ABpTcAzLV4OkxkGbuli0Uf\nRpshoDXWOeABtsjNYYVrSDvMhuNPZCxTtoFUXpflIKWqeCA+Oe/zryb82F6C\n6e2j\r\n=V+LR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzrnM8VDoNuS7mR5JTRH2WqYJEti/WjsInOyb10r+j3wIhAP6PHN/tZvqvWq5oalS9Gh23MYwnBqtauev8Vw7JT9JV"}],"size":2941,"noattachment":false,"key":"/allowlist/-/allowlist-0.0.4.tgz"},"_npmUser":{"name":"farnabaz","email":"farnabaz@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.0.4_1606864687724_0.3244958955811419"},"_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":1606864687900,"_cnpm_publish_time":1606864687900,"dist-tags":{"latest":"0.1.1"}}