Buckets:
ktongue/docker_container / .vscode-server /extensions /formulahendry.code-runner-0.12.2 /node_modules /picomatch /lib /utils.js
| ; | |
| const path = require('path'); | |
| const win32 = process.platform === 'win32'; | |
| const { | |
| REGEX_SPECIAL_CHARS, | |
| REGEX_SPECIAL_CHARS_GLOBAL, | |
| REGEX_REMOVE_BACKSLASH | |
| } = require('./constants'); | |
| exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); | |
| exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); | |
| exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); | |
| exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); | |
| exports.toPosixSlashes = str => str.replace(/\\/g, '/'); | |
| exports.removeBackslashes = str => { | |
| return str.replace(REGEX_REMOVE_BACKSLASH, match => { | |
| return match === '\\' ? '' : match; | |
| }); | |
| } | |
| exports.supportsLookbehinds = () => { | |
| let segs = process.version.slice(1).split('.'); | |
| if (segs.length === 3 && +segs[0] >= 9 || (+segs[0] === 8 && +segs[1] >= 10)) { | |
| return true; | |
| } | |
| return false; | |
| }; | |
| exports.isWindows = options => { | |
| if (options && typeof options.windows === 'boolean') { | |
| return options.windows; | |
| } | |
| return win32 === true || path.sep === '\\'; | |
| }; | |
| exports.escapeLast = (input, char, lastIdx) => { | |
| let idx = input.lastIndexOf(char, lastIdx); | |
| if (idx === -1) return input; | |
| if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); | |
| return input.slice(0, idx) + '\\' + input.slice(idx); | |
| }; | |
Xet Storage Details
- Size:
- 1.36 kB
- Xet hash:
- c794479b67db496c87b4b5b722b6e2ce81677c70419108ecb8e7b955e6176a12
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.