File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ deprecated private class ConsPath extends Path, TConsPath {
9696private string pathRegex ( ) { result = "(.*)(?:/|^)(([^/]*?)(\\.([^.]*))?)" }
9797
9898/**
99- * A `string` with some additional member predicates for extracting parts of a path string .
99+ * A `string` with some additional member predicates for extracting parts of the file path .
100100 */
101101class FilePath extends string {
102102 bindingset [ this ]
@@ -147,8 +147,14 @@ class FilePath extends string {
147147 predicate isDotRelativePath ( ) { this .regexpMatch ( "\\.\\.?(?:[/\\\\].*)?" ) }
148148
149149 /**
150- * Gets the NPM package name from the beginning of the given import path, e.g.
151- * gets `foo` from `foo/bar`, and `@example/foo` from `@example/foo/bar`.
150+ * Gets the NPM package name from the beginning of the given import path.
151+ *
152+ * Has no result for paths starting with a `.` or `/`
153+ *
154+ * For example:
155+ * - `foo/bar` maps to `foo`
156+ * - `@example/foo/bar` maps to `@example/foo`
157+ * - `./foo` maps to nothing.
152158 */
153159 bindingset [ this ]
154160 string getPackagePrefix ( ) {
You can’t perform that action at this time.
0 commit comments