UNPKG

@conarti/eslint-plugin-feature-sliced

Version:
20 lines (19 loc) 718 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizePath = void 0; const path_1 = __importDefault(require("path")); const config_1 = require("../../config"); function normalizePath(targetPath) { const winSepRegExp = /\\/g; const withNormalizedSeparators = path_1.default .normalize(targetPath) .replace(winSepRegExp, config_1.pathSeparator); if (targetPath.startsWith('./')) { return `./${withNormalizedSeparators}`; } return withNormalizedSeparators; } exports.normalizePath = normalizePath;