@endo/compartment-mapper 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +23 -9
- package/src/archive-lite.js +3 -3
- package/src/capture-lite.d.ts.map +1 -1
- package/src/capture-lite.js +29 -3
- package/src/compartment-map.d.ts.map +1 -1
- package/src/compartment-map.js +3 -2
- package/src/digest.js +1 -1
- package/src/generic-graph.d.ts +7 -25
- package/src/generic-graph.d.ts.map +1 -1
- package/src/generic-graph.js +75 -105
- package/src/import-hook.d.ts.map +1 -1
- package/src/import-hook.js +4 -3
- package/src/infer-exports.d.ts +4 -2
- package/src/infer-exports.d.ts.map +1 -1
- package/src/infer-exports.js +158 -19
- package/src/link.d.ts.map +1 -1
- package/src/link.js +61 -3
- package/src/node-modules.d.ts.map +1 -1
- package/src/node-modules.js +33 -39
- package/src/pattern-replacement.d.ts +6 -0
- package/src/pattern-replacement.d.ts.map +1 -0
- package/src/pattern-replacement.js +198 -0
- package/src/types/compartment-map-schema.d.ts +8 -1
- package/src/types/compartment-map-schema.d.ts.map +1 -1
- package/src/types/compartment-map-schema.ts +9 -0
- package/src/types/external.d.ts +79 -55
- package/src/types/external.d.ts.map +1 -1
- package/src/types/external.ts +104 -62
- package/src/types/generic-graph.d.ts +8 -2
- package/src/types/generic-graph.d.ts.map +1 -1
- package/src/types/generic-graph.ts +7 -2
- package/src/types/internal.d.ts +8 -8
- package/src/types/internal.d.ts.map +1 -1
- package/src/types/internal.ts +9 -8
- package/src/types/node-modules.d.ts +45 -8
- package/src/types/node-modules.d.ts.map +1 -1
- package/src/types/node-modules.ts +56 -15
- package/src/types/pattern-replacement.d.ts +62 -0
- package/src/types/pattern-replacement.d.ts.map +1 -0
- package/src/types/pattern-replacement.ts +70 -0
- package/src/types/powers.d.ts +11 -9
- package/src/types/powers.d.ts.map +1 -1
- package/src/types/powers.ts +11 -10
|
@@ -1,26 +1,61 @@
|
|
|
1
1
|
import type { GenericGraph } from '../generic-graph.js';
|
|
2
|
-
import type {
|
|
3
|
-
ATTENUATORS_COMPARTMENT,
|
|
4
|
-
ENTRY_COMPARTMENT,
|
|
5
|
-
} from '../policy-format.js';
|
|
6
2
|
import type {
|
|
7
3
|
CanonicalName,
|
|
8
|
-
CompartmentMapDescriptor,
|
|
9
4
|
PackageCompartmentDescriptorName,
|
|
10
5
|
PolicyOption,
|
|
11
|
-
SomePolicy,
|
|
12
6
|
} from '../types.js';
|
|
13
7
|
import type {
|
|
14
8
|
Language,
|
|
15
9
|
LanguageForExtension,
|
|
16
|
-
PackageCompartmentMapDescriptor,
|
|
17
10
|
} from './compartment-map-schema.js';
|
|
18
11
|
import type {
|
|
19
12
|
FileUrlString,
|
|
20
13
|
LogOptions,
|
|
21
14
|
PackageDependenciesHook,
|
|
22
15
|
} from './external.js';
|
|
16
|
+
import type { PatternDescriptor } from './pattern-replacement.js';
|
|
23
17
|
import type { LiteralUnion } from './typescript.js';
|
|
18
|
+
import { ATTENUATORS_COMPARTMENT } from '../policy-format.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A mapping of conditions to their resolved exports.
|
|
22
|
+
* Each condition key (e.g., "import", "require", "node", "default")
|
|
23
|
+
* maps to an {@link Exports} value.
|
|
24
|
+
*
|
|
25
|
+
* @see {@link https://github.com/sindresorhus/type-fest/blob/850b33c4dd292e0ff8cff039ee167d69be324fce/source/package-json.d.ts#L227-L248 | type-fest ExportConditions}
|
|
26
|
+
*/
|
|
27
|
+
export type ExportConditions = {
|
|
28
|
+
// eslint-disable-next-line no-use-before-define
|
|
29
|
+
[condition: string]: Exports;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Entry points of a module, optionally with conditions and subpath exports.
|
|
34
|
+
* Follows the recursive structure defined by Node.js for `package.json`
|
|
35
|
+
* `exports` and `imports` fields.
|
|
36
|
+
*
|
|
37
|
+
* - `null` excludes a subpath (null target).
|
|
38
|
+
* - `string` is a direct path.
|
|
39
|
+
* - `Array` is a fallback list (first match wins).
|
|
40
|
+
* - `ExportConditions` is a mapping of conditions to nested `Exports`.
|
|
41
|
+
*
|
|
42
|
+
* @see {@link https://github.com/sindresorhus/type-fest/blob/850b33c4dd292e0ff8cff039ee167d69be324fce/source/package-json.d.ts#L227-L248 | type-fest Exports}
|
|
43
|
+
*/
|
|
44
|
+
export type Exports =
|
|
45
|
+
| null
|
|
46
|
+
| string
|
|
47
|
+
| Array<string | ExportConditions>
|
|
48
|
+
| ExportConditions;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The `imports` field of `package.json`.
|
|
52
|
+
* Keys must start with `#`.
|
|
53
|
+
*
|
|
54
|
+
* @see {@link https://github.com/sindresorhus/type-fest/blob/850b33c4dd292e0ff8cff039ee167d69be324fce/source/package-json.d.ts#L227-L248 | type-fest Imports}
|
|
55
|
+
*/
|
|
56
|
+
export type Imports = {
|
|
57
|
+
[key: `#${string}`]: Exports;
|
|
58
|
+
};
|
|
24
59
|
|
|
25
60
|
export type CommonDependencyDescriptors = Record<
|
|
26
61
|
string,
|
|
@@ -35,7 +70,7 @@ export type CommonDependencyDescriptorsOptions = {
|
|
|
35
70
|
/**
|
|
36
71
|
* Dependencies added to _all_ packages
|
|
37
72
|
*/
|
|
38
|
-
commonDependencyDescriptors?: CommonDependencyDescriptors;
|
|
73
|
+
commonDependencyDescriptors?: CommonDependencyDescriptors | undefined;
|
|
39
74
|
};
|
|
40
75
|
|
|
41
76
|
/**
|
|
@@ -64,11 +99,11 @@ export type GraphPackagesOptions = LogOptions &
|
|
|
64
99
|
* Options for `gatherDependency()`
|
|
65
100
|
*/
|
|
66
101
|
export type GatherDependencyOptions = {
|
|
67
|
-
childLogicalPath?: string[];
|
|
102
|
+
childLogicalPath?: string[] | undefined;
|
|
68
103
|
/**
|
|
69
104
|
* If `true` the dependency is optional
|
|
70
105
|
*/
|
|
71
|
-
optional?: boolean;
|
|
106
|
+
optional?: boolean | undefined;
|
|
72
107
|
} & LogOptions &
|
|
73
108
|
PackageDependenciesHookOption &
|
|
74
109
|
PolicyOption &
|
|
@@ -85,10 +120,8 @@ export interface PackageDescriptor {
|
|
|
85
120
|
*/
|
|
86
121
|
name: string;
|
|
87
122
|
version?: string;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
*/
|
|
91
|
-
exports?: unknown;
|
|
123
|
+
exports?: Exports;
|
|
124
|
+
imports?: Imports;
|
|
92
125
|
type?: 'module' | 'commonjs';
|
|
93
126
|
dependencies?: Record<string, string>;
|
|
94
127
|
devDependencies?: Record<string, string>;
|
|
@@ -126,6 +159,11 @@ export interface Node {
|
|
|
126
159
|
explicitExports: boolean;
|
|
127
160
|
internalAliases: Record<string, string>;
|
|
128
161
|
externalAliases: Record<string, string>;
|
|
162
|
+
/**
|
|
163
|
+
* Wildcard patterns extracted from the `exports` and `imports` fields.
|
|
164
|
+
* `*` matches exactly one path segment (Node.js semantics).
|
|
165
|
+
*/
|
|
166
|
+
patterns: PatternDescriptor[];
|
|
129
167
|
/**
|
|
130
168
|
* The name of the original package's parent directory, for reconstructing
|
|
131
169
|
* a sourceURL that is likely to converge with the original location in an IDE.
|
|
@@ -164,7 +202,10 @@ export interface FinalNode extends Node {
|
|
|
164
202
|
* Keys may either be a file URL string to a package or the special
|
|
165
203
|
* `<ATTENUATORS>` string.
|
|
166
204
|
*/
|
|
167
|
-
export type Graph = Record<
|
|
205
|
+
export type Graph = Record<
|
|
206
|
+
LiteralUnion<typeof ATTENUATORS_COMPARTMENT, FileUrlString>,
|
|
207
|
+
Node
|
|
208
|
+
>;
|
|
168
209
|
|
|
169
210
|
/**
|
|
170
211
|
* A graph, but contains {@link FinalNode}s instead of {@link Node}s.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for subpath pattern matching.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Result of a successful pattern match.
|
|
8
|
+
*/
|
|
9
|
+
export interface SubpathReplacerResult {
|
|
10
|
+
/** The resolved module path, or null for null-target exclusions */
|
|
11
|
+
result: string | null;
|
|
12
|
+
/** Optional compartment name for cross-compartment patterns */
|
|
13
|
+
compartment?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A function that attempts to match a specifier against patterns
|
|
17
|
+
* and returns the replacement path (with optional compartment), or null if no match.
|
|
18
|
+
*/
|
|
19
|
+
export type SubpathReplacer = (specifier: string) => SubpathReplacerResult | null;
|
|
20
|
+
/**
|
|
21
|
+
* Input format for pattern mappings - either an array of tuples,
|
|
22
|
+
* an array of PatternDescriptors, or a record object.
|
|
23
|
+
*/
|
|
24
|
+
export type SubpathMapping = Array<[pattern: string, replacement: string]> | Record<string, string>;
|
|
25
|
+
/**
|
|
26
|
+
* Internal representation of a parsed pattern entry, split into
|
|
27
|
+
* prefix/suffix for efficient matching.
|
|
28
|
+
*/
|
|
29
|
+
export interface ResolvedPattern {
|
|
30
|
+
/** The original pattern key */
|
|
31
|
+
pattern: string;
|
|
32
|
+
/** The part of the pattern before `*` */
|
|
33
|
+
prefix: string;
|
|
34
|
+
/** The part of the pattern after `*` */
|
|
35
|
+
suffix: string;
|
|
36
|
+
/** The part of the replacement before `*`, or null for exclusions */
|
|
37
|
+
replacementPrefix: string | null;
|
|
38
|
+
/** The part of the replacement after `*`, or null for exclusions */
|
|
39
|
+
replacementSuffix: string | null;
|
|
40
|
+
/** Optional compartment for cross-compartment patterns */
|
|
41
|
+
compartment?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A pattern descriptor for wildcard-based module resolution.
|
|
45
|
+
* The `from` pattern is matched against module specifiers,
|
|
46
|
+
* and `to` is the replacement pattern.
|
|
47
|
+
*
|
|
48
|
+
* Wildcards (`*`) match any substring including `/` (Node.js semantics).
|
|
49
|
+
*/
|
|
50
|
+
export interface PatternDescriptor {
|
|
51
|
+
/** Source pattern with wildcard, e.g., "./lib/*.js" */
|
|
52
|
+
from: string;
|
|
53
|
+
/** Target pattern with wildcard, e.g., "./*.js". Null means exclusion. */
|
|
54
|
+
to: string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Optional compartment name where the resolved module lives.
|
|
57
|
+
* When absent, the pattern resolves within the owning compartment.
|
|
58
|
+
* Set when propagating export patterns from a dependency package.
|
|
59
|
+
*/
|
|
60
|
+
compartment?: string;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=pattern-replacement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-replacement.d.ts","sourceRoot":"","sources":["pattern-replacement.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,mEAAmE;IACnE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,SAAS,EAAE,MAAM,KACd,qBAAqB,GAAG,IAAI,CAAC;AAElC;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,GAC7C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3B;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,oEAAoE;IACpE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for subpath pattern matching.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Result of a successful pattern match.
|
|
9
|
+
*/
|
|
10
|
+
export interface SubpathReplacerResult {
|
|
11
|
+
/** The resolved module path, or null for null-target exclusions */
|
|
12
|
+
result: string | null;
|
|
13
|
+
/** Optional compartment name for cross-compartment patterns */
|
|
14
|
+
compartment?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A function that attempts to match a specifier against patterns
|
|
19
|
+
* and returns the replacement path (with optional compartment), or null if no match.
|
|
20
|
+
*/
|
|
21
|
+
export type SubpathReplacer = (
|
|
22
|
+
specifier: string,
|
|
23
|
+
) => SubpathReplacerResult | null;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Input format for pattern mappings - either an array of tuples,
|
|
27
|
+
* an array of PatternDescriptors, or a record object.
|
|
28
|
+
*/
|
|
29
|
+
export type SubpathMapping =
|
|
30
|
+
| Array<[pattern: string, replacement: string]>
|
|
31
|
+
| Record<string, string>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Internal representation of a parsed pattern entry, split into
|
|
35
|
+
* prefix/suffix for efficient matching.
|
|
36
|
+
*/
|
|
37
|
+
export interface ResolvedPattern {
|
|
38
|
+
/** The original pattern key */
|
|
39
|
+
pattern: string;
|
|
40
|
+
/** The part of the pattern before `*` */
|
|
41
|
+
prefix: string;
|
|
42
|
+
/** The part of the pattern after `*` */
|
|
43
|
+
suffix: string;
|
|
44
|
+
/** The part of the replacement before `*`, or null for exclusions */
|
|
45
|
+
replacementPrefix: string | null;
|
|
46
|
+
/** The part of the replacement after `*`, or null for exclusions */
|
|
47
|
+
replacementSuffix: string | null;
|
|
48
|
+
/** Optional compartment for cross-compartment patterns */
|
|
49
|
+
compartment?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A pattern descriptor for wildcard-based module resolution.
|
|
54
|
+
* The `from` pattern is matched against module specifiers,
|
|
55
|
+
* and `to` is the replacement pattern.
|
|
56
|
+
*
|
|
57
|
+
* Wildcards (`*`) match any substring including `/` (Node.js semantics).
|
|
58
|
+
*/
|
|
59
|
+
export interface PatternDescriptor {
|
|
60
|
+
/** Source pattern with wildcard, e.g., "./lib/*.js" */
|
|
61
|
+
from: string;
|
|
62
|
+
/** Target pattern with wildcard, e.g., "./*.js". Null means exclusion. */
|
|
63
|
+
to: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* Optional compartment name where the resolved module lives.
|
|
66
|
+
* When absent, the pattern resolves within the owning compartment.
|
|
67
|
+
* Set when propagating export patterns from a dependency package.
|
|
68
|
+
*/
|
|
69
|
+
compartment?: string;
|
|
70
|
+
}
|
package/src/types/powers.d.ts
CHANGED
|
@@ -15,14 +15,14 @@ import type { SomeObject } from './typescript.js';
|
|
|
15
15
|
export type ReadPowers<T extends string = any> = {
|
|
16
16
|
canonical: CanonicalFn<T>;
|
|
17
17
|
read: ReadFn;
|
|
18
|
-
maybeRead?: MaybeReadFn;
|
|
19
|
-
readNow?: ReadNowFn;
|
|
20
|
-
maybeReadNow?: MaybeReadNowFn;
|
|
21
|
-
computeSha512?: HashFn;
|
|
22
|
-
fileURLToPath?: FileURLToPathFn;
|
|
23
|
-
pathToFileURL?: PathToFileURLFn;
|
|
24
|
-
requireResolve?: RequireResolveFn;
|
|
25
|
-
isAbsolute?: IsAbsoluteFn;
|
|
18
|
+
maybeRead?: MaybeReadFn | undefined;
|
|
19
|
+
readNow?: ReadNowFn | undefined;
|
|
20
|
+
maybeReadNow?: MaybeReadNowFn | undefined;
|
|
21
|
+
computeSha512?: HashFn | undefined;
|
|
22
|
+
fileURLToPath?: FileURLToPathFn | undefined;
|
|
23
|
+
pathToFileURL?: PathToFileURLFn | undefined;
|
|
24
|
+
requireResolve?: RequireResolveFn | undefined;
|
|
25
|
+
isAbsolute?: IsAbsoluteFn | undefined;
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
28
28
|
* @template T The expected input/output type of the {@link CanonicalFn}.
|
|
@@ -42,7 +42,9 @@ export type MaybeReadPowers<T extends string = any> = ReadPowers<T> & {
|
|
|
42
42
|
*
|
|
43
43
|
* @template T The expected input/output type of the {@link CanonicalFn}.
|
|
44
44
|
*/
|
|
45
|
-
export type ReadNowPowers<T extends string = any> = Omit<ReadPowers<T>, ReadNowPowersProp> &
|
|
45
|
+
export type ReadNowPowers<T extends string = any> = Omit<ReadPowers<T>, ReadNowPowersProp> & {
|
|
46
|
+
[P in ReadNowPowersProp]-?: NonNullable<ReadPowers<T>[P]>;
|
|
47
|
+
};
|
|
46
48
|
/**
|
|
47
49
|
* These properties are necessary for dynamic require support
|
|
48
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powers.d.ts","sourceRoot":"","sources":["powers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,IAAI;IAC/C,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"powers.d.ts","sourceRoot":"","sources":["powers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD;;;;GAIG;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AAO,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE7E,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,UAAU,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;AAInD,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC"}
|
package/src/types/powers.ts
CHANGED
|
@@ -21,14 +21,14 @@ import type { SomeObject } from './typescript.js';
|
|
|
21
21
|
export type ReadPowers<T extends string = any> = {
|
|
22
22
|
canonical: CanonicalFn<T>;
|
|
23
23
|
read: ReadFn;
|
|
24
|
-
maybeRead?: MaybeReadFn;
|
|
25
|
-
readNow?: ReadNowFn;
|
|
26
|
-
maybeReadNow?: MaybeReadNowFn;
|
|
27
|
-
computeSha512?: HashFn;
|
|
28
|
-
fileURLToPath?: FileURLToPathFn;
|
|
29
|
-
pathToFileURL?: PathToFileURLFn;
|
|
30
|
-
requireResolve?: RequireResolveFn;
|
|
31
|
-
isAbsolute?: IsAbsoluteFn;
|
|
24
|
+
maybeRead?: MaybeReadFn | undefined;
|
|
25
|
+
readNow?: ReadNowFn | undefined;
|
|
26
|
+
maybeReadNow?: MaybeReadNowFn | undefined;
|
|
27
|
+
computeSha512?: HashFn | undefined;
|
|
28
|
+
fileURLToPath?: FileURLToPathFn | undefined;
|
|
29
|
+
pathToFileURL?: PathToFileURLFn | undefined;
|
|
30
|
+
requireResolve?: RequireResolveFn | undefined;
|
|
31
|
+
isAbsolute?: IsAbsoluteFn | undefined;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -53,8 +53,9 @@ export type MaybeReadPowers<T extends string = any> = ReadPowers<T> & {
|
|
|
53
53
|
export type ReadNowPowers<T extends string = any> = Omit<
|
|
54
54
|
ReadPowers<T>,
|
|
55
55
|
ReadNowPowersProp
|
|
56
|
-
> &
|
|
57
|
-
|
|
56
|
+
> & {
|
|
57
|
+
[P in ReadNowPowersProp]-?: NonNullable<ReadPowers<T>[P]>;
|
|
58
|
+
};
|
|
58
59
|
|
|
59
60
|
/**
|
|
60
61
|
* These properties are necessary for dynamic require support
|