CodeQL library for JavaScript
Search

Class MainModulePath

A JSON string in a package.json file specifying the path of the main module of the package.

Import path

import semmle.javascript.NodeModuleResolutionImpl

Direct supertypes

Indirect supertypes

Fields

Predicates

getAdditionalSearchRoot

INTERNAL. Use getSearchRoot instead.

getPackageJSON

Gets the package.json file in which this path occurs.

getValue

Gets the (unresolved) path represented by this expression.

Inherited predicates

getAPrimaryQlClass

Gets the primary QL class for the Locatable.

from Locatable
getBaseName

Gets the base name of the folder or file this path refers to.

from PathExpr
getComponent

Gets the ith component of this path.

from PathExpr
getEnclosingModule

Gets the module containing this path expression, if any.

from PathExpr
getEndLine

Gets the line on which this element ends.

from Locatable
getExtension

Gets the extension of the folder or file this path refers to, that is, the suffix of the base name starting at the last dot character, if there is one.

from PathExpr
getFile

Gets the file this program element comes from.

from Locatable
getLocation

Gets this element’s location.

from Locatable
getNumComponent

Gets the number of components of this path.

from PathExpr
getNumLines

Gets the number of lines covered by this element.

from Locatable
getSearchRoot

Gets the root folder of priority priority associated with this path expression.

from PathExpr
getStartLine

Gets the line on which this element starts.

from Locatable
getStem

Gets the stem, that is, base name without extension, of the folder or file this path refers to.

from PathExpr
resolve

Gets the file or folder that this path refers to when resolved relative to the root folder of the given priority.

from PathExpr
resolve

Gets the file or folder that this path refers to.

from PathExpr
resolveUpTo

Gets the file or folder that the first n components of this path refer to when resolved relative to the root folder of the given priority.

from PathExpr
resolveUpTo

Gets the file or folder that the first n components of this path refer to.

from PathExpr
toString

Gets a textual representation of this element.

from Locatable

Charpred