UNPKG

@lifaon/path

Version:

Useful tool to manage paths like the URL object

9 lines 413 B
// TODO improve later // https://stackoverflow.com/questions/4814040/allowed-characters-in-filename /** * Returns true if segment is valid (must not be empty nor contain some reserved characters) */ export function isValidPathSegment(segment, invalidPathSegmentRegExp = /[<>:"\/\\|?*]/) { return segment !== '' && !invalidPathSegmentRegExp.test(segment); } //# sourceMappingURL=is-valid-path-segement.js.map