MCPcopy Create free account
hub / github.com/SoCreate/angular-playground / slash

Function slash

projects/cli/src/build-sandboxes.ts:170–179  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

168// Turns windows URL string ('c:\\etc\\') into URL node expects ('c:/etc/')
169// https://github.com/sindresorhus/slash
170export function slash(input: string) {
171 const isExtendedLengthPath = /^\\\\\?\\/.test(input);
172 const hasNonAscii = /[^\u0000-\u0080]+/.test(input);
173
174 if (isExtendedLengthPath || hasNonAscii) {
175 return input;
176 }
177
178 return input.replace(/\\/g, '/');
179}

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected