How to use the @istanbuljs/schema.defaults.instrumentVisitor function in @istanbuljs/schema

To help you get started, we’ve selected a few @istanbuljs/schema 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 istanbuljs / istanbuljs / packages / istanbul-lib-instrument / src / visitor.js View on Github external
function programVisitor(types, sourceFilePath = 'unknown.js', opts = {}) {
    const T = types;
    opts = {
        ...defaults.instrumentVisitor,
        ...opts
    };
    const visitState = new VisitState(
        types,
        sourceFilePath,
        opts.inputSourceMap,
        opts.ignoreClassMethods
    );
    return {
        enter(path) {
            if (shouldIgnoreFile(path.find(p => p.isProgram()))) {
                return;
            }
            if (alreadyInstrumented(path, visitState)) {
                return;
            }

@istanbuljs/schema

Schemas describing various structures used by nyc and istanbuljs

MIT
Latest version published 4 years ago

Package Health Score

68 / 100
Full package analysis

Similar packages