@@ -12,18 +12,16 @@ const { resolve, sep } = require('path');
12
12
const { kEmptyObject } = require ( 'internal/util' ) ;
13
13
14
14
/**
15
- * @typedef {import('typings/internalBinding/modules').FullPackageConfig } FullPackageConfig
16
15
* @typedef {import('typings/internalBinding/modules').PackageConfig } PackageConfig
17
16
* @typedef {import('typings/internalBinding/modules').SerializedPackageConfig } SerializedPackageConfig
18
17
*/
19
18
20
19
/**
21
20
* @param {string } path
22
21
* @param {SerializedPackageConfig } contents
23
- * @param {boolean } everything
24
- * @returns {everything extends true ? FullPackageConfig : PackageConfig }
22
+ * @returns {PackageConfig }
25
23
*/
26
- function deserializePackageJSON ( path , contents , everything = false ) {
24
+ function deserializePackageJSON ( path , contents ) {
27
25
if ( contents === undefined ) {
28
26
return {
29
27
__proto__ : null ,
@@ -71,7 +69,6 @@ function deserializePackageJSON(path, contents, everything = false) {
71
69
ObjectDefineProperty ( this , 'exports' , { __proto__ : null , value } ) ;
72
70
return this . exports ;
73
71
} ,
74
- ...( everything && contents [ 6 ] ) ,
75
72
} ;
76
73
}
77
74
@@ -113,17 +110,16 @@ function readPackage(requestPath) {
113
110
* Get the nearest parent package.json file from a given path.
114
111
* Return the package.json data and the path to the package.json file, or undefined.
115
112
* @param {string } checkPath The path to start searching from.
116
- * @param {boolean } everything Whether to include unrecognised fields.
117
113
* @returns {undefined | {data: PackageConfig, path: string} }
118
114
*/
119
- function getNearestParentPackageJSON ( checkPath , everything = false ) {
115
+ function getNearestParentPackageJSON ( checkPath ) {
120
116
const result = modulesBinding . getNearestParentPackageJSON ( checkPath ) ;
121
117
122
118
if ( result === undefined ) {
123
119
return undefined ;
124
120
}
125
121
126
- const data = deserializePackageJSON ( checkPath , result , everything ) ;
122
+ const data = deserializePackageJSON ( checkPath , result ) ;
127
123
128
124
// Path should be the root folder of the matched package.json
129
125
// For example for ~/path/package.json, it should be ~/path
@@ -144,14 +140,13 @@ function findNearestPackageJSON(origin) {
144
140
/**
145
141
* Returns the package configuration for the given resolved URL.
146
142
* @param {URL | string } resolved - The resolved URL.
147
- * @param {boolean } everything - Whether to include unrecognised fields.
148
143
* @returns {PackageConfig } - The package configuration.
149
144
*/
150
- function getPackageScopeConfig ( resolved , everything = false ) {
145
+ function getPackageScopeConfig ( resolved ) {
151
146
const result = modulesBinding . getPackageScopeConfig ( `${ resolved } ` ) ;
152
147
153
148
if ( ArrayIsArray ( result ) ) {
154
- return deserializePackageJSON ( `${ resolved } ` , result , everything ) ;
149
+ return deserializePackageJSON ( `${ resolved } ` , result ) ;
155
150
}
156
151
157
152
// This means that the response is a string
0 commit comments