{"_id":"@dennisdigital/injection-rules-helpers","_rev":"1-cd65b791a6d33738a8a5e13b04e3c964","name":"@dennisdigital/injection-rules-helpers","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@dennisdigital/injection-rules-helpers","version":"1.0.0","main":"dist/index.js","module":"src/index.js","dependencies":{"react":"16.8.5","react-dom":"16.8.5"},"peerDependencies":{"react":"^15.0.0 || ^16.0.0","react-dom":"^15.0.0 || ^16.0.0"},"scripts":{"bootstrap":"lerna bootstrap --use-workspaces"},"publishConfig":{"access":"public"},"gitHead":"c6b6ea5d6269bf0179e86381f7770a4002d760eb","description":"These are ad rule functions that can be imported and used by the webapps. They should be generic enough to be used in different projects/ rule files.","_id":"@dennisdigital/injection-rules-helpers@1.0.0","_nodeVersion":"10.14.0","_npmVersion":"lerna/3.20.2/node@v10.14.0+x64 (darwin)","dist":{"integrity":"sha512-NmSIJY2CehEt05qeqNJwOLrSTqzjkKekEAUK/6euQbgbkGHIntvlihmu5Z4+rL7LmNf6sUl8HAwro2TRV6kCVQ==","shasum":"e168ac2018b583f94c4090723d4a4c3dc135729d","tarball":"https://registry.npmjs.org/@dennisdigital/injection-rules-helpers/-/injection-rules-helpers-1.0.0.tgz","fileCount":7,"unpackedSize":39903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeT6nUCRA9TVsSAnZWagAA45kP/RC/cEXfrdJ2cSGCJqi0\nTXCv+/NpVMAhZP/g0hkUV2aYpXXj8kniLwnc2uLYqyy5xeYfDQJTi7KqU+nI\n7hXemVMmlyYFZn27aUWWF3vrhC7KKQSfb9RUIy0FiDLygLqRS24j9Nj9Ooa5\nXdaTxPQM54RMl+H8yeNxJTfUi/6mBSvu9uf80Nv28ViFWEslHFxJS1ManXAj\nh5TFyzkSnY9kWQCrWyvKC9gLeBQAuydf2joUxOssYuFxsCzcp2za0hVkKyNn\n3ckna6+F8REEFYOxd77T+rZAcVHOQXxT4VziUI9LrItOTVnWf3w8oNUbm8KX\nOy3EzKq3yMRjxZfexmncEQdgrni+mfHzw+LrqVwrBD8ix5haRL/3xC5Ifkcw\nMYpu/5XFM4dfNwW6Wx6aFgi2y2kKGxhwTC7tYWYNAS0K//EsYI54tCvjsHqk\ndf+KCER3KxEJRNVCTif2/LSotkB7/5VRT82U97nhSA2pnvFt6cs3LOfQ2Mcw\nAeHA3rce/Ww9yr7RkP7KuwDF3vkwtjeQiqF4JoEwv1Bugeb3CwJqOcd4ssaB\nUpBJdQwRQNSiMF7UhL0y9HiEBGhYXJRkYWHrC9R6qGH3BY73NovNx14zxISs\nHSUXXlYYPXIT23/ikrNos/OhevSFDqAsGiR2tAVA177gKYQUk1tCw4ox+9W4\n9e4T\r\n=0V9C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFk2CjQLcu09CEuAzkLwVh1Pldwz8oPcT5AlYzTuPwdlAiEAq/MDPrrLcH4taCo7qLQeJ6Hrq+Lgk8ECmQtyGvZAX2c="}]},"maintainers":[{"name":"iliasp","email":"ilias.pittas1@gmail.com"},{"name":"majdanas","email":"majjda@hotmail.com"},{"name":"chriskinch","email":"kinchie@gmail.com"},{"name":"willhowlett","email":"bigwillchnpm@gmail.com"},{"name":"asvin","email":"asvin.balloo@gmail.com"}],"_npmUser":{"name":"iliasp","email":"ilias.pittas1@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/injection-rules-helpers_1.0.0_1582279124318_0.7814068024355658"},"_hasShrinkwrap":false}},"time":{"created":"2020-02-21T09:58:44.081Z","1.0.0":"2020-02-21T09:58:44.441Z","modified":"2022-04-05T03:45:19.180Z"},"maintainers":[{"name":"iliasp","email":"ilias.pittas1@gmail.com"},{"name":"majdanas","email":"majjda@hotmail.com"},{"name":"chriskinch","email":"kinchie@gmail.com"},{"name":"willhowlett","email":"bigwillchnpm@gmail.com"},{"name":"asvin","email":"asvin.balloo@gmail.com"}],"description":"These are ad rule functions that can be imported and used by the webapps. They should be generic enough to be used in different projects/ rule files.","readme":"# `adRules`\n\nThese are ad rule functions that can be imported and used by the webapps. They should be generic enough to be used in different projects/ rule files. \n\nThey take configurations coming from graphQL (usually controlled by the portal) and use that configuration along with variables provided by the rules using those functions (these variables are coming options exposed by the inject function) to return either a value.\n\nThe current adRules used are:\n\n```js\n{\n  isBetweenTwoTextBlocks,\n  isLastIndexOfArray,\n  shouldInjectFirstSideAd\n  isRightNumberOfWordsForTeads\n  getWordCountFromLastIndexOfTypeToEndOfArray\n  getWordCountFromCurrentIdxToEnd\n  shouldInjectLastAd\n}\n```\nThese functions are exported as an object by @dennisdigital/injection-rules-helpers and can by used in the webapps like this:\n\n```js\nimport { injectionRules } from '@dennisdigital/injection-rules-helpers';\n\nconst wordCountFromCurrIdxToEnd = getWordCountFromCurrentIdxToEnd({ ...options });\n```\n\nAll rules accept objects and de-constructing that object to get the values they need.\n\nPlease look at the inline docs for what each function does.\n```","readmeFilename":"README.md"}