@halospv3/hce.shared-config 3.4.6-develop.1 → 3.4.6-develop.2
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/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/mjs/CaseInsensitiveMap.d.mts +15 -0
- package/mjs/CaseInsensitiveMap.d.mts.map +1 -0
- package/mjs/CaseInsensitiveMap.mjs +2 -33
- package/mjs/CaseInsensitiveMap.mjs.map +1 -1
- package/mjs/commitlintConfig.d.mts +15 -0
- package/mjs/commitlintConfig.d.mts.map +1 -0
- package/mjs/commitlintConfig.mjs +2 -13
- package/mjs/commitlintConfig.mjs.map +1 -1
- package/mjs/debug.d.mts +9 -0
- package/mjs/debug.d.mts.map +1 -0
- package/mjs/debug.mjs +2 -9
- package/mjs/debug.mjs.map +1 -1
- package/mjs/dotnet/GithubNugetRegistryInfo.d.mts +42 -0
- package/mjs/dotnet/GithubNugetRegistryInfo.d.mts.map +1 -0
- package/mjs/dotnet/GithubNugetRegistryInfo.mjs +2 -43
- package/mjs/dotnet/GithubNugetRegistryInfo.mjs.map +1 -1
- package/mjs/dotnet/GitlabNugetRegistryInfo.d.mts +65 -0
- package/mjs/dotnet/GitlabNugetRegistryInfo.d.mts.map +1 -0
- package/mjs/dotnet/GitlabNugetRegistryInfo.mjs +2 -99
- package/mjs/dotnet/GitlabNugetRegistryInfo.mjs.map +1 -1
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.mts +1 -0
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs +2 -44
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs.map +1 -1
- package/mjs/dotnet/MSBuildProject.d.mts +267 -0
- package/mjs/dotnet/MSBuildProject.d.mts.map +1 -0
- package/mjs/dotnet/MSBuildProject.mjs +3 -490
- package/mjs/dotnet/MSBuildProject.mjs.map +1 -1
- package/mjs/dotnet/MSBuildProjectProperties.d.mts +172 -0
- package/mjs/dotnet/MSBuildProjectProperties.d.mts.map +1 -0
- package/mjs/dotnet/MSBuildProjectProperties.mjs +2 -260
- package/mjs/dotnet/MSBuildProjectProperties.mjs.map +1 -1
- package/mjs/dotnet/NugetProjectProperties.d.mts +381 -0
- package/mjs/dotnet/NugetProjectProperties.d.mts.map +1 -0
- package/mjs/dotnet/NugetProjectProperties.mjs +2 -577
- package/mjs/dotnet/NugetProjectProperties.mjs.map +1 -1
- package/mjs/dotnet/NugetRegistryInfo.d.mts +387 -0
- package/mjs/dotnet/NugetRegistryInfo.d.mts.map +1 -0
- package/mjs/dotnet/NugetRegistryInfo.mjs +4 -752
- package/mjs/dotnet/NugetRegistryInfo.mjs.map +1 -1
- package/mjs/dotnet/helpers.d.mts +66 -0
- package/mjs/dotnet/helpers.d.mts.map +1 -0
- package/mjs/dotnet/helpers.mjs +2 -354
- package/mjs/dotnet/helpers.mjs.map +1 -1
- package/mjs/dotnet/index.d.mts +8 -0
- package/mjs/dotnet/index.mjs +1 -9
- package/mjs/dotnet.d.mts +8 -0
- package/mjs/dotnet.mjs +1 -9
- package/mjs/eslintConfig.d.mts +7 -0
- package/mjs/eslintConfig.d.mts.map +1 -0
- package/mjs/eslintConfig.mjs +2 -64
- package/mjs/eslintConfig.mjs.map +1 -1
- package/mjs/index.d.mts +2 -0
- package/mjs/index.mjs +1 -4
- package/mjs/insertPlugins.d.mts +22 -0
- package/mjs/insertPlugins.d.mts.map +1 -0
- package/mjs/insertPlugins.mjs +2 -73
- package/mjs/insertPlugins.mjs.map +1 -1
- package/mjs/semantic-release__commit-analyzer.d.mts +44 -0
- package/mjs/semantic-release__commit-analyzer.d.mts.map +1 -0
- package/mjs/semantic-release__exec.d.mts +17 -0
- package/mjs/semantic-release__exec.d.mts.map +1 -0
- package/mjs/semantic-release__git.d.mts +83 -0
- package/mjs/semantic-release__git.d.mts.map +1 -0
- package/mjs/semantic-release__github.d.mts +141 -0
- package/mjs/semantic-release__github.d.mts.map +1 -0
- package/mjs/semanticReleaseConfig.d.mts +94 -0
- package/mjs/semanticReleaseConfig.d.mts.map +1 -0
- package/mjs/semanticReleaseConfig.mjs +2 -63
- package/mjs/semanticReleaseConfig.mjs.map +1 -1
- package/mjs/semanticReleaseConfigDotnet.d.mts +96 -0
- package/mjs/semanticReleaseConfigDotnet.d.mts.map +1 -0
- package/mjs/semanticReleaseConfigDotnet.mjs +7 -274
- package/mjs/semanticReleaseConfigDotnet.mjs.map +1 -1
- package/mjs/setupGitPluginSpec.d.mts +18 -0
- package/mjs/setupGitPluginSpec.d.mts.map +1 -0
- package/mjs/setupGitPluginSpec.default.d.mts +13 -0
- package/mjs/setupGitPluginSpec.default.d.mts.map +1 -0
- package/mjs/setupGitPluginSpec.default.mjs +4 -0
- package/mjs/setupGitPluginSpec.default.mjs.map +1 -0
- package/mjs/setupGitPluginSpec.mjs +2 -144
- package/mjs/setupGitPluginSpec.mjs.map +1 -1
- package/mjs/utils/Exact.d.mts +18 -0
- package/mjs/utils/Exact.d.mts.map +1 -0
- package/mjs/utils/Exact.mjs +2 -75
- package/mjs/utils/Exact.mjs.map +1 -1
- package/mjs/utils/GracefulRecursion.d.mts +14 -0
- package/mjs/utils/GracefulRecursion.d.mts.map +1 -0
- package/mjs/utils/env.d.mts +28 -0
- package/mjs/utils/env.d.mts.map +1 -0
- package/mjs/utils/env.mjs +2 -47
- package/mjs/utils/env.mjs.map +1 -1
- package/mjs/utils/execAsync.d.mts +40 -0
- package/mjs/utils/execAsync.d.mts.map +1 -0
- package/mjs/utils/execAsync.mjs +10 -59
- package/mjs/utils/execAsync.mjs.map +1 -1
- package/mjs/utils/isError.d.mts +14 -0
- package/mjs/utils/isError.d.mts.map +1 -0
- package/mjs/utils/isError.mjs +2 -19
- package/mjs/utils/isError.mjs.map +1 -1
- package/mjs/utils/miscTypes.d.mts +16 -0
- package/mjs/utils/miscTypes.d.mts.map +1 -0
- package/mjs/utils/miscTypes.mjs +2 -10
- package/mjs/utils/miscTypes.mjs.map +1 -1
- package/mjs/utils/reflection/FunctionLike.d.mts +17 -0
- package/mjs/utils/reflection/FunctionLike.d.mts.map +1 -0
- package/mjs/utils/reflection/GetterDescriptor.d.mts +11 -0
- package/mjs/utils/reflection/GetterDescriptor.d.mts.map +1 -0
- package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mts +26 -0
- package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mts.map +1 -0
- package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mts +17 -0
- package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mts.map +1 -0
- package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mts +18 -0
- package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mts.map +1 -0
- package/mjs/utils/reflection/OwnKeyOf.d.mts +15 -0
- package/mjs/utils/reflection/OwnKeyOf.d.mts.map +1 -0
- package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mts +15 -0
- package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mts.map +1 -0
- package/mjs/utils/reflection/PropertyDescriptorMap.d.mts +13 -0
- package/mjs/utils/reflection/PropertyDescriptorMap.d.mts.map +1 -0
- package/mjs/utils/reflection/filterForGetters.d.mts +11 -0
- package/mjs/utils/reflection/filterForGetters.d.mts.map +1 -0
- package/mjs/utils/reflection/filterForGetters.mjs +2 -27
- package/mjs/utils/reflection/filterForGetters.mjs.map +1 -1
- package/mjs/utils/reflection/getOwnPropertyDescriptors.d.mts +26 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptors.d.mts.map +1 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs +2 -34
- package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs.map +1 -1
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.mts +51 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.mts.map +1 -0
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs +2 -72
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs.map +1 -1
- package/mjs/utils/reflection/getPrototypeChainOf.d.mts +19 -0
- package/mjs/utils/reflection/getPrototypeChainOf.d.mts.map +1 -0
- package/mjs/utils/reflection/getPrototypeChainOf.mjs +2 -55
- package/mjs/utils/reflection/getPrototypeChainOf.mjs.map +1 -1
- package/mjs/utils/reflection/getPrototypeOf.d.mts +12 -0
- package/mjs/utils/reflection/getPrototypeOf.d.mts.map +1 -0
- package/mjs/utils/reflection/getPrototypeOf.mjs +2 -10
- package/mjs/utils/reflection/getPrototypeOf.mjs.map +1 -1
- package/mjs/utils/reflection/inheritance.d.mts +173 -0
- package/mjs/utils/reflection/inheritance.d.mts.map +1 -0
- package/mjs/utils/reflection/inheritance.mjs +2 -148
- package/mjs/utils/reflection/inheritance.mjs.map +1 -1
- package/mjs/utils/reflection/isConstructor.d.mts +20 -0
- package/mjs/utils/reflection/isConstructor.d.mts.map +1 -0
- package/mjs/utils/reflection/isConstructor.mjs +2 -63
- package/mjs/utils/reflection/isConstructor.mjs.map +1 -1
- package/mjs/utils/reflection/isGetterDescriptor.d.mts +13 -0
- package/mjs/utils/reflection/isGetterDescriptor.d.mts.map +1 -0
- package/mjs/utils/reflection/isGetterDescriptor.mjs +2 -12
- package/mjs/utils/reflection/isGetterDescriptor.mjs.map +1 -1
- package/mjs/utils/reflection/listOwnGetters.d.mts +29 -0
- package/mjs/utils/reflection/listOwnGetters.d.mts.map +1 -0
- package/mjs/utils/reflection/listOwnGetters.mjs +2 -39
- package/mjs/utils/reflection/listOwnGetters.mjs.map +1 -1
- package/mjs/utils/reflection.d.mts +18 -0
- package/mjs/utils/reflection.mjs +1 -10
- package/package.json +99 -62
- package/src/debug.ts +1 -0
- package/src/dotnet/GithubNugetRegistryInfo.ts +4 -4
- package/src/dotnet/GitlabNugetRegistryInfo.ts +5 -5
- package/src/dotnet/IsNextVersionAlreadyPublished.cli.ts +2 -1
- package/src/dotnet/MSBuildProject.ts +7 -6
- package/src/dotnet/MSBuildProjectProperties.ts +4 -3
- package/src/dotnet/NugetProjectProperties.ts +4 -4
- package/src/dotnet/NugetRegistryInfo.ts +9 -8
- package/src/dotnet/helpers.ts +5 -4
- package/src/dotnet/index.ts +8 -8
- package/src/dotnet.ts +1 -1
- package/src/index.ts +1 -1
- package/src/semanticReleaseConfig.ts +5 -1
- package/src/semanticReleaseConfigDotnet.ts +10 -8
- package/src/setupGitPluginSpec.default.ts +22 -0
- package/src/setupGitPluginSpec.ts +4 -21
- package/src/tsconfig.json +1 -2
- package/src/utils/execAsync.ts +1 -1
- package/src/utils/reflection/InstancePropertyDescriptorMap.d.ts +1 -1
- package/src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts +2 -2
- package/src/utils/reflection/OwnGetterDescriptorMap.d.ts +2 -2
- package/src/utils/reflection/filterForGetters.ts +5 -5
- package/src/utils/reflection/getOwnPropertyDescriptors.ts +4 -4
- package/src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts +12 -12
- package/src/utils/reflection/getPrototypeChainOf.ts +5 -5
- package/src/utils/reflection/getPrototypeOf.ts +1 -1
- package/src/utils/reflection/inheritance.ts +5 -5
- package/src/utils/reflection/isGetterDescriptor.ts +1 -1
- package/src/utils/reflection/listOwnGetters.ts +6 -6
- package/src/utils/reflection.ts +17 -17
- package/tsconfig.base.json +2 -2
- package/mjs/CaseInsensitiveMap.d.ts +0 -12
- package/mjs/CaseInsensitiveMap.d.ts.map +0 -1
- package/mjs/commitlintConfig.d.ts +0 -12
- package/mjs/commitlintConfig.d.ts.map +0 -1
- package/mjs/debug.d.ts +0 -6
- package/mjs/debug.d.ts.map +0 -1
- package/mjs/dotnet/GithubNugetRegistryInfo.d.ts +0 -38
- package/mjs/dotnet/GithubNugetRegistryInfo.d.ts.map +0 -1
- package/mjs/dotnet/GitlabNugetRegistryInfo.d.ts +0 -61
- package/mjs/dotnet/GitlabNugetRegistryInfo.d.ts.map +0 -1
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.ts +0 -2
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.ts.map +0 -1
- package/mjs/dotnet/MSBuildProject.d.ts +0 -264
- package/mjs/dotnet/MSBuildProject.d.ts.map +0 -1
- package/mjs/dotnet/MSBuildProjectProperties.d.ts +0 -170
- package/mjs/dotnet/MSBuildProjectProperties.d.ts.map +0 -1
- package/mjs/dotnet/NugetProjectProperties.d.ts +0 -379
- package/mjs/dotnet/NugetProjectProperties.d.ts.map +0 -1
- package/mjs/dotnet/NugetRegistryInfo.d.ts +0 -384
- package/mjs/dotnet/NugetRegistryInfo.d.ts.map +0 -1
- package/mjs/dotnet/helpers.d.ts +0 -63
- package/mjs/dotnet/helpers.d.ts.map +0 -1
- package/mjs/dotnet/index.d.ts +0 -9
- package/mjs/dotnet/index.d.ts.map +0 -1
- package/mjs/dotnet/index.mjs.map +0 -1
- package/mjs/dotnet.d.ts +0 -2
- package/mjs/dotnet.d.ts.map +0 -1
- package/mjs/dotnet.mjs.map +0 -1
- package/mjs/eslintConfig.d.ts +0 -4
- package/mjs/eslintConfig.d.ts.map +0 -1
- package/mjs/index.d.ts +0 -3
- package/mjs/index.d.ts.map +0 -1
- package/mjs/index.mjs.map +0 -1
- package/mjs/insertPlugins.d.ts +0 -18
- package/mjs/insertPlugins.d.ts.map +0 -1
- package/mjs/semantic-release__commit-analyzer.d.mjs +0 -2
- package/mjs/semantic-release__commit-analyzer.d.mjs.map +0 -1
- package/mjs/semantic-release__exec.d.mjs +0 -2
- package/mjs/semantic-release__exec.d.mjs.map +0 -1
- package/mjs/semantic-release__git.d.mjs +0 -2
- package/mjs/semantic-release__git.d.mjs.map +0 -1
- package/mjs/semantic-release__github.d.mjs +0 -2
- package/mjs/semantic-release__github.d.mjs.map +0 -1
- package/mjs/semanticReleaseConfig.d.ts +0 -97
- package/mjs/semanticReleaseConfig.d.ts.map +0 -1
- package/mjs/semanticReleaseConfigDotnet.d.ts +0 -112
- package/mjs/semanticReleaseConfigDotnet.d.ts.map +0 -1
- package/mjs/setupGitPluginSpec.d.ts +0 -22
- package/mjs/setupGitPluginSpec.d.ts.map +0 -1
- package/mjs/utils/Exact.d.ts +0 -20
- package/mjs/utils/Exact.d.ts.map +0 -1
- package/mjs/utils/GracefulRecursion.d.mjs +0 -2
- package/mjs/utils/GracefulRecursion.d.mjs.map +0 -1
- package/mjs/utils/env.d.ts +0 -24
- package/mjs/utils/env.d.ts.map +0 -1
- package/mjs/utils/execAsync.d.ts +0 -37
- package/mjs/utils/execAsync.d.ts.map +0 -1
- package/mjs/utils/isError.d.ts +0 -11
- package/mjs/utils/isError.d.ts.map +0 -1
- package/mjs/utils/miscTypes.d.ts +0 -12
- package/mjs/utils/miscTypes.d.ts.map +0 -1
- package/mjs/utils/reflection/FunctionLike.d.mjs +0 -2
- package/mjs/utils/reflection/FunctionLike.d.mjs.map +0 -1
- package/mjs/utils/reflection/GetterDescriptor.d.mjs +0 -2
- package/mjs/utils/reflection/GetterDescriptor.d.mjs.map +0 -1
- package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mjs +0 -2
- package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mjs.map +0 -1
- package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mjs +0 -2
- package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mjs.map +0 -1
- package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mjs +0 -2
- package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mjs.map +0 -1
- package/mjs/utils/reflection/OwnKeyOf.d.mjs +0 -2
- package/mjs/utils/reflection/OwnKeyOf.d.mjs.map +0 -1
- package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mjs +0 -2
- package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mjs.map +0 -1
- package/mjs/utils/reflection/PropertyDescriptorMap.d.mjs +0 -2
- package/mjs/utils/reflection/PropertyDescriptorMap.d.mjs.map +0 -1
- package/mjs/utils/reflection/filterForGetters.d.ts +0 -7
- package/mjs/utils/reflection/filterForGetters.d.ts.map +0 -1
- package/mjs/utils/reflection/getOwnPropertyDescriptors.d.ts +0 -22
- package/mjs/utils/reflection/getOwnPropertyDescriptors.d.ts.map +0 -1
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.ts +0 -56
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.ts.map +0 -1
- package/mjs/utils/reflection/getPrototypeChainOf.d.ts +0 -16
- package/mjs/utils/reflection/getPrototypeChainOf.d.ts.map +0 -1
- package/mjs/utils/reflection/getPrototypeOf.d.ts +0 -8
- package/mjs/utils/reflection/getPrototypeOf.d.ts.map +0 -1
- package/mjs/utils/reflection/inheritance.d.ts +0 -180
- package/mjs/utils/reflection/inheritance.d.ts.map +0 -1
- package/mjs/utils/reflection/isConstructor.d.ts +0 -17
- package/mjs/utils/reflection/isConstructor.d.ts.map +0 -1
- package/mjs/utils/reflection/isGetterDescriptor.d.ts +0 -9
- package/mjs/utils/reflection/isGetterDescriptor.d.ts.map +0 -1
- package/mjs/utils/reflection/listOwnGetters.d.ts +0 -26
- package/mjs/utils/reflection/listOwnGetters.d.ts.map +0 -1
- package/mjs/utils/reflection.d.ts +0 -18
- package/mjs/utils/reflection.d.ts.map +0 -1
- package/mjs/utils/reflection.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Exact.d.mts","names":[],"sources":["../../src/utils/Exact.ts"],"mappings":";;AASA;;;;;;;;KAAY,KAAA,gBAAqB,CAAA,iBAAkB,CAAA,KAC9C,CAAA,WAAY,CAAA,kBAAmB,CAAA,GAAI,CAAA,CAAE,CAAA,MAAO,CAAA,iBAC/B,CAAA,IAAK,CAAA,eAAgB,CAAA,WAAY,CAAA,GAAI,SAAA,aAAsB,MAAA,CAAO,CAAA;AAAA,UA2B1E,SAAA;EAAA,CAAsB,YAAA,GAAe,OAAA;AAAA;AAAA,KAG1C,MAAA,SAAe,CAAA"}
|
package/mjs/utils/Exact.mjs
CHANGED
|
@@ -1,75 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* [issue](https://github.com/microsoft/TypeScript/issues/12936#issuecomment-2816928183)\
|
|
5
|
-
* [author](https://github.com/ahrjarrett)\
|
|
6
|
-
* license: unlicensed[!]
|
|
7
|
-
* @see
|
|
8
|
-
* - {@link https://tsplay.dev/NnGG6m}
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line jsdoc/require-jsdoc, @typescript-eslint/no-unused-vars
|
|
12
|
-
function exact(x, _y) {
|
|
13
|
-
return x;
|
|
14
|
-
}
|
|
15
|
-
;
|
|
16
|
-
|
|
17
|
-
// should succeed
|
|
18
|
-
exact({
|
|
19
|
-
a: 1
|
|
20
|
-
}, {
|
|
21
|
-
a: 1
|
|
22
|
-
});
|
|
23
|
-
exact({
|
|
24
|
-
a: 1,
|
|
25
|
-
b: 'two'
|
|
26
|
-
}, {
|
|
27
|
-
a: 1,
|
|
28
|
-
b: 'two'
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// should raise a TypeError
|
|
32
|
-
try {
|
|
33
|
-
// @ts-expect-error Type 'boolean' is not assignable to type 'TypeError<"Excess: 'c'">'.ts(2322)
|
|
34
|
-
exact({
|
|
35
|
-
a: 1
|
|
36
|
-
}, {
|
|
37
|
-
a: 1,
|
|
38
|
-
b: 'two',
|
|
39
|
-
c: false
|
|
40
|
-
});
|
|
41
|
-
} catch {/* empty */}
|
|
42
|
-
try {
|
|
43
|
-
// @ts-expect-error Type 'number' is not assignable to type 'TypeError<"Excess: 'c'">'.ts(2322)
|
|
44
|
-
exact({
|
|
45
|
-
a: 1,
|
|
46
|
-
b: 2
|
|
47
|
-
}, {
|
|
48
|
-
a: 1,
|
|
49
|
-
b: 2,
|
|
50
|
-
c: 3
|
|
51
|
-
});
|
|
52
|
-
} catch {/* empty */}
|
|
53
|
-
try {
|
|
54
|
-
// @ts-expect-error Argument of type '{ a: number; }' is not assignable to parameter of type '{ a: number; b: number; }'. Property 'b' is missing in type '{ a: number; }' but required in type '{ a: number; b: number; }'.ts(2345)
|
|
55
|
-
exact({
|
|
56
|
-
a: 1,
|
|
57
|
-
b: 2
|
|
58
|
-
}, {
|
|
59
|
-
a: 1
|
|
60
|
-
});
|
|
61
|
-
} catch {/* empty */}
|
|
62
|
-
|
|
63
|
-
// prior art: use arktype's ^^^ leading whitespace trick to avoid collisions
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
// @ts-expect-error Should error
|
|
67
|
-
exact({
|
|
68
|
-
a: 1
|
|
69
|
-
}, {
|
|
70
|
-
a: 1,
|
|
71
|
-
b: 2
|
|
72
|
-
});
|
|
73
|
-
// ^ 🚫 raises a TypeError here
|
|
74
|
-
} catch {/* empty */}
|
|
75
|
-
//# sourceMappingURL=Exact.mjs.map
|
|
1
|
+
export{};
|
|
2
|
+
//# sourceMappingURL=Exact.mjs.map
|
package/mjs/utils/Exact.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Exact.mjs","sources":["../../src/utils/Exact.ts"],"
|
|
1
|
+
{"version":3,"file":"Exact.mjs","names":[],"sources":["../../src/utils/Exact.ts"],"sourcesContent":["/**\n * ### `Exact<T, S>`\n *\n * [issue](https://github.com/microsoft/TypeScript/issues/12936#issuecomment-2816928183)\\\n * [author](https://github.com/ahrjarrett)\\\n * license: unlicensed[!]\n * @see\n * - {@link https://tsplay.dev/NnGG6m}\n */\nexport type Exact<T, S> = [keyof T] extends [keyof S]\n ? [T] extends [S] ? { [K in keyof T]: T[K] } : S\n : { [K in keyof T as K extends keyof S ? never : K]: TypeError<`Excess: '${Coerce<K>}'`> };\n\n// eslint-disable-next-line jsdoc/require-jsdoc, @typescript-eslint/no-unused-vars\nfunction exact<S, T extends Exact<T, S>>(x: S, _y: T): T {\n return x as unknown as T;\n};\n\n// should succeed\nexact({ a: 1 }, { a: 1 });\nexact({ a: 1, b: 'two' }, { a: 1, b: 'two' });\n\n// should raise a TypeError\ntry {\n // @ts-expect-error Type 'boolean' is not assignable to type 'TypeError<\"Excess: 'c'\">'.ts(2322)\n exact({ a: 1 }, { a: 1, b: 'two', c: false });\n}\ncatch { /* empty */ }\ntry {\n // @ts-expect-error Type 'number' is not assignable to type 'TypeError<\"Excess: 'c'\">'.ts(2322)\n exact({ a: 1, b: 2 }, { a: 1, b: 2, c: 3 });\n}\ncatch { /* empty */ }\ntry {\n // @ts-expect-error Argument of type '{ a: number; }' is not assignable to parameter of type '{ a: number; b: number; }'. Property 'b' is missing in type '{ a: number; }' but required in type '{ a: number; b: number; }'.ts(2345)\n exact({ a: 1, b: 2 }, { a: 1 });\n}\ncatch { /* empty */ }\ninterface TypeError<Message> { [' TypeError']: Message }\n// prior art: use arktype's ^^^ leading whitespace trick to avoid collisions\n\ntype Coerce<T> = `${T & (string | number)}`;\n\ntry {\n // @ts-expect-error Should error\n exact({ a: 1 }, { a: 1, b: 2 });\n // ^ 🚫 raises a TypeError here\n}\ncatch { /* empty */ }\n"],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/utils/GracefulRecursion.d.ts
|
|
2
|
+
// #region https://dev.to/adrien2p/mastering-recursive-types-in-typescript-handling-depth-limitations-gracefully-5f4o#a-more-robust-solution-tuplebased-increment-and-decrement-types
|
|
3
|
+
type Length<T extends unknown[]> = (T extends {
|
|
4
|
+
length: number;
|
|
5
|
+
} ? T['length'] : never) & number;
|
|
6
|
+
type TupleOf<N extends number, T extends unknown[] = []> = Length<T> extends N ? T : TupleOf<N, [...T, unknown]>;
|
|
7
|
+
type Pop<T extends unknown[]> = T extends [...infer U, unknown] ? U : never;
|
|
8
|
+
// Increment adds an element to a tuple, effectively creating N + 1
|
|
9
|
+
type Increment<N extends number> = Length<[1, ...TupleOf<N>]>;
|
|
10
|
+
// Decrement removes an element from a tuple, effectively creating N - 1
|
|
11
|
+
type Decrement<N extends number> = Length<Pop<TupleOf<N>>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Decrement, Increment, Length, Pop, TupleOf };
|
|
14
|
+
//# sourceMappingURL=GracefulRecursion.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GracefulRecursion.d.mts","names":["Length","T","length","TupleOf","N","Pop","U","Increment","Decrement"],"sources":["../../src/utils/GracefulRecursion.d.ts"],"mappings":";;KACYA,MAAAA,yBAA+BC,CAAAA;EAAYC,MAAAA;AAAAA,IAAmBD,CAAAA;AAAAA,KAC9DE,OAAAA,+CAAsDH,MAAAA,CAAOC,CAAAA,UAAWG,CAAAA,GAChFH,CAAAA,GACAE,OAAAA,CAAQC,CAAAA,MAAOH,CAAAA;AAAAA,KACPI,GAAAA,wBAA2BJ,CAAAA,iCAAkCK,CAAAA;AAAAA;AAAAA,KAE7DC,SAAAA,qBAA8BP,MAAAA,QAAcG,OAAAA,CAAQC,CAAAA;AAAAA;AAAAA,KAEpDI,SAAAA,qBAA8BR,MAAAA,CAAOK,GAAAA,CAAIF,OAAAA,CAAQC,CAAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DotenvConfigOptions, GetOptions } from "@dotenvx/dotenvx";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/env.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A thin wrapper for {@link loadDotenv}. Loads a .env file from {@link process.cwd()} with the given options (or defaults), returns the new value of {@link process.env} with optional overrides.
|
|
6
|
+
* @param [dotenvOptions] An optional {@link DotenvConfigOptions} object to pass to {@link loadDotenv}.
|
|
7
|
+
* @param [overrides] If provided, this {@link NodeJS.ProcessEnv} object is merged into the return value, overriding existing properties where overlap occurs.
|
|
8
|
+
* @returns A {@link NodeJS.ProcessEnv} object whose properties are variables loaded from the
|
|
9
|
+
* process environment, the nearest .env file, and {@link overrides} (if provided). Where
|
|
10
|
+
* overlap occurs, the later source takes priority.
|
|
11
|
+
*/
|
|
12
|
+
declare function getEnv(dotenvOptions?: DotenvConfigOptions, overrides?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
13
|
+
/**
|
|
14
|
+
* Get the value from the given env var in the current process or nearby .env file.
|
|
15
|
+
* If found in process environment, its value is returned.
|
|
16
|
+
* Else, try to get it from the nearest .env file.
|
|
17
|
+
* If NOT found, return `undefined`
|
|
18
|
+
* @param envVar The environment variable to lookup.
|
|
19
|
+
* @param [options] Options to pass to {@link get}
|
|
20
|
+
* @returns The string value of the environment variable or `undefined`.
|
|
21
|
+
* `undefined` may be returned when the variable is undefined or its string is
|
|
22
|
+
* empty, whitespace, or appears to have been converted from `null` or
|
|
23
|
+
* `undefined`.
|
|
24
|
+
*/
|
|
25
|
+
declare function getEnvVarValue(envVar: string, options?: GetOptions): string | undefined;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { getEnv, getEnvVarValue };
|
|
28
|
+
//# sourceMappingURL=env.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.mts","names":[],"sources":["../../src/utils/env.ts"],"mappings":";;;;;AAuBA;;;;;;iBAAgB,MAAA,CAAO,aAAA,GAAgB,mBAAA,EAAqB,SAAA,GAAY,MAAA,CAAO,UAAA,GAAa,MAAA,CAAO,UAAA;;;;;;;;;;;AAqBnG;;iBAAgB,cAAA,CAAe,MAAA,UAAgB,OAAA,GAAU,UAAA"}
|
package/mjs/utils/env.mjs
CHANGED
|
@@ -1,47 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// I hate importing CommonJS modules with their broken default exports
|
|
5
|
-
const get = dotenvx.get,
|
|
6
|
-
loadDotenv = dotenvx.config;
|
|
7
|
-
|
|
8
|
-
/** `get` can return `undefined`. It can also return a `Record`, but that's internal. */
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* A thin wrapper for {@link loadDotenv}. Loads a .env file from {@link process.cwd()} with the given options (or defaults), returns the new value of {@link process.env} with optional overrides.
|
|
12
|
-
* @param [dotenvOptions] An optional {@link DotenvConfigOptions} object to pass to {@link loadDotenv}.
|
|
13
|
-
* @param [overrides] If provided, this {@link NodeJS.ProcessEnv} object is merged into the return value, overriding existing properties where overlap occurs.
|
|
14
|
-
* @returns A {@link NodeJS.ProcessEnv} object whose properties are variables loaded from the
|
|
15
|
-
* process environment, the nearest .env file, and {@link overrides} (if provided). Where
|
|
16
|
-
* overlap occurs, the later source takes priority.
|
|
17
|
-
*/
|
|
18
|
-
function getEnv(dotenvOptions, overrides) {
|
|
19
|
-
loadDotenv(dotenvOptions);
|
|
20
|
-
if (overrides) Object.assign(env, overrides);
|
|
21
|
-
return env;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Get the value from the given env var in the current process or nearby .env file.
|
|
26
|
-
* If found in process environment, its value is returned.
|
|
27
|
-
* Else, try to get it from the nearest .env file.
|
|
28
|
-
* If NOT found, return `undefined`
|
|
29
|
-
* @param envVar The environment variable to lookup.
|
|
30
|
-
* @param [options] Options to pass to {@link get}
|
|
31
|
-
* @returns The string value of the environment variable or `undefined`.
|
|
32
|
-
* `undefined` may be returned when the variable is undefined or its string is
|
|
33
|
-
* empty, whitespace, or appears to have been converted from `null` or
|
|
34
|
-
* `undefined`.
|
|
35
|
-
*/
|
|
36
|
-
function getEnvVarValue(envVar, options) {
|
|
37
|
-
options ??= {
|
|
38
|
-
ignore: ['MISSING_KEY', 'MISSING_ENV_FILE']
|
|
39
|
-
};
|
|
40
|
-
let value = env[envVar];
|
|
41
|
-
const x = get(envVar, options);
|
|
42
|
-
if (typeof x === 'string') value = x;
|
|
43
|
-
// I hate this. Why is undefined converted to a string?
|
|
44
|
-
return value === '' || value === 'undefined' ? undefined : value;
|
|
45
|
-
}
|
|
46
|
-
export { getEnv, getEnvVarValue };
|
|
47
|
-
//# sourceMappingURL=env.mjs.map
|
|
1
|
+
import{env as e}from"node:process";import t from"@dotenvx/dotenvx";const{get:n,config:r}=t;function i(t,n){return r(t),n&&Object.assign(e,n),e}function a(t,r){r??={ignore:[`MISSING_KEY`,`MISSING_ENV_FILE`]};let i=e[t],a=n(t,r);return typeof a==`string`&&(i=a),i===``||i===`undefined`?void 0:i}export{i as getEnv,a as getEnvVarValue};
|
|
2
|
+
//# sourceMappingURL=env.mjs.map
|
package/mjs/utils/env.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.mjs","sources":["../../src/utils/env.ts"],"
|
|
1
|
+
{"version":3,"file":"env.mjs","names":[],"sources":["../../src/utils/env.ts"],"sourcesContent":["import dotenvx, {\n type DotenvConfigOptions,\n type GetOptions,\n} from '@dotenvx/dotenvx';\nimport { env } from 'node:process';\n\n// I hate importing CommonJS modules with their broken default exports\nconst {\n get,\n config: loadDotenv,\n} = dotenvx;\n\n/** `get` can return `undefined`. It can also return a `Record`, but that's internal. */\ntype Get = (key: string, options?: GetOptions) => string | undefined;\n\n/**\n * A thin wrapper for {@link loadDotenv}. Loads a .env file from {@link process.cwd()} with the given options (or defaults), returns the new value of {@link process.env} with optional overrides.\n * @param [dotenvOptions] An optional {@link DotenvConfigOptions} object to pass to {@link loadDotenv}.\n * @param [overrides] If provided, this {@link NodeJS.ProcessEnv} object is merged into the return value, overriding existing properties where overlap occurs.\n * @returns A {@link NodeJS.ProcessEnv} object whose properties are variables loaded from the\n * process environment, the nearest .env file, and {@link overrides} (if provided). Where\n * overlap occurs, the later source takes priority.\n */\nexport function getEnv(dotenvOptions?: DotenvConfigOptions, overrides?: NodeJS.ProcessEnv): NodeJS.ProcessEnv {\n loadDotenv(dotenvOptions);\n\n if (overrides)\n Object.assign(env, overrides);\n\n return env;\n}\n\n/**\n * Get the value from the given env var in the current process or nearby .env file.\n * If found in process environment, its value is returned.\n * Else, try to get it from the nearest .env file.\n * If NOT found, return `undefined`\n * @param envVar The environment variable to lookup.\n * @param [options] Options to pass to {@link get}\n * @returns The string value of the environment variable or `undefined`.\n * `undefined` may be returned when the variable is undefined or its string is\n * empty, whitespace, or appears to have been converted from `null` or\n * `undefined`.\n */\nexport function getEnvVarValue(envVar: string, options?: GetOptions): string | undefined {\n options ??= { ignore: ['MISSING_KEY', 'MISSING_ENV_FILE'] };\n let value = env[envVar];\n const x = (get as Get)(envVar, options);\n if (typeof x === 'string')\n value = x;\n // I hate this. Why is undefined converted to a string?\n return value === '' || value === 'undefined'\n ? undefined\n : value;\n}\n"],"mappings":"mEAOA,KAAM,CACJ,MACA,OAAQ,GACN,EAaJ,SAAgB,EAAO,EAAqC,EAAkD,CAM5G,OALA,EAAW,EAAc,CAErB,GACF,OAAO,OAAO,EAAK,EAAU,CAExB,EAeT,SAAgB,EAAe,EAAgB,EAA0C,CACvF,IAAY,CAAE,OAAQ,CAAC,cAAe,mBAAmB,CAAE,CAC3D,IAAI,EAAQ,EAAI,GACV,EAAK,EAAY,EAAQ,EAAQ,CAIvC,OAHI,OAAO,GAAM,WACf,EAAQ,GAEH,IAAU,IAAM,IAAU,YAC7B,IAAA,GACA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Type } from "arktype";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/execAsync.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A `promisify(exec)` wrapper to optionally assign the child process's STDERR as the {@link Error.prototype.cause}.
|
|
6
|
+
* @see {@link promisify}, {@link exec}
|
|
7
|
+
* @param command The command to run, with space-separated arguments.
|
|
8
|
+
* @param [setStderrAsCause=false] If true and the child process's stderr is available, the thrown Error's {@link Error.prototype.cause} is assigned the stderr string.
|
|
9
|
+
* @returns A promise of the child process's STDOUT and STDERR streams as strings
|
|
10
|
+
* @throws {Error | ChildProcessSpawnException}
|
|
11
|
+
*/
|
|
12
|
+
declare function execAsync(command: string, setStderrAsCause?: boolean): Promise<{
|
|
13
|
+
stdout: string;
|
|
14
|
+
stderr: string;
|
|
15
|
+
}>;
|
|
16
|
+
declare const T_ExecException: Type<{
|
|
17
|
+
name: string;
|
|
18
|
+
message: string;
|
|
19
|
+
stack?: string | undefined;
|
|
20
|
+
cause?: unknown;
|
|
21
|
+
cmd?: string | null | undefined;
|
|
22
|
+
killed?: boolean | null | undefined;
|
|
23
|
+
code?: number | null | undefined;
|
|
24
|
+
signal?: "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO" | null | undefined;
|
|
25
|
+
stdout?: string | undefined;
|
|
26
|
+
stderr?: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
type _ExecException = typeof T_ExecException.inferOut;
|
|
29
|
+
declare class ChildProcessSpawnException extends Error implements _ExecException {
|
|
30
|
+
constructor(message: Parameters<typeof Error>[0], options: typeof T_ExecException.inferIn);
|
|
31
|
+
cmd: typeof T_ExecException.inferOut.cmd;
|
|
32
|
+
code: typeof T_ExecException.inferOut.code;
|
|
33
|
+
killed: typeof T_ExecException.inferOut.killed;
|
|
34
|
+
signal: typeof T_ExecException.inferOut.signal;
|
|
35
|
+
stderr: typeof T_ExecException.inferOut.stderr;
|
|
36
|
+
stdout: typeof T_ExecException.inferOut.stdout;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { ChildProcessSpawnException, execAsync };
|
|
40
|
+
//# sourceMappingURL=execAsync.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execAsync.d.mts","names":[],"sources":["../../src/utils/execAsync.ts"],"mappings":";;;;;AAeA;;;;;;iBAAsB,SAAA,CAAU,OAAA,UAAiB,gBAAA,aAA2B,OAAA;EAC1E,MAAA;EACA,MAAA;AAAA;AAAA,cAwBI,eAAA,EAAiB,IAAA;EACrB,IAAA;EACA,OAAA;EACA,KAAA;EACA,KAAA;EACA,GAAA;EACA,MAAA;EACA,IAAA;EACA,MAAA;EACA,MAAA;EACA,MAAA;AAAA;AAAA,KAaG,cAAA,UAAwB,eAAA,CAAgB,QAAA;AAAA,cAEhC,0BAAA,SAAmC,KAAA,YAAiB,cAAA;EAC/D,WAAA,CACE,OAAA,EAAS,UAAA,QAAkB,KAAA,MAC3B,OAAA,SAAgB,eAAA,CAAgB,OAAA;EAYlC,GAAA,SAAY,eAAA,CAAgB,QAAA,CAAS,GAAA;EACrC,IAAA,SAAa,eAAA,CAAgB,QAAA,CAAS,IAAA;EACtC,MAAA,SAAe,eAAA,CAAgB,QAAA,CAAS,MAAA;EACxC,MAAA,SAAe,eAAA,CAAgB,QAAA,CAAS,MAAA;EACxC,MAAA,SAAe,eAAA,CAAgB,QAAA,CAAS,MAAA;EACxC,MAAA,SAAe,eAAA,CAAgB,QAAA,CAAS,MAAA;AAAA"}
|
package/mjs/utils/execAsync.mjs
CHANGED
|
@@ -1,59 +1,10 @@
|
|
|
1
|
-
import { type } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* @see {@link promisify}, {@link exec}
|
|
12
|
-
* @param command The command to run, with space-separated arguments.
|
|
13
|
-
* @param [setStderrAsCause=false] If true and the child process's stderr is available, the thrown Error's {@link Error.prototype.cause} is assigned the stderr string.
|
|
14
|
-
* @returns A promise of the child process's STDOUT and STDERR streams as strings
|
|
15
|
-
* @throws {Error | ChildProcessSpawnException}
|
|
16
|
-
*/
|
|
17
|
-
async function execAsync(command, setStderrAsCause = false) {
|
|
18
|
-
return await promisify(exec)(command).catch(error => {
|
|
19
|
-
if (!isError(error)) throw new Error(JSON.stringify(error));
|
|
20
|
-
if (setStderrAsCause && 'stderr' in error && typeof error.stderr === 'string' && error.stderr !== '') error.cause ??= error.stderr;
|
|
21
|
-
if ('stdout' in error && typeof error.stdout === 'string') {
|
|
22
|
-
error.message += '\nSTDOUT:\n' + ` ${error.stdout.replaceAll('\n', '\n ')}`;
|
|
23
|
-
}
|
|
24
|
-
if ('stderr' in error && typeof error.stderr === 'string') {
|
|
25
|
-
error.message += '\nSTDERR:\n' + ` ${error.stderr.replaceAll('\n', '\n ')}`;
|
|
26
|
-
}
|
|
27
|
-
throw new ChildProcessSpawnException(error.message, error);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
const T_ExecException = type('Error').and({
|
|
31
|
-
'cmd?': 'string | null',
|
|
32
|
-
'killed?': 'boolean | null',
|
|
33
|
-
'code?': 'number | null',
|
|
34
|
-
'signal?': type.null.or(Object.keys(constants.signals).map(v => type(`'${v}'`))
|
|
35
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
|
36
|
-
.reduce((previous, current) => previous.or(current))),
|
|
37
|
-
'stdout?': 'string',
|
|
38
|
-
'stderr?': 'string'
|
|
39
|
-
});
|
|
40
|
-
class ChildProcessSpawnException extends Error {
|
|
41
|
-
constructor(message, options) {
|
|
42
|
-
options = T_ExecException.from(options);
|
|
43
|
-
super(message, options);
|
|
44
|
-
this.cmd = options.cmd;
|
|
45
|
-
this.code = options.code;
|
|
46
|
-
this.killed = options.killed;
|
|
47
|
-
this.signal = options.signal;
|
|
48
|
-
this.stderr = options.stderr;
|
|
49
|
-
this.stdout = options.stdout;
|
|
50
|
-
}
|
|
51
|
-
cmd;
|
|
52
|
-
code;
|
|
53
|
-
killed;
|
|
54
|
-
signal;
|
|
55
|
-
stderr;
|
|
56
|
-
stdout;
|
|
57
|
-
}
|
|
58
|
-
export { ChildProcessSpawnException, execAsync };
|
|
59
|
-
//# sourceMappingURL=execAsync.mjs.map
|
|
1
|
+
import{isError as e}from"./isError.mjs";import{promisify as t}from"node:util";import{type as n}from"arktype";import{exec as r}from"node:child_process";import{constants as i}from"node:os";async function a(n,i=!1){return await t(r)(n).catch(t=>{throw e(t)?(i&&`stderr`in t&&typeof t.stderr==`string`&&t.stderr!==``&&(t.cause??=t.stderr),`stdout`in t&&typeof t.stdout==`string`&&(t.message+=`
|
|
2
|
+
STDOUT:
|
|
3
|
+
${t.stdout.replaceAll(`
|
|
4
|
+
`,`
|
|
5
|
+
`)}`),`stderr`in t&&typeof t.stderr==`string`&&(t.message+=`
|
|
6
|
+
STDERR:
|
|
7
|
+
${t.stderr.replaceAll(`
|
|
8
|
+
`,`
|
|
9
|
+
`)}`),new s(t.message,t)):Error(JSON.stringify(t))})}const o=n(`Error`).and({"cmd?":`string | null`,"killed?":`boolean | null`,"code?":`number | null`,"signal?":n.null.or(Object.keys(i.signals).map(e=>n(`'${e}'`)).reduce((e,t)=>e.or(t))),"stdout?":`string`,"stderr?":`string`});var s=class extends Error{constructor(e,t){t=o.from(t),super(e,t),this.cmd=t.cmd,this.code=t.code,this.killed=t.killed,this.signal=t.signal,this.stderr=t.stderr,this.stdout=t.stdout}cmd;code;killed;signal;stderr;stdout};export{s as ChildProcessSpawnException,a as execAsync};
|
|
10
|
+
//# sourceMappingURL=execAsync.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execAsync.mjs","sources":["../../src/utils/execAsync.ts"],"
|
|
1
|
+
{"version":3,"file":"execAsync.mjs","names":[],"sources":["../../src/utils/execAsync.ts"],"sourcesContent":["/* eslint-disable jsdoc/no-defaults */\nimport { type, type Type } from 'arktype';\nimport { exec } from 'node:child_process';\nimport { constants } from 'node:os';\nimport { promisify } from 'node:util';\nimport { isError } from './isError.ts';\n\n/**\n * A `promisify(exec)` wrapper to optionally assign the child process's STDERR as the {@link Error.prototype.cause}.\n * @see {@link promisify}, {@link exec}\n * @param command The command to run, with space-separated arguments.\n * @param [setStderrAsCause=false] If true and the child process's stderr is available, the thrown Error's {@link Error.prototype.cause} is assigned the stderr string.\n * @returns A promise of the child process's STDOUT and STDERR streams as strings\n * @throws {Error | ChildProcessSpawnException}\n */\nexport async function execAsync(command: string, setStderrAsCause = false): Promise<{\n stdout: string;\n stderr: string;\n}> {\n return await promisify(exec)(command).catch((error: unknown): never => {\n if (!isError(error))\n throw new Error(JSON.stringify(error));\n\n if (setStderrAsCause && 'stderr' in error && typeof error.stderr === 'string' && error.stderr !== '')\n error.cause ??= error.stderr;\n\n if ('stdout' in error && typeof error.stdout === 'string') {\n error.message\n += '\\nSTDOUT:\\n'\n + ` ${error.stdout.replaceAll('\\n', '\\n ')}`;\n }\n if ('stderr' in error && typeof error.stderr === 'string') {\n error.message\n += '\\nSTDERR:\\n'\n + ` ${error.stderr.replaceAll('\\n', '\\n ')}`;\n }\n\n throw new ChildProcessSpawnException(error.message, error);\n });\n}\n\nconst T_ExecException: Type<{\n name: string;\n message: string;\n stack?: string | undefined;\n cause?: unknown;\n cmd?: string | null | undefined;\n killed?: boolean | null | undefined;\n code?: number | null | undefined;\n signal?: 'SIGABRT' | 'SIGALRM' | 'SIGBUS' | 'SIGCHLD' | 'SIGCONT' | 'SIGFPE' | 'SIGHUP' | 'SIGILL' | 'SIGINT' | 'SIGIO' | 'SIGIOT' | 'SIGKILL' | 'SIGPIPE' | 'SIGPOLL' | 'SIGPROF' | 'SIGPWR' | 'SIGQUIT' | 'SIGSEGV' | 'SIGSTKFLT' | 'SIGSTOP' | 'SIGSYS' | 'SIGTERM' | 'SIGTRAP' | 'SIGTSTP' | 'SIGTTIN' | 'SIGTTOU' | 'SIGUNUSED' | 'SIGURG' | 'SIGUSR1' | 'SIGUSR2' | 'SIGVTALRM' | 'SIGWINCH' | 'SIGXCPU' | 'SIGXFSZ' | 'SIGBREAK' | 'SIGLOST' | 'SIGINFO' | null | undefined;\n stdout?: string | undefined;\n stderr?: string | undefined;\n}> = type('Error').and({\n 'cmd?': 'string | null',\n 'killed?': 'boolean | null',\n 'code?': 'number | null',\n 'signal?': type.null.or((Object.keys(constants.signals) as NodeJS.Signals[])\n .map(v => type(`'${v}'`))\n // eslint-disable-next-line unicorn/no-array-reduce\n .reduce((previous, current) => previous.or(current))),\n 'stdout?': 'string',\n 'stderr?': 'string',\n});\n\ntype _ExecException = typeof T_ExecException.inferOut;\n\nexport class ChildProcessSpawnException extends Error implements _ExecException {\n constructor(\n message: Parameters<typeof Error>[0],\n options: typeof T_ExecException.inferIn,\n ) {\n options = T_ExecException.from(options);\n super(message, options);\n this.cmd = options.cmd;\n this.code = options.code;\n this.killed = options.killed;\n this.signal = options.signal;\n this.stderr = options.stderr;\n this.stdout = options.stdout;\n }\n\n cmd: typeof T_ExecException.inferOut.cmd;\n code: typeof T_ExecException.inferOut.code;\n killed: typeof T_ExecException.inferOut.killed;\n signal: typeof T_ExecException.inferOut.signal;\n stderr: typeof T_ExecException.inferOut.stderr;\n stdout: typeof T_ExecException.inferOut.stdout;\n}\n"],"mappings":"2LAeA,eAAsB,EAAU,EAAiB,EAAmB,GAGjE,CACD,OAAO,MAAM,EAAU,EAAK,CAAC,EAAQ,CAAC,MAAO,GAA0B,CAkBrE,MAjBK,EAAQ,EAAM,EAGf,GAAoB,WAAY,GAAS,OAAO,EAAM,QAAW,UAAY,EAAM,SAAW,KAChG,EAAM,QAAU,EAAM,QAEpB,WAAY,GAAS,OAAO,EAAM,QAAW,WAC/C,EAAM,SACD;;IACM,EAAM,OAAO,WAAW;EAAM;IAAO,IAE9C,WAAY,GAAS,OAAO,EAAM,QAAW,WAC/C,EAAM,SACD;;IACM,EAAM,OAAO,WAAW;EAAM;IAAO,IAG5C,IAAI,EAA2B,EAAM,QAAS,EAAM,EAhB9C,MAAM,KAAK,UAAU,EAAM,CAAC,EAiBxC,CAGJ,MAAM,EAWD,EAAK,QAAQ,CAAC,IAAI,CACrB,OAAQ,gBACR,UAAW,iBACX,QAAS,gBACT,UAAW,EAAK,KAAK,GAAI,OAAO,KAAK,EAAU,QAAQ,CACpD,IAAI,GAAK,EAAK,IAAI,EAAE,GAAG,CAAC,CAExB,QAAQ,EAAU,IAAY,EAAS,GAAG,EAAQ,CAAC,CAAC,CACvD,UAAW,SACX,UAAW,SACZ,CAAC,CAIF,IAAa,EAAb,cAAgD,KAAgC,CAC9E,YACE,EACA,EACA,CACA,EAAU,EAAgB,KAAK,EAAQ,CACvC,MAAM,EAAS,EAAQ,CACvB,KAAK,IAAM,EAAQ,IACnB,KAAK,KAAO,EAAQ,KACpB,KAAK,OAAS,EAAQ,OACtB,KAAK,OAAS,EAAQ,OACtB,KAAK,OAAS,EAAQ,OACtB,KAAK,OAAS,EAAQ,OAGxB,IACA,KACA,OACA,OACA,OACA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/utils/isError.d.ts
|
|
2
|
+
/** @import 'typescript/lib/lib.esnext.error.d.ts' */
|
|
3
|
+
/**
|
|
4
|
+
* Compatibility wrapper for ES2026 (Node.js 25)
|
|
5
|
+
* {@link Error.isError Error.isError}
|
|
6
|
+
* with failover to the deprecated {@link isNativeError utils.types.isNativeError}.
|
|
7
|
+
* @param error A parameter which may be an Error.
|
|
8
|
+
* @returns `true` if {@link error} is derived from or is sufficiently similar to {@link Error}. Else, `false`.
|
|
9
|
+
* Note: DOMExceptions will result in `false`
|
|
10
|
+
*/
|
|
11
|
+
declare function isError(error: unknown): error is Error;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { isError };
|
|
14
|
+
//# sourceMappingURL=isError.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isError.d.mts","names":[],"sources":["../../src/utils/isError.ts"],"mappings":";;AAYA;;;;;;;;AAAA,iBAAgB,OAAA,CAAQ,KAAA,YAAiB,KAAA,IAAS,KAAA"}
|
package/mjs/utils/isError.mjs
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
/** @import 'typescript/lib/lib.esnext.error.d.ts' */
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Compatibility wrapper for ES2026 (Node.js 25)
|
|
7
|
-
* {@link Error.isError Error.isError}
|
|
8
|
-
* with failover to the deprecated {@link isNativeError utils.types.isNativeError}.
|
|
9
|
-
* @param error A parameter which may be an Error.
|
|
10
|
-
* @returns `true` if {@link error} is derived from or is sufficiently similar to {@link Error}. Else, `false`.
|
|
11
|
-
* Note: DOMExceptions will result in `false`
|
|
12
|
-
*/
|
|
13
|
-
function isError(error) {
|
|
14
|
-
return 'isError' in Error && typeof Error.isError === 'function' && Error.isError.length > 0 ? Error.isError(error)
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
16
|
-
: isNativeError(error);
|
|
17
|
-
}
|
|
18
|
-
export { isError };
|
|
19
|
-
//# sourceMappingURL=isError.mjs.map
|
|
1
|
+
import{isNativeError as e}from"node:util/types";function t(t){return`isError`in Error&&typeof Error.isError==`function`&&Error.isError.length>0?Error.isError(t):e(t)}export{t as isError};
|
|
2
|
+
//# sourceMappingURL=isError.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isError.mjs","sources":["../../src/utils/isError.ts"],"
|
|
1
|
+
{"version":3,"file":"isError.mjs","names":[],"sources":["../../src/utils/isError.ts"],"sourcesContent":["import { isNativeError } from 'node:util/types';\n\n/** @import 'typescript/lib/lib.esnext.error.d.ts' */\n\n/**\n * Compatibility wrapper for ES2026 (Node.js 25)\n * {@link Error.isError Error.isError}\n * with failover to the deprecated {@link isNativeError utils.types.isNativeError}.\n * @param error A parameter which may be an Error.\n * @returns `true` if {@link error} is derived from or is sufficiently similar to {@link Error}. Else, `false`.\n * Note: DOMExceptions will result in `false`\n */\nexport function isError(error: unknown): error is Error {\n return 'isError' in Error && typeof Error.isError === 'function' && Error.isError.length > 0\n ? (Error.isError as typeof isError)(error)\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n : isNativeError(error);\n}\n"],"mappings":"gDAYA,SAAgB,EAAQ,EAAgC,CACtD,MAAO,YAAa,OAAS,OAAO,MAAM,SAAY,YAAc,MAAM,QAAQ,OAAS,EACtF,MAAM,QAA2B,EAAM,CAExC,EAAc,EAAM"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Type } from "arktype";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/miscTypes.d.ts
|
|
4
|
+
declare const tBooleanString: Type<"false" | "true">;
|
|
5
|
+
type BooleanString = typeof tBooleanString.infer;
|
|
6
|
+
declare const tEmptyOrBooleanString: Type<"" | "false" | "true">;
|
|
7
|
+
type EmptyOrBooleanString = typeof tEmptyOrBooleanString.infer;
|
|
8
|
+
type Integer<N extends number> = `${N}` extends `${number}.${number}` ? never : N;
|
|
9
|
+
/**
|
|
10
|
+
* @see https://stackoverflow.com/a/73920140/14894786
|
|
11
|
+
*/
|
|
12
|
+
type TupleIndices<T extends readonly unknown[]> = Extract<keyof T, `${number}`> extends `${infer N extends number}` ? N : never;
|
|
13
|
+
type InstanceOrStatic = "Instance" | "Static";
|
|
14
|
+
//#endregion
|
|
15
|
+
export { BooleanString, EmptyOrBooleanString, InstanceOrStatic, Integer, TupleIndices, tBooleanString, tEmptyOrBooleanString };
|
|
16
|
+
//# sourceMappingURL=miscTypes.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"miscTypes.d.mts","names":[],"sources":["../../src/utils/miscTypes.ts"],"mappings":";;;cAEa,cAAA,EAAgB,IAAA;AAAA,KACjB,aAAA,UAAuB,cAAA,CAAe,KAAA;AAAA,cAErC,qBAAA,EAAuB,IAAA;AAAA,KACxB,oBAAA,UAA8B,qBAAA,CAAsB,KAAA;AAAA,KAEpD,OAAA,wBAA+B,CAAA,2CAA4C,CAAA;;;AALvF;KAUY,YAAA,iCACR,OAAA,OAAc,CAAA,qDAAsD,CAAA;AAAA,KAE5D,gBAAA"}
|
package/mjs/utils/miscTypes.mjs
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const tEmptyOrBooleanString = type(tBooleanString.or('""'));
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @see https://stackoverflow.com/a/73920140/14894786
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export { tBooleanString, tEmptyOrBooleanString };
|
|
10
|
-
//# sourceMappingURL=miscTypes.mjs.map
|
|
1
|
+
import{type as e}from"arktype";const t=e(`"true" | "false"`),n=e(t.or(`""`));export{t as tBooleanString,n as tEmptyOrBooleanString};
|
|
2
|
+
//# sourceMappingURL=miscTypes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"miscTypes.mjs","sources":["../../src/utils/miscTypes.ts"],"
|
|
1
|
+
{"version":3,"file":"miscTypes.mjs","names":[],"sources":["../../src/utils/miscTypes.ts"],"sourcesContent":["import { type, type Type } from 'arktype';\n\nexport const tBooleanString: Type<'false' | 'true'> = type('\"true\" | \"false\"');\nexport type BooleanString = typeof tBooleanString.infer;\n\nexport const tEmptyOrBooleanString: Type<'' | 'false' | 'true'> = type(tBooleanString.or('\"\"'));\nexport type EmptyOrBooleanString = typeof tEmptyOrBooleanString.infer;\n\nexport type Integer<N extends number> = `${N}` extends `${number}.${number}` ? never : N;\n\n/**\n * @see https://stackoverflow.com/a/73920140/14894786\n */\nexport type TupleIndices<T extends readonly unknown[]>\n = Extract<keyof T, `${number}`> extends `${infer N extends number}` ? N : never;\n\nexport type InstanceOrStatic = 'Instance' | 'Static';\n"],"mappings":"+BAEA,MAAa,EAAyC,EAAK,mBAAmB,CAGjE,EAAqD,EAAK,EAAe,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/utils/reflection/FunctionLike.d.ts
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
/**
|
|
4
|
+
* A generic alternative to the boxing {@link Function} type. Based on the
|
|
5
|
+
* expressions of {@link Parameters} and {@link ReturnType}.
|
|
6
|
+
* @template [T=((...args: any[] | readonly any[]) => any)] Any function-like type.
|
|
7
|
+
* @template [P=Parameters<T>]
|
|
8
|
+
* [INTERNAL] The parameters of {@link T}.
|
|
9
|
+
* @template [R=ReturnType<T>]
|
|
10
|
+
* [INTERNAL] The return type of {@link T}.
|
|
11
|
+
* @default ((...args: any[] | readonly any[]) => any)
|
|
12
|
+
* @since 3.0.0
|
|
13
|
+
*/
|
|
14
|
+
type FunctionLike<T extends ((...args: any[] | readonly any[]) => any) = ((...args: any[] | readonly any[]) => any), P extends Parameters<T> = Parameters<T>, R extends ReturnType<T> = ReturnType<T>> = T & ((...args: P) => R);
|
|
15
|
+
//#endregion
|
|
16
|
+
export { FunctionLike };
|
|
17
|
+
//# sourceMappingURL=FunctionLike.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FunctionLike.d.mts","names":["FunctionLike","T","P","R","Parameters","ReturnType","args"],"sources":["../../../src/utils/reflection/FunctionLike.d.ts"],"mappings":";;AAYA;;;;;;;;;;;AAAA,KAAYA,YAAAA,gBACKM,IAAAA,yCAA6CA,IAAAA,6CAClDF,UAAAA,CAAWH,CAAAA,IAAKG,UAAAA,CAAWH,CAAAA,aAC3BI,UAAAA,CAAWJ,CAAAA,IAAKI,UAAAA,CAAWJ,CAAAA,KACnCA,CAAAA,QAASK,IAAAA,EAAMJ,CAAAA,KAAMC,CAAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/utils/reflection/GetterDescriptor.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A type for casting a property descriptor to a getter descriptor.\
|
|
4
|
+
* Cast to this only after checking `typeof propertyDescriptor.get === 'function`
|
|
5
|
+
* @template [T=unknown] The type of the property.
|
|
6
|
+
* @since 4.0.0
|
|
7
|
+
*/
|
|
8
|
+
type GetterDescriptor<T = unknown> = Omit<TypedPropertyDescriptor<T>, 'get'> & Required<Pick<TypedPropertyDescriptor<T>, 'get'>>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { GetterDescriptor };
|
|
11
|
+
//# sourceMappingURL=GetterDescriptor.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetterDescriptor.d.mts","names":["GetterDescriptor","T","TypedPropertyDescriptor","Omit","Pick","Required"],"sources":["../../../src/utils/reflection/GetterDescriptor.d.ts"],"mappings":";;AAMA;;;;;KAAYA,gBAAAA,gBAAgCG,IAAAA,CAAKD,uBAAAA,CAAwBD,CAAAA,YACrEI,QAAAA,CAASD,IAAAA,CAAKF,uBAAAA,CAAwBD,CAAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PropertyDescriptorMap } from "./PropertyDescriptorMap.mjs";
|
|
2
|
+
import { BaseClassProto, ConstructorConstraint, InstanceTypeOrSelf, SuperClassLike, WithProto } from "./inheritance.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/reflection/InstancePropertyDescriptorMap.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Generically-typed return type of `Object.GetOwnPropertyDescriptors` for class
|
|
7
|
+
* instances.
|
|
8
|
+
*
|
|
9
|
+
* Allows for statically-inferred property keys and values.
|
|
10
|
+
*
|
|
11
|
+
* Classes' `public` members are returned, including instance Getters and
|
|
12
|
+
* Setters.
|
|
13
|
+
* @template Class
|
|
14
|
+
* Any class type with its `[[Prototype]]` attached via a type-only `__proto__` property.
|
|
15
|
+
* The type of `__proto__` must extend {@link SuperClassLike} or {@link BaseClassProto}.
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const { NugetProjectProperties: NPP } = await import('../dotnet/NugetProjectProperties.js');
|
|
19
|
+
* const _instanceMembers: InstancePropertyDescriptorMap<typeof NPP> = Object.getOwnPropertyDescriptors(new NugetProjectProperties('',new CaseInsensitiveMap([['','']])));
|
|
20
|
+
* ```
|
|
21
|
+
* @since 3.0.0
|
|
22
|
+
*/
|
|
23
|
+
type InstancePropertyDescriptorMap<Class extends ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>> = Class['__proto__'] extends BaseClassProto ? PropertyDescriptorMap<InstanceType<Class>> : PropertyDescriptorMap<InstanceType<Class>, InstanceTypeOrSelf<Class['__proto__']>>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { InstancePropertyDescriptorMap };
|
|
26
|
+
//# sourceMappingURL=InstancePropertyDescriptorMap.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstancePropertyDescriptorMap.d.mts","names":["PropertyDescriptorMap","BaseClassProto","ConstructorConstraint","InstanceTypeOrSelf","SuperClassLike","WithProto","InstancePropertyDescriptorMap","Class","InstanceType"],"sources":["../../../src/utils/reflection/InstancePropertyDescriptorMap.d.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;KA2BYM,6BAAAA,eACIJ,qBAAAA,CAAsBK,KAAAA,IAASF,SAAAA,CAAUD,cAAAA,GAAiBH,cAAAA,KACtEM,KAAAA,sBAA2BN,cAAAA,GAC3BD,qBAAAA,CAAsBQ,YAAAA,CAAaD,KAAAA,KACnCP,qBAAAA,CAAsBQ,YAAAA,CAAaD,KAAAA,GAAQJ,kBAAAA,CAAmBI,KAAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PropertyDescriptorMap } from "./PropertyDescriptorMap.mjs";
|
|
2
|
+
import { BaseClassProto, ConstructorLike, InstanceTypeOrSelf, ProtoOrSuperClass, SuperClassLike, WithProto } from "./inheritance.mjs";
|
|
3
|
+
import { InstancePropertyDescriptorMap } from "./InstancePropertyDescriptorMap.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Variant of {@link InstancePropertyDescriptorMap} with a lesser constraint on {@link T}.
|
|
8
|
+
* If {@link T} and/or {@link __proto__} are instantiable, the resulting
|
|
9
|
+
* property descriptor maps will be of the instances' types.
|
|
10
|
+
* @template T `null` or an `object`-like type.
|
|
11
|
+
* @template __proto__ The `[[Prototype]]` of {@link T}.
|
|
12
|
+
* @since 3.0.0
|
|
13
|
+
*/
|
|
14
|
+
type InstanceTypeOrSelfPropertyDescriptorMap<T extends object | null, __proto__ extends ProtoOrSuperClass> = T extends ConstructorLike<T> ? __proto__ extends SuperClassLike | BaseClassProto ? InstancePropertyDescriptorMap<T & WithProto<__proto__>> : PropertyDescriptorMap<InstanceType<T>, InstanceTypeOrSelf<__proto__>> : PropertyDescriptorMap<InstanceTypeOrSelf<T>, InstanceTypeOrSelf<__proto__>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { InstanceTypeOrSelfPropertyDescriptorMap };
|
|
17
|
+
//# sourceMappingURL=InstanceTypeOrSelfPropertyDescriptorMap.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstanceTypeOrSelfPropertyDescriptorMap.d.mts","names":["BaseClassProto","ConstructorLike","InstanceTypeOrSelf","ProtoOrSuperClass","SuperClassLike","WithProto","InstancePropertyDescriptorMap","PropertyDescriptorMap","InstanceTypeOrSelfPropertyDescriptorMap","T","__proto__","InstanceType"],"sources":["../../../src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts"],"mappings":";;;;;;AAYA;;;;;;;KAAYQ,uCAAAA,4CAEQL,iBAAAA,IAChBM,CAAAA,SAAUR,eAAAA,CAAgBQ,CAAAA,IAC1BC,SAAAA,SAAkBN,cAAAA,GAAiBJ,cAAAA,GACjCM,6BAAAA,CAA8BG,CAAAA,GAAIJ,SAAAA,CAAUK,SAAAA,KAC5CH,qBAAAA,CAAsBI,YAAAA,CAAaF,CAAAA,GAAIP,kBAAAA,CAAmBQ,SAAAA,KAC5DH,qBAAAA,CAAsBL,kBAAAA,CAAmBO,CAAAA,GAAIP,kBAAAA,CAAmBQ,SAAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GetterDescriptor } from "./GetterDescriptor.mjs";
|
|
2
|
+
import { OwnKeyOf } from "./OwnKeyOf.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/reflection/OwnGetterDescriptorMap.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* # !WARNING!
|
|
7
|
+
* > This does _not_ filter out non-getter properties! ALL properties are treated as getters. Because `get` is optional and present on all property descriptors, this type should only be used to cast properties for which `typeof p.get === 'function'`.
|
|
8
|
+
*
|
|
9
|
+
* A {@link GetterDescriptorMap} variant for omitting keys inherited from {@link __proto__}.
|
|
10
|
+
* Note: If `T` is `InstanceOf<class>`, then `__proto__` must be `InstanceTypeOrSelf<__proto__>`
|
|
11
|
+
* @template T The type the descriptor map describes.
|
|
12
|
+
* @template __proto__ The `[[Prototype]]` of {@link T}. Keys of {@link __proto__} are omitted from the descriptor map type.
|
|
13
|
+
* @since 3.0.0
|
|
14
|
+
*/
|
|
15
|
+
type OwnGetterDescriptorMap<T, __proto__ extends object | null> = { [P in OwnKeyOf<T, __proto__>]: GetterDescriptor<T[P]> };
|
|
16
|
+
//#endregion
|
|
17
|
+
export { OwnGetterDescriptorMap };
|
|
18
|
+
//# sourceMappingURL=OwnGetterDescriptorMap.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwnGetterDescriptorMap.d.mts","names":["GetterDescriptor","OwnKeyOf","OwnGetterDescriptorMap","T","__proto__","P"],"sources":["../../../src/utils/reflection/OwnGetterDescriptorMap.d.ts"],"mappings":";;;;;AAaA;;;;;;;;;KAAYE,sBAAAA,+CAGAD,QAAAA,CAASE,CAAAA,EAAGC,SAAAA,IAAaJ,gBAAAA,CAAiBG,CAAAA,CAAEE,CAAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/utils/reflection/OwnKeyOf.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The `keyof` type {@link T} excluding any keys of type {@link __proto__}
|
|
4
|
+
* @template T
|
|
5
|
+
* @template __proto__ `null` or any `object`-like type.
|
|
6
|
+
* @example
|
|
7
|
+
* OwnKeyOf<NPP, MSBPP> === "IsPackable" | "SuppressDependenciesWhenPacking" | "PackageVersion" | "PackageId" | "PackageDescription" | "Authors" | "Copyright" | "PackageRequireLicenseAcceptance" | "DevelopmentDependency" | "PackageLicenseExpression" | "PackageLicenseFile" | "PackageProjectUrl" | "PackageIcon" | "PackageReleaseNotes" | "PackageReadmeFile" | "PackageTags" | "PackageOutputPath" | "IncludeSymbols" | "IncludeSource" | "PackageType" | "IsTool" | "RepositoryUrl" | "RepositoryType" | "RepositoryCommit" | "SymbolPackageFormat" | "NoPackageAnalysis" | "MinClientVersion" | "IncludeBuildOutput" | "IncludeContentInPack" | "BuildOutputTargetFolder" | "ContentTargetFolders" | "NuspecFile" | "NuspecBasePath" | "NuspecProperties" | "Title" | "Company" | "Product"
|
|
8
|
+
* OwnKeyOf<typeof NPP, typeof MSBPP> === never ; // class NPP does not have non-inherited static members
|
|
9
|
+
* OwnKeyOf<typeof NPP, null> === "prototype" | "GetFullPath"
|
|
10
|
+
* @since 3.0.0
|
|
11
|
+
*/
|
|
12
|
+
type OwnKeyOf<T, __proto__ extends object | null> = Exclude<__proto__ extends null ? keyof T : Exclude<keyof T, keyof __proto__>, '__proto__'>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { OwnKeyOf };
|
|
15
|
+
//# sourceMappingURL=OwnKeyOf.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwnKeyOf.d.mts","names":["OwnKeyOf","T","__proto__","Exclude"],"sources":["../../../src/utils/reflection/OwnKeyOf.d.ts"],"mappings":";;AAUA;;;;;;;;;KAAYA,QAAAA,uCACRG,OAAAA,CACAD,SAAAA,sBACUD,CAAAA,GACNE,OAAAA,OACMF,CAAAA,QACAC,SAAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseClass, ClassLike, ClassLike_Unknown, ProtoOrSuperClass, WithProto } from "./inheritance.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/reflection/OwnPropertyDescriptorMap.d.ts
|
|
4
|
+
// todo: Omit [P in keyof T] where T['__proto__'][P] === T[P].
|
|
5
|
+
// todo: NEVER omit overridden class members! Does TypeScript expose that override in accessible metadata?
|
|
6
|
+
/**
|
|
7
|
+
* A typed {@link PropertyDescriptorMap} without any keys found in its `[[Prototype]]` chain.
|
|
8
|
+
* This may mean overridden class properties are wrongly omitted.
|
|
9
|
+
* @template T Any type with its `[[Prototype]]` attached via a type-only `__proto__` property. The type of `__proto__` must extends {@link ProtoOrSuperClass}.
|
|
10
|
+
* @since 3.0.0
|
|
11
|
+
*/
|
|
12
|
+
type OwnPropertyDescriptorMap<T extends WithProto<ProtoOrSuperClass>> = T['__proto__'] extends null ? { [P0 in keyof T]: TypedPropertyDescriptor<T[P0]> } : Omit<{ [P0 in keyof T]: TypedPropertyDescriptor<T[P0]> }, Exclude<keyof { [P1 in keyof T['__proto__']]: TypedPropertyDescriptor<T['__proto__'][P1]> }, keyof ClassLike<BaseClass<ClassLike_Unknown>>>>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { OwnPropertyDescriptorMap };
|
|
15
|
+
//# sourceMappingURL=OwnPropertyDescriptorMap.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwnPropertyDescriptorMap.d.mts","names":["BaseClass","ClassLike","ClassLike_Unknown","ProtoOrSuperClass","WithProto","OwnPropertyDescriptorMap","T","P0","TypedPropertyDescriptor","P1","Exclude","Omit"],"sources":["../../../src/utils/reflection/OwnPropertyDescriptorMap.d.ts"],"mappings":";;;;;;;;;;;KAiBYK,wBAAAA,WAAmCD,SAAAA,CAAUD,iBAAAA,KACrDG,CAAAA,4CACiBA,CAAAA,GAAIE,uBAAAA,CAAwBF,CAAAA,CAAEC,EAAAA,OAC7CI,IAAAA,gBACeL,CAAAA,GAAIE,uBAAAA,CAAwBF,CAAAA,CAAEC,EAAAA,MAC7CG,OAAAA,sBACuBJ,CAAAA,gBAAiBE,uBAAAA,CAAwBF,CAAAA,cAAeG,EAAAA,YACvER,SAAAA,CAAUD,SAAAA,CAAUE,iBAAAA"}
|