UNPKG

tslint-folders

Version:

Custom TSLint rules for checking imports between packages and their folders, and generating relevant diagrams.

28 lines (27 loc) 944 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DirUtils = void 0; var DirUtils; (function (DirUtils) { function splitPath(filePath) { return cleanPath(filePath).split("/"); } DirUtils.splitPath = splitPath; function removeQuotesAndTicksFrom(filePath) { return filePath.replace(/['"]+/g, ""); } function replaceRepeatedBackslashesIn(filePath) { return filePath.replace(/[\\]+/g, "\\"); } function cleanPath(filePath) { var cleaned = filePath.trim(); cleaned = removeQuotesAndTicksFrom(cleaned); cleaned = replaceRepeatedBackslashesIn(cleaned); return cleaned; } DirUtils.cleanPath = cleanPath; function convertWindowsToUnix(filePath) { return filePath.split("\\").join("/"); } DirUtils.convertWindowsToUnix = convertWindowsToUnix; })(DirUtils = exports.DirUtils || (exports.DirUtils = {}));