| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9837e08 commit 9e6054e
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -474,7 +474,7 @@ function initializeCJS() { | |||
| 474 | 474 | // -> a.<ext> | |
| 475 | 475 | // -> a/index.<ext> | |
| 476 | 476 | ||
| 477 | - let _readPackage = packageJsonReader.readPackage; | ||
| 477 | + let _readPackage = (requestPath) => packageJsonReader.read(path.resolve(requestPath, 'package.json')); | ||
| 478 | 478 | ObjectDefineProperty(Module, '_readPackage', { | |
| 479 | 479 | __proto__: null, | |
| 480 | 480 | get() { return _readPackage; }, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -124,17 +124,6 @@ function read(jsonPath, { base, specifier, isESM } = kEmptyObject) { | |||
| 124 | 124 | }; | |
| 125 | 125 | } | |
| 126 | 126 | ||
| 127 | - /** | ||
| 128 | - * @deprecated Expected to be removed in favor of `read` in the future. | ||
| 129 | - * Behaves the same was as `read`, but appends package.json to the path. | ||
| 130 | - * @param {string} requestPath | ||
| 131 | - * @return {PackageConfig} | ||
| 132 | - */ | ||
| 133 | - function readPackage(requestPath) { | ||
| 134 | - // TODO(@anonrig): Remove this function. | ||
| 135 | - return read(path.resolve(requestPath, 'package.json')); | ||
| 136 | - } | ||
| 137 | - | ||
| 138 | 127 | /** | |
| 139 | 128 | * Get the nearest parent package.json file from a given path. | |
| 140 | 129 | * Return the package.json data and the path to the package.json file, or undefined. | |
@@ -321,7 +310,6 @@ function findPackageJSON(specifier, base = 'data:') { | |||
| 321 | 310 | ||
| 322 | 311 | module.exports = { | |
| 323 | 312 | read, | |
| 324 | - readPackage, | ||
| 325 | 313 | getNearestParentPackageJSON, | |
| 326 | 314 | getPackageScopeConfig, | |
| 327 | 315 | getPackageType, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments