@@ -45,8 +45,8 @@ int numberOfExtensions() { result = count(getFileExtensionPriority(_)) }
4545 * Gets the resolution target with the given `priority` of `req`
4646 * when resolved from the root with priority `rootPriority`.
4747 */
48- File loadAsFile ( Require req , int rootPriority , int priority ) {
49- exists ( PathExpr path | path = req .getImportedPathExpr ( ) |
48+ deprecated File loadAsFile ( Require req , int rootPriority , int priority ) {
49+ exists ( PathExpr path | path = req .getImportedPath ( ) |
5050 result = path .resolve ( rootPriority ) and priority = 0
5151 or
5252 exists ( Folder encl | encl = path .resolveUpTo ( path .getNumComponent ( ) - 1 , rootPriority ) |
@@ -60,8 +60,8 @@ File loadAsFile(Require req, int rootPriority, int priority) {
6060 * with the given `priority` of `req` when resolved from the root with
6161 * priority `rootPriority`.
6262 */
63- File loadAsDirectory ( Require req , int rootPriority , int priority ) {
64- exists ( Folder dir | dir = req .getImportedPathExpr ( ) . ( PathExpr ) .resolve ( rootPriority ) |
63+ deprecated File loadAsDirectory ( Require req , int rootPriority , int priority ) {
64+ exists ( Folder dir | dir = req .getImportedPath ( ) .resolve ( rootPriority ) |
6565 result = resolveMainModule ( dir .( NpmPackage ) .getPackageJson ( ) , priority , "." ) or
6666 result = tryExtensions ( dir , "index" , priority - ( numberOfExtensions ( ) + 1 ) )
6767 )
@@ -99,7 +99,7 @@ private string getStem(string name) {
9999 * Gets a file that a main module from `pkg` exported as `mainPath` with the given `priority`.
100100 * `mainPath` is "." if it's the main module of the package.
101101 */
102- private File resolveMainPath ( PackageJson pkg , string mainPath , int priority ) {
102+ deprecated private File resolveMainPath ( PackageJson pkg , string mainPath , int priority ) {
103103 exists ( PathExpr main | main = MainModulePath:: of ( pkg , mainPath ) |
104104 result = main .resolve ( ) and priority = 0
105105 or
@@ -132,7 +132,7 @@ private File resolveMainPath(PackageJson pkg, string mainPath, int priority) {
132132/**
133133 * Gets the main module described by `pkg` with the given `priority`.
134134 */
135- File resolveMainModule ( PackageJson pkg , int priority , string exportPath ) {
135+ deprecated File resolveMainModule ( PackageJson pkg , int priority , string exportPath ) {
136136 result = resolveMainPath ( pkg , exportPath , priority )
137137 or
138138 exportPath = "." and
@@ -178,7 +178,7 @@ private string getASrcFolderName() { result = ["ts", "js", "src", "lib"] }
178178 * A JSON string in a `package.json` file specifying the path of one of the exported
179179 * modules of the package.
180180 */
181- class MainModulePath extends PathExpr , @json_string {
181+ deprecated class MainModulePath extends PathExpr , @json_string {
182182 PackageJson pkg ;
183183
184184 MainModulePath ( ) {
@@ -228,7 +228,7 @@ private string getExportRelativePath(JsonValue part) {
228228 result .matches ( ".%" )
229229}
230230
231- module MainModulePath {
231+ deprecated module MainModulePath {
232232 /** Gets the path to the main entry point of `pkg`. */
233233 MainModulePath of ( PackageJson pkg ) { result = of ( pkg , "." ) }
234234
@@ -244,7 +244,7 @@ module MainModulePath {
244244 * These files are often imported directly from a client when a "main" module is not specified.
245245 * For performance reasons this only exists if there is no "main" field in the `package.json` file.
246246 */
247- private class FilesPath extends PathExpr , @json_string {
247+ deprecated private class FilesPath extends PathExpr , @json_string {
248248 PackageJson pkg ;
249249
250250 FilesPath ( ) {
@@ -263,15 +263,15 @@ private class FilesPath extends PathExpr, @json_string {
263263 }
264264}
265265
266- private module FilesPath {
266+ deprecated private module FilesPath {
267267 FilesPath of ( PackageJson pkg ) { result .getPackageJson ( ) = pkg }
268268}
269269
270270/**
271271 * A JSON string in a `package.json` file specifying the path of the
272272 * TypeScript typings entry point.
273273 */
274- class TypingsModulePathString extends PathString {
274+ deprecated class TypingsModulePathString extends PathString {
275275 PackageJson pkg ;
276276
277277 TypingsModulePathString ( ) {
@@ -288,7 +288,7 @@ class TypingsModulePathString extends PathString {
288288}
289289
290290/** Companion module to the `TypingsModulePathString` class. */
291- module TypingsModulePathString {
291+ deprecated module TypingsModulePathString {
292292 /** Get the typings path for the given `package.json` file. */
293293 TypingsModulePathString of ( PackageJson pkg ) { result .getPackageJson ( ) = pkg }
294294}
0 commit comments