Sha256: 077b1316c899cdca7036fc171a3ffba4f394c39f6d81e5f98c8a4750a893ca0a

Contents?: true

Size: 1.19 KB

Versions: 23

Compression:

Stored size: 1.19 KB

Contents

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
/**
 * Designed to work only with simple paths: `dir\\file`.
 */
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) {
    // We do not use `startsWith` because this is 10x slower than current implementation for some cases.
    // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
    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;

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
trusty-cms-5.0.7 node_modules/fast-glob/out/utils/path.js
trusty-cms-5.0.6 node_modules/fast-glob/out/utils/path.js
trusty-cms-5.0.5 node_modules/fast-glob/out/utils/path.js
trusty-cms-5.0.4 node_modules/fast-glob/out/utils/path.js
trusty-cms-5.0.3 node_modules/fast-glob/out/utils/path.js
trusty-cms-5.0.2 node_modules/fast-glob/out/utils/path.js
trusty-cms-5.0.1 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.3.5 node_modules/fast-glob/out/utils/path.js
trusty-cms-5.0.0 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.3.4 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.3.3 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.3.2 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.3.1 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.3 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.2.3 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.2.2 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.2.1 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.2 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.1.9 node_modules/fast-glob/out/utils/path.js
trusty-cms-4.1.8 node_modules/fast-glob/out/utils/path.js