MCPcopy Index your code
hub / github.com/Effect-TS/effect / encodePathChars

Function encodePathChars

packages/platform/src/internal/path.ts:215–232  ·  view source on GitHub ↗
(filepath: string)

Source from the content-addressed store, hash-verified

213const tabRegEx = /\t/g
214
215function encodePathChars(filepath: string) {
216 if (filepath.includes("%")) {
217 filepath = filepath.replace(percentRegEx, "%25")
218 }
219 if (filepath.includes("\\")) {
220 filepath = filepath.replace(backslashRegEx, "%5C")
221 }
222 if (filepath.includes("\n")) {
223 filepath = filepath.replace(newlineRegEx, "%0A")
224 }
225 if (filepath.includes("\r")) {
226 filepath = filepath.replace(carriageReturnRegEx, "%0D")
227 }
228 if (filepath.includes("\t")) {
229 filepath = filepath.replace(tabRegEx, "%09")
230 }
231 return filepath
232}
233
234const posixImpl = Path.of({
235 [TypeId]: TypeId,

Callers 1

toFileUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…