How to use the @istanbuljs/schema.defaults.instrumenter 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 / read-coverage.js View on Github external
if (typeof code === 'object' && typeof code.type === 'string') {
        // Assume code is already a babel ast.
        return code;
    }

    if (typeof code !== 'string') {
        throw new Error('Code must be a string');
    }

    // Parse as leniently as possible
    return parse(code, {
        allowImportExportEverywhere: true,
        allowReturnOutsideFunction: true,
        allowSuperOutsideMethod: true,
        sourceType: 'script',
        plugins: defaults.instrumenter.parserPlugins
    });
}
github istanbuljs / istanbuljs / packages / istanbul-lib-instrument / src / instrumenter.js View on Github external
constructor(opts = {}) {
        this.opts = {
            ...defaults.instrumenter,
            ...opts
        };
        this.fileCoverage = null;
        this.sourceMap = null;
    }
    /**
github istanbuljs / istanbuljs / packages / istanbul-lib-instrument / src / index.js View on Github external
/**
 * createInstrumenter creates a new instrumenter with the
 * supplied options.
 * @param {Object} opts - instrumenter options. See the documentation
 * for the Instrumenter class.
 */
function createInstrumenter(opts) {
    return new Instrumenter(opts);
}

export { createInstrumenter };
export { programVisitor };
export { readInitialCoverage };

export const defaultOpts = defaults.instrumenter;

@istanbuljs/schema

Schemas describing various structures used by nyc and istanbuljs

MIT
Latest version published 3 years ago

Package Health Score

68 / 100
Full package analysis

Similar packages