How to use the espurify.cloneWithWhitelist function in espurify

To help you get started, we’ve selected a few espurify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github power-assert-js / babel-plugin-espower / lib / babel-assertion-visitor.js View on Github external
function BabelAssertionVisitor (babel, matcher, options) {
    this.babel = babel;
    this.matcher = matcher;
    this.options = options;
    this.currentArgumentNodePath = null;
    this.argumentModified = false;
    this.valueRecorder = null;
    this.locationDetector = new EspowerLocationDetector(this.options);
    var babelTemplate = babel.template;
    this.helperTemplate = babelTemplate(helperCode);
    var whiteListWithRange = Object.keys(options.astWhiteList).reduce(function (acc, key) {
        acc[key] = options.astWhiteList[key].concat(['range']);
        return acc;
    }, {});
    this.purifyAst = cloneWithWhitelist(whiteListWithRange);
}

espurify

Clone AST without extra properties

MIT
Latest version published 5 months ago

Package Health Score

64 / 100
Full package analysis