eslint-plugin-ferramentas
Version:
A bundle of useful ESLint rules
20 lines (19 loc) • 672 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.createDebugger = exports.extractImportPath = exports.RELATIVE_IMPORT_PATTERN = void 0;
exports.RELATIVE_IMPORT_PATTERN = '^\\..*';
const extractImportPath = ({ source: { value } }) => {
if (typeof value !== 'string') {
throw new Error('Import path has unexpected value');
}
return value;
};
exports.extractImportPath = extractImportPath;
const createDebugger = (debugging) => {
if (!debugging) {
return () => { };
}
// eslint-disable-next-line no-console
return (...args) => console.debug(...args);
};
exports.createDebugger = createDebugger;
;