File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ export function parseExports(options: {
174
174
}
175
175
} else if ( isRecord ( exportEntry ) && 'svelte' in exportEntry ) {
176
176
// @TODO should we report a warning or a debug message here about a detected svelte export that is ignored?
177
- } else if ( isRecord ( exportEntry ) ) {
177
+ } else if ( isPkgExport ( exportEntry ) ) {
178
178
const exp = {
179
179
_exported : true ,
180
180
_path : exportPath ,
@@ -240,7 +240,7 @@ export function parseExports(options: {
240
240
}
241
241
242
242
_exports . push ( exp )
243
- } else {
243
+ } else if ( ! isRecord ( exportEntry ) ) {
244
244
errors . push ( 'package.json: exports must be an object' )
245
245
}
246
246
}
@@ -253,3 +253,7 @@ export function parseExports(options: {
253
253
254
254
return _exports
255
255
}
256
+
257
+ function isPkgExport ( value : unknown ) : value is PkgExport {
258
+ return isRecord ( value ) && 'source' in value && typeof value [ 'source' ] === 'string'
259
+ }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export interface PackageJSON {
15
15
string ,
16
16
| `./${string } .json`
17
17
| {
18
- source : string
18
+ source ? : string
19
19
types ?: string
20
20
browser ?: {
21
21
source : string
You can’t perform that action at this time.
0 commit comments