New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dennisdigital/injection-rules-helpers

Package Overview
Dependencies
Maintainers
5
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dennisdigital/injection-rules-helpers

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.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-87.5%
Maintainers
5
Weekly downloads
 
Created
Source

adRules

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.

They 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.

The current adRules used are:

{
  isBetweenTwoTextBlocks,
  isLastIndexOfArray,
  shouldInjectFirstSideAd
  isRightNumberOfWordsForTeads
  getWordCountFromLastIndexOfTypeToEndOfArray
  getWordCountFromCurrentIdxToEnd
  shouldInjectLastAd
}

These functions are exported as an object by @dennisdigital/injection-rules-helpers and can by used in the webapps like this:

import { injectionRules } from '@dennisdigital/injection-rules-helpers';

const wordCountFromCurrIdxToEnd = getWordCountFromCurrentIdxToEnd({ ...options });

All rules accept objects and de-constructing that object to get the values they need.

Please look at the inline docs for what each function does.

FAQs

Package last updated on 21 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc