From 290e3a29ca08db74e205ef3c8bec958de00f87be Mon Sep 17 00:00:00 2001 From: hiroki osame Date: Mon, 22 Aug 2022 13:05:16 -0400 Subject: [PATCH] `PackageJson`: Support condition object in `exports` array (#439) --- source/package-json.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/package-json.d.ts b/source/package-json.d.ts index 1bccfd041..99fb9e597 100644 --- a/source/package-json.d.ts +++ b/source/package-json.d.ts @@ -223,15 +223,17 @@ declare namespace PackageJson { string >; + type ExportConditions = {[condition in ExportCondition]: Exports}; + /** Entry points of a module, optionally with conditions and subpath exports. */ export type Exports = | null | string - | string[] - | {[key in ExportCondition]: Exports} - | {[key: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style + | Array + | ExportConditions + | {[path: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style /** Import map entries of a module, optionally with conditions.