UNPKG

@o3r/schematics

Version:

Schematics module of the Otter framework

37 lines 1.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.editorConfigResolve = exports.editorConfigParse = void 0; /** * Wrapper to tiny-editorconfig {@link Parse} function to allow jest mocking * @see parse * @param input configuration file content */ // istanbul ignore next -- tiny-editorconfig wrapper function to handle Jest testing CJS requirement issue const editorConfigParse = async (input) => { try { const { parse } = await Promise.resolve().then(() => require('tiny-editorconfig')); return parse(input); } catch { return undefined; } }; exports.editorConfigParse = editorConfigParse; /** * Wrapper to tiny-editorconfig {@link resolve} function to allow jest mocking * @see resolve * @param configs EditorConfig configurations * @param filePath Path to the file to lint */ // istanbul ignore next -- tiny-editorconfig wrapper function to handle Jest testing CJS requirement issue const editorConfigResolve = async (configs, filePath) => { try { const { resolve } = await Promise.resolve().then(() => require('tiny-editorconfig')); return resolve(configs, filePath); } catch { return undefined; } }; exports.editorConfigResolve = editorConfigResolve; //# sourceMappingURL=editor-config.helpers.js.map