MCPcopy
hub / github.com/patriksimek/vm2 / pathIsRelative

Method pathIsRelative

lib/resolver.js:45–51  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

43 }
44
45 pathIsRelative(path) {
46 if (path === '' || path[0] !== '.') return false;
47 if (path.length === 1) return true;
48 const idx = path[1] === '.' ? 2 : 1;
49 if (path.length <= idx) return false;
50 return this.fs.isSeparator(path[idx]);
51 }
52
53 pathIsAbsolute(path) {
54 return path !== '' && (this.fs.isSeparator(path[0]) || this.fs.isAbsolute(path));

Callers 3

lookupPathsMethod · 0.95
resolveFullMethod · 0.80
customResolveMethod · 0.80

Calls 1

isSeparatorMethod · 0.65

Tested by

no test coverage detected