UNPKG

@stryke/path

Version:

A package containing various utilities that expand the functionality of NodeJs's built-in `path` module

23 lines (21 loc) 1.03 kB
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); //#region src/regex.ts const DRIVE_LETTER_START_REGEX = /^[A-Z]:\//i; const DRIVE_LETTER_REGEX = /^[A-Z]:$/i; const UNC_REGEX = /^[/\\]{2}/; const ABSOLUTE_PATH_REGEX = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^~[/\\]|^[A-Z]:[/\\]/i; const ROOT_FOLDER_REGEX = /^\/([A-Z]:)?$/i; const FILE_EXTENSION_REGEX = /\.[0-9a-z]+$/i; const FULL_FILE_EXTENSION_REGEX = /(\.d)?\.[0-9a-z]+(\.map)?$/i; const PACKAGE_PATH_REGEX = /^@\w+\/.*$/; const NPM_SCOPED_PACKAGE_REGEX = /^(?:@[\w-]+\/)?[\w-]+$/; //#endregion exports.ABSOLUTE_PATH_REGEX = ABSOLUTE_PATH_REGEX; exports.DRIVE_LETTER_REGEX = DRIVE_LETTER_REGEX; exports.DRIVE_LETTER_START_REGEX = DRIVE_LETTER_START_REGEX; exports.FILE_EXTENSION_REGEX = FILE_EXTENSION_REGEX; exports.FULL_FILE_EXTENSION_REGEX = FULL_FILE_EXTENSION_REGEX; exports.NPM_SCOPED_PACKAGE_REGEX = NPM_SCOPED_PACKAGE_REGEX; exports.PACKAGE_PATH_REGEX = PACKAGE_PATH_REGEX; exports.ROOT_FOLDER_REGEX = ROOT_FOLDER_REGEX; exports.UNC_REGEX = UNC_REGEX;