MCPcopy Create free account
hub / github.com/decaporg/decap-cms / normalizePath

Function normalizePath

packages/decap-cms-lib-util/src/path.ts:3–5  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

1const absolutePath = new RegExp('^(?:[a-z]+:)?//|^/', 'i');
2
3function normalizePath(path: string) {
4 return path.replace(/[\\/]+/g, '/');
5}
6
7export function isAbsolutePath(path: string) {
8 const result = absolutePath.test(path);

Callers 2

basenameFunction · 0.70

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected