Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
isPolyfill: polyfill || false,
sourceCode,
});
}
let hasteID = null;
if (filename.indexOf(NODE_MODULES) === -1 && !polyfill) {
if (options.hasteImplModulePath != null) {
// eslint-disable-next-line no-useless-call
const HasteImpl = (require.call(
null,
options.hasteImplModulePath,
): HasteImpl);
hasteID = HasteImpl.getHasteName(filename);
} else {
hasteID = docblock.parse(docblock.extract(sourceCode)).providesModule;
}
}
return {
details: {
file: filename,
hasteID: hasteID || null,
transformed,
type: options.polyfill ? 'script' : 'module',
},
type: 'code',
};
}
function hasPragma(text) {
const pragmas = Object.keys(docblock.parse(docblock.extract(text)));
return pragmas.indexOf("prettier") !== -1 || pragmas.indexOf("format") !== -1;
}
function hasPragma(text) {
const pragmas = Object.keys(docblock.parse(docblock.extract(text)));
return pragmas.indexOf("prettier") !== -1 || pragmas.indexOf("format") !== -1;
}