MCPcopy Create free account
hub / github.com/GNOME/gjs / isRelativePath

Function isRelativePath

modules/internal/internalLoader.js:38–43  ·  view source on GitHub ↗

* Returns whether a string represents a relative path (e.g. ./, ../) * * @param {string} path a path to check if relative * @returns {boolean}

(path)

Source from the content-addressed store, hash-verified

36 * @returns {boolean}
37 */
38function isRelativePath(path) {
39 // Check if the path is relative. Note that this doesn't mean "relative
40 // path" in the GLib sense, as in "not absolute" — it means a relative path
41 // module specifier, which must start with a '.' or '..' path component.
42 return path.startsWith('./') || path.startsWith('../');
43}
44
45/**
46 * Handles resolving and loading URIs.

Callers 1

resolveSpecifierMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected