Socket
Socket
Sign inDemoInstall

@wmfs/cardscript-cleaner

Package Overview
Dependencies
13
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @wmfs/cardscript-cleaner

Cleans Cardscript form data to ensure we only submit the data that we should.


Version published
Weekly downloads
5
Maintainers
1
Created
Weekly downloads
 

Readme

Source

cardscript-expressions

Tymly Cardscript CircleCI npm (scoped) codecov CodeFactor Dependabot badge Commitizen friendly JavaScript Style Guide license

cardscript-expressions provides a number of utilities to generate expressions, generate AST's, and clean cardscript data for submissions

Install

$ npm install cardscript-expressions --save

Usage

const expressions = new CardscriptExpressionsxpressions()
Method summary
UsageDescription
const expressionList = getExpressionsFromCardscript(cardscript)Takes a cardscript schema and extracts a list of expressions.
convertExpressionsToAst(expressions)Takes a list of expressions generated by getExpressionsFromCardscript() and amends the generated AST's to an object asts available from expressions.asts
addCardscript(cardscript)A combination of getExpressionsFromCardscript(cardscript) and convertExpressionsToAst(expressions), used to generate AST's from cardscript in one function call
const visibilityList = calculateWidgetVisibility(cardscript, data, asts)Takes a cardscript schema, submission data, and a list of AST's to generate an object of {key: boolean} values representing whether a widget should be visible or not
const clean = cleanData(data, visibilityList)Takes submission data and a visibility list generated by calculateWidgetVisibility and returns a cleaned data object with values of hidden fields removed

License

MIT

Keywords

FAQs

Last updated on 16 Jul 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc