123456789101112131415161718192021222324252627282930313233 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0;
- const path = require("path");
- const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
- const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
-
- function unixify(filepath) {
- return filepath.replace(/\\/g, '/');
- }
- exports.unixify = unixify;
- function makeAbsolute(cwd, filepath) {
- return path.resolve(cwd, filepath);
- }
- exports.makeAbsolute = makeAbsolute;
- function escape(pattern) {
- return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
- }
- exports.escape = escape;
- function removeLeadingDotSegment(entry) {
-
-
- if (entry.charAt(0) === '.') {
- const secondCharactery = entry.charAt(1);
- if (secondCharactery === '/' || secondCharactery === '\\') {
- return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
- }
- }
- return entry;
- }
- exports.removeLeadingDotSegment = removeLeadingDotSegment;
|