@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,13 @@
|
|
|
1
|
+
//#region src/utils/reflection/PropertyDescriptorMap.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A variant of TypeScript's ES5 PropertyDescriptorMap with an extra generic
|
|
4
|
+
* parameter for omitting inherited keys.
|
|
5
|
+
* @template T The type described by the {@link PropertyDescriptorMap}.
|
|
6
|
+
* @template [__proto__=null]
|
|
7
|
+
* The `null` or the `object`-like `[[Prototype]]` of {@link T}.
|
|
8
|
+
* @since 3.0.0
|
|
9
|
+
*/
|
|
10
|
+
type PropertyDescriptorMap<T, __proto__ extends object | null = null> = __proto__ extends null ? { [P0 in keyof T]: TypedPropertyDescriptor<T[P0]> } : Omit<{ [P0 in keyof T]: TypedPropertyDescriptor<T[P0]> }, keyof { [P1 in keyof __proto__]: TypedPropertyDescriptor<__proto__[P1]> }>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PropertyDescriptorMap };
|
|
13
|
+
//# sourceMappingURL=PropertyDescriptorMap.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyDescriptorMap.d.mts","names":["PropertyDescriptorMap","T","__proto__","P0","TypedPropertyDescriptor","P1","Omit"],"sources":["../../../src/utils/reflection/PropertyDescriptorMap.d.ts"],"mappings":";;AAQA;;;;;;;KAAYA,qBAAAA,8CACRE,SAAAA,+BACiBD,CAAAA,GAAIG,uBAAAA,CAAwBH,CAAAA,CAAEE,EAAAA,OAC7CG,IAAAA,gBACeL,CAAAA,GAAIG,uBAAAA,CAAwBH,CAAAA,CAAEE,EAAAA,2BACxBD,SAAAA,GAAYE,uBAAAA,CAAwBF,SAAAA,CAAUG,EAAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseClassProto, ClassLike, ConstructorConstraint, InstanceTypeOrSelf, SuperClassLike, WithProto, baseClassProto } from "./inheritance.mjs";
|
|
2
|
+
import { InstancePropertyDescriptorMap } from "./InstancePropertyDescriptorMap.mjs";
|
|
3
|
+
import { OwnGetterDescriptorMap } from "./OwnGetterDescriptorMap.mjs";
|
|
4
|
+
import { OwnPropertyDescriptorMap } from "./OwnPropertyDescriptorMap.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/utils/reflection/filterForGetters.d.ts
|
|
7
|
+
declare function filterForGetters<Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | typeof baseClassProto>>>(descriptorMap: InstancePropertyDescriptorMap<Class>): Partial<OwnGetterDescriptorMap<InstanceType<Class>, Class["__proto__"] extends BaseClassProto ? null : InstanceTypeOrSelf<Class["__proto__"]>>>;
|
|
8
|
+
declare function filterForGetters<Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>>(descriptorMap: OwnPropertyDescriptorMap<Class>): Partial<OwnGetterDescriptorMap<Class, Class["__proto__"]>>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { filterForGetters };
|
|
11
|
+
//# sourceMappingURL=filterForGetters.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterForGetters.d.mts","names":[],"sources":["../../../src/utils/reflection/filterForGetters.ts"],"mappings":";;;;;;iBAcgB,gBAAA,eACA,SAAA,CAAU,qBAAA,CAAsB,KAAA,IAAS,SAAA,CAAU,cAAA,UAAwB,cAAA,GAAA,CAEzF,aAAA,EAAe,6BAAA,CAA8B,KAAA,IAC5C,OAAA,CAAQ,sBAAA,CACT,YAAA,CAAa,KAAA,GACb,KAAA,sBAA2B,cAAA,UAAwB,kBAAA,CAAmB,KAAA;AAAA,iBAExD,gBAAA,eACA,SAAA,CAAU,qBAAA,CAAsB,KAAA,IAAS,SAAA,CAAU,cAAA,GAAiB,cAAA,GAAA,CAElF,aAAA,EAAe,wBAAA,CAAyB,KAAA,IACvC,OAAA,CAAQ,sBAAA,CAAuB,KAAA,EAAO,KAAA"}
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Returns an {@link OwnGetterDescriptorMap} of the getters.
|
|
4
|
-
* If you want only own, non-inherited getters, you must filter sanitize the
|
|
5
|
-
* type the `descriptors` parameter yourself e.g. `Omit<Class, keyof
|
|
6
|
-
* SuperClass>`.
|
|
7
|
-
* @param descriptorMap An object like the return value of Object.getOwnPropertyDescriptors
|
|
8
|
-
* @template Class Any ClassLike type
|
|
9
|
-
* @template T Any `object`-like type.
|
|
10
|
-
* @template [__proto__=null] If {@link Class} is not {@link ClassLike}, the `__proto__` of {@link T}.
|
|
11
|
-
* @returns An {@link OwnGetterDescriptorMap}.
|
|
12
|
-
* @since 3.0.0
|
|
13
|
-
*/
|
|
14
|
-
function filterForGetters(descriptorMap) {
|
|
15
|
-
let getterDescriptorMap = {};
|
|
16
|
-
for (const key in descriptorMap) {
|
|
17
|
-
const element = descriptorMap[key];
|
|
18
|
-
if (typeof element.get === 'function') {
|
|
19
|
-
getterDescriptorMap = Object.assign(getterDescriptorMap, {
|
|
20
|
-
[key]: element
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return getterDescriptorMap;
|
|
25
|
-
}
|
|
26
|
-
export { filterForGetters };
|
|
27
|
-
//# sourceMappingURL=filterForGetters.mjs.map
|
|
1
|
+
function e(e){let t={};for(let n in e){let r=e[n];typeof r.get==`function`&&(t=Object.assign(t,{[n]:r}))}return t}export{e as filterForGetters};
|
|
2
|
+
//# sourceMappingURL=filterForGetters.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterForGetters.mjs","sources":["../../../src/utils/reflection/filterForGetters.ts"],"
|
|
1
|
+
{"version":3,"file":"filterForGetters.mjs","names":[],"sources":["../../../src/utils/reflection/filterForGetters.ts"],"sourcesContent":["import type {\n BaseClassProto,\n baseClassProto,\n ClassLike,\n ConstructorConstraint,\n InstanceTypeOrSelf,\n SuperClassLike,\n WithProto,\n} from './inheritance.ts';\nimport type { InstancePropertyDescriptorMap } from './InstancePropertyDescriptorMap.d.ts';\nimport type { OwnGetterDescriptorMap } from './OwnGetterDescriptorMap.d.ts';\nimport type { OwnPropertyDescriptorMap } from './OwnPropertyDescriptorMap.d.ts';\nimport type { PropertyDescriptorMap } from './PropertyDescriptorMap.d.ts';\n\nexport function filterForGetters<\n Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | typeof baseClassProto>>,\n>(\n descriptorMap: InstancePropertyDescriptorMap<Class>,\n): Partial<OwnGetterDescriptorMap<\n InstanceType<Class>,\n Class['__proto__'] extends BaseClassProto ? null : InstanceTypeOrSelf<Class['__proto__']>\n>>;\nexport function filterForGetters<\n Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>,\n>(\n descriptorMap: OwnPropertyDescriptorMap<Class>,\n): Partial<OwnGetterDescriptorMap<Class, Class['__proto__']>>;\n/**\n * Iterates through the descriptors object, checking for property descriptors whose `get` is a function.\n * Returns an {@link OwnGetterDescriptorMap} of the getters.\n * If you want only own, non-inherited getters, you must filter sanitize the\n * type the `descriptors` parameter yourself e.g. `Omit<Class, keyof\n * SuperClass>`.\n * @param descriptorMap An object like the return value of Object.getOwnPropertyDescriptors\n * @template Class Any ClassLike type\n * @template T Any `object`-like type.\n * @template [__proto__=null] If {@link Class} is not {@link ClassLike}, the `__proto__` of {@link T}.\n * @returns An {@link OwnGetterDescriptorMap}.\n * @since 3.0.0\n */\nexport function filterForGetters<\n T extends object,\n __proto__ extends object | null = null,\n>(\n descriptorMap: PropertyDescriptorMap<T, __proto__> | PropertyDescriptorMap<T>,\n): Partial<OwnGetterDescriptorMap<T, __proto__>> {\n let getterDescriptorMap: Partial<OwnGetterDescriptorMap<T, __proto__>> = {};\n for (const key in descriptorMap) {\n const element = descriptorMap[key as keyof typeof descriptorMap];\n if (typeof element.get === 'function') {\n getterDescriptorMap = Object.assign(\n getterDescriptorMap,\n { [key]: element },\n );\n }\n }\n\n return getterDescriptorMap;\n}\n"],"mappings":"AAwCA,SAAgB,EAId,EAC+C,CAC/C,IAAI,EAAqE,EAAE,CAC3E,IAAK,IAAM,KAAO,EAAe,CAC/B,IAAM,EAAU,EAAc,GAC1B,OAAO,EAAQ,KAAQ,aACzB,EAAsB,OAAO,OAC3B,EACA,EAAG,GAAM,EAAS,CACnB,EAIL,OAAO"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InstanceOrStatic } from "../miscTypes.mjs";
|
|
2
|
+
import { BaseClassProto, ClassLike, ConstructorConstraint, SuperClassLike, WithProto } from "./inheritance.mjs";
|
|
3
|
+
import { InstancePropertyDescriptorMap } from "./InstancePropertyDescriptorMap.mjs";
|
|
4
|
+
import { OwnPropertyDescriptorMap } from "./OwnPropertyDescriptorMap.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/utils/reflection/getOwnPropertyDescriptors.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Get the property descriptors of the class or constructor similar to {@link Object.getOwnPropertyDescriptors}, but with more options--including recursion.
|
|
9
|
+
* @template {InstanceOrStatic} _InstanceOrStatic 'Instance' or 'Static'. Determines the return type.
|
|
10
|
+
* @param classDefinition A class or constructor, cast to {@link ClassLike}.
|
|
11
|
+
* @param instanceOrStatic 'Instance' or 'Static'. Determines the return type.
|
|
12
|
+
* @template {ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>} Class
|
|
13
|
+
* The typeof {@link classDefinition}.
|
|
14
|
+
* {@link WithProto}<{@link SuperClassLike}> is necessary for walking the
|
|
15
|
+
* prototype chain for both Instance and Static properties.
|
|
16
|
+
* If unspecified, the return type may be incorrect.
|
|
17
|
+
* @returns ({@link instanceOrStatic} === 'Instance') ? {@link InstancePropertyDescriptorMap<Class>}\
|
|
18
|
+
* : ({@link instanceOrStatic} === 'Static') ? {@link OwnPropertyDescriptorMap<Class>}\
|
|
19
|
+
* : never
|
|
20
|
+
* @throws {TypeError}
|
|
21
|
+
* @since 3.0.0
|
|
22
|
+
*/
|
|
23
|
+
declare function getOwnPropertyDescriptors<Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>, _InstanceOrStatic extends InstanceOrStatic>(classDefinition: Class, instanceOrStatic: _InstanceOrStatic): [_InstanceOrStatic] extends ["Instance"] ? InstancePropertyDescriptorMap<Class> : [_InstanceOrStatic] extends ["Static"] ? OwnPropertyDescriptorMap<Class> : never;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { getOwnPropertyDescriptors };
|
|
26
|
+
//# sourceMappingURL=getOwnPropertyDescriptors.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOwnPropertyDescriptors.d.mts","names":[],"sources":["../../../src/utils/reflection/getOwnPropertyDescriptors.ts"],"mappings":";;;;;;;;AAqBA;;;;;;;;;;;;;;iBAAgB,yBAAA,eACA,SAAA,CAAU,qBAAA,CAAsB,KAAA,IAAS,SAAA,CAAU,cAAA,GAAiB,cAAA,8BACxD,gBAAA,CAAA,CAE1B,eAAA,EAAiB,KAAA,EACjB,gBAAA,EAAkB,iBAAA,IAChB,iBAAA,yBACA,6BAAA,CAA8B,KAAA,KAC7B,iBAAA,uBACG,wBAAA,CAAyB,KAAA"}
|
|
@@ -1,34 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @template {InstanceOrStatic} _InstanceOrStatic 'Instance' or 'Static'. Determines the return type.
|
|
4
|
-
* @param classDefinition A class or constructor, cast to {@link ClassLike}.
|
|
5
|
-
* @param instanceOrStatic 'Instance' or 'Static'. Determines the return type.
|
|
6
|
-
* @template {ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>} Class
|
|
7
|
-
* The typeof {@link classDefinition}.
|
|
8
|
-
* {@link WithProto}<{@link SuperClassLike}> is necessary for walking the
|
|
9
|
-
* prototype chain for both Instance and Static properties.
|
|
10
|
-
* If unspecified, the return type may be incorrect.
|
|
11
|
-
* @returns ({@link instanceOrStatic} === 'Instance') ? {@link InstancePropertyDescriptorMap<Class>}\
|
|
12
|
-
* : ({@link instanceOrStatic} === 'Static') ? {@link OwnPropertyDescriptorMap<Class>}\
|
|
13
|
-
* : never
|
|
14
|
-
* @throws {TypeError}
|
|
15
|
-
* @since 3.0.0
|
|
16
|
-
*/
|
|
17
|
-
function getOwnPropertyDescriptors(classDefinition, instanceOrStatic) {
|
|
18
|
-
switch (instanceOrStatic) {
|
|
19
|
-
case 'Instance':
|
|
20
|
-
{
|
|
21
|
-
return Object.getOwnPropertyDescriptors(classDefinition.prototype);
|
|
22
|
-
}
|
|
23
|
-
case 'Static':
|
|
24
|
-
{
|
|
25
|
-
return Object.getOwnPropertyDescriptors(classDefinition);
|
|
26
|
-
}
|
|
27
|
-
default:
|
|
28
|
-
{
|
|
29
|
-
throw new TypeError('Argument `instanceOrStatic` must be "Instance" or "Static".');
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export { getOwnPropertyDescriptors };
|
|
34
|
-
//# sourceMappingURL=getOwnPropertyDescriptors.mjs.map
|
|
1
|
+
function e(e,t){switch(t){case`Instance`:return Object.getOwnPropertyDescriptors(e.prototype);case`Static`:return Object.getOwnPropertyDescriptors(e);default:throw TypeError('Argument `instanceOrStatic` must be "Instance" or "Static".')}}export{e as getOwnPropertyDescriptors};
|
|
2
|
+
//# sourceMappingURL=getOwnPropertyDescriptors.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOwnPropertyDescriptors.mjs","sources":["../../../src/utils/reflection/getOwnPropertyDescriptors.ts"],"
|
|
1
|
+
{"version":3,"file":"getOwnPropertyDescriptors.mjs","names":[],"sources":["../../../src/utils/reflection/getOwnPropertyDescriptors.ts"],"sourcesContent":["import type { InstanceOrStatic } from '../miscTypes.ts';\nimport type { BaseClassProto, ClassLike, ConstructorConstraint, SuperClassLike, WithProto } from './inheritance.ts';\nimport type { InstancePropertyDescriptorMap } from './InstancePropertyDescriptorMap.d.ts';\nimport type { OwnPropertyDescriptorMap } from './OwnPropertyDescriptorMap.d.ts';\n\n/**\n * Get the property descriptors of the class or constructor similar to {@link Object.getOwnPropertyDescriptors}, but with more options--including recursion.\n * @template {InstanceOrStatic} _InstanceOrStatic 'Instance' or 'Static'. Determines the return type.\n * @param classDefinition A class or constructor, cast to {@link ClassLike}.\n * @param instanceOrStatic 'Instance' or 'Static'. Determines the return type.\n * @template {ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>} Class\n * The typeof {@link classDefinition}.\n * {@link WithProto}<{@link SuperClassLike}> is necessary for walking the\n * prototype chain for both Instance and Static properties.\n * If unspecified, the return type may be incorrect.\n * @returns ({@link instanceOrStatic} === 'Instance') ? {@link InstancePropertyDescriptorMap<Class>}\\\n * : ({@link instanceOrStatic} === 'Static') ? {@link OwnPropertyDescriptorMap<Class>}\\\n * : never\n * @throws {TypeError}\n * @since 3.0.0\n */\nexport function getOwnPropertyDescriptors<\n Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>,\n _InstanceOrStatic extends InstanceOrStatic,\n>(\n classDefinition: Class,\n instanceOrStatic: _InstanceOrStatic,\n): [_InstanceOrStatic] extends ['Instance']\n ? InstancePropertyDescriptorMap<Class>\n : [_InstanceOrStatic] extends ['Static']\n ? OwnPropertyDescriptorMap<Class>\n : never {\n switch (instanceOrStatic) {\n case 'Instance': {\n return Object.getOwnPropertyDescriptors(classDefinition.prototype) as [Extract<typeof instanceOrStatic, 'Instance'>] extends ['Instance']\n ? InstancePropertyDescriptorMap<Class>\n : [_InstanceOrStatic] extends ['Static']\n ? OwnPropertyDescriptorMap<Class>\n : never;\n }\n case 'Static': {\n return Object.getOwnPropertyDescriptors(classDefinition) as [Extract<typeof instanceOrStatic, 'Static'>] extends ['Instance']\n ? InstancePropertyDescriptorMap<Class>\n : [_InstanceOrStatic] extends ['Static']\n ? OwnPropertyDescriptorMap<Class>\n : never;\n }\n default: {\n throw new TypeError('Argument `instanceOrStatic` must be \"Instance\" or \"Static\".');\n }\n }\n}\n"],"mappings":"AAqBA,SAAgB,EAId,EACA,EAKY,CACZ,OAAQ,EAAR,CACE,IAAK,WACH,OAAO,OAAO,0BAA0B,EAAgB,UAAU,CAMpE,IAAK,SACH,OAAO,OAAO,0BAA0B,EAAgB,CAM1D,QACE,MAAU,UAAU,8DAA8D"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Increment } from "../GracefulRecursion.mjs";
|
|
2
|
+
import { InstanceOrStatic, Integer } from "../miscTypes.mjs";
|
|
3
|
+
import { BaseClass, BaseClassProto, ClassLike, ConstructorConstraint, ConstructorLike, SuperClassLike, WithProto } from "./inheritance.mjs";
|
|
4
|
+
import { InstanceTypeOrSelfPropertyDescriptorMap } from "./InstanceTypeOrSelfPropertyDescriptorMap.mjs";
|
|
5
|
+
import { OwnPropertyDescriptorMap } from "./OwnPropertyDescriptorMap.mjs";
|
|
6
|
+
|
|
7
|
+
//#region src/utils/reflection/getOwnPropertyDescriptorsRecursively.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* A conditional wrapper for {@link InstanceTypeOrSelfPropertyDescriptorMap} and
|
|
10
|
+
* {@link OwnPropertyDescriptorMap}.
|
|
11
|
+
*
|
|
12
|
+
* If {@link _InstanceOrStatic} is 'Instance', {@link InstanceTypeOrSelfPropertyDescriptorMap}.\
|
|
13
|
+
* Else if {@link _InstanceOrStatic} is 'Static',
|
|
14
|
+
* {@link OwnPropertyDescriptorMap }.\
|
|
15
|
+
* Else, `never`.
|
|
16
|
+
* @template {ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>} Class
|
|
17
|
+
* A class definition cast to {@link ClassLike}.
|
|
18
|
+
* @template {InstanceOrStatic} _InstanceOrStatic
|
|
19
|
+
* 'Instance' or 'Static'. Determines the return type.
|
|
20
|
+
* @since 3.0.0
|
|
21
|
+
*/
|
|
22
|
+
type RecursedPropertyDescriptorMap<Class extends ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>, _InstanceOrStatic extends InstanceOrStatic> = [_InstanceOrStatic] extends ["Instance"] ? InstanceTypeOrSelfPropertyDescriptorMap<Class, Class["__proto__"]> : [_InstanceOrStatic] extends ["Static"] ? OwnPropertyDescriptorMap<Class> : never;
|
|
23
|
+
/**
|
|
24
|
+
* An
|
|
25
|
+
* ordered array of {@link OwnPropertyDescriptorMap} or
|
|
26
|
+
* {@link InstancePropertyDescriptorMap} starting with {@link classDefinition}
|
|
27
|
+
* and ending with a {@link BaseClass}.
|
|
28
|
+
* @template {ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>} Class
|
|
29
|
+
* @template {'Instance' | 'Static'} InstanceOrStatic
|
|
30
|
+
* @template {Integer<number>} [Limit=16]
|
|
31
|
+
* @template {Integer<number>} [CurrentLevel=0]
|
|
32
|
+
*/
|
|
33
|
+
type RecursedPropertyDescriptorMapArray<Class extends ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>, InstanceOrStatic extends "Instance" | "Static", Limit extends Integer<number> = 16, CurrentLevel extends Integer<number> = 0> = Class["__proto__"] extends BaseClassProto["__proto__"] | BaseClassProto["__proto__"]["__proto__"] ? never : Class["__proto__"] extends BaseClassProto ? [RecursedPropertyDescriptorMap<BaseClass<Class>, InstanceOrStatic>] : Class["__proto__"] extends ConstructorLike<Class["__proto__"]> ? [RecursedPropertyDescriptorMap<Class, InstanceOrStatic>, ...RecursedPropertyDescriptorMapArray<ClassLike<Exclude<Class["__proto__"], BaseClassProto> & WithProto<SuperClassLike | BaseClassProto>>, InstanceOrStatic, Limit, Increment<CurrentLevel>>] : never;
|
|
34
|
+
/**
|
|
35
|
+
* Walks the class inheritance chain to get a PropertyDescriptorMap of each class.
|
|
36
|
+
*
|
|
37
|
+
* While you _can_ use this to get an array of getter names/keys, you should use {@link getPrototypeOf} and {@link listOwnGetters}, instead!
|
|
38
|
+
* @template Class Any class definition type-cast to {@link ClassLike}
|
|
39
|
+
* @template _InstanceOrStatic
|
|
40
|
+
* @param classDefinition Any class definition type-cast to {@link ClassLike}
|
|
41
|
+
* @param instanceOrStatic 'Instance' or 'Static'. Determines the return type.
|
|
42
|
+
* @returns An
|
|
43
|
+
* ordered array of {@link OwnPropertyDescriptorMap} or
|
|
44
|
+
* {@link InstancePropertyDescriptorMap} starting with {@link classDefinition}
|
|
45
|
+
* and ending with a {@link BaseClass}.
|
|
46
|
+
* @since 3.0.0
|
|
47
|
+
*/
|
|
48
|
+
declare function getOwnPropertyDescriptorsRecursively<Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>, _InstanceOrStatic extends InstanceOrStatic, Limit extends Integer<number> = 16>(classDefinition: Class, instanceOrStatic: _InstanceOrStatic): RecursedPropertyDescriptorMapArray<Class, _InstanceOrStatic>;
|
|
49
|
+
//#endregion
|
|
50
|
+
export { RecursedPropertyDescriptorMap, RecursedPropertyDescriptorMapArray, getOwnPropertyDescriptorsRecursively };
|
|
51
|
+
//# sourceMappingURL=getOwnPropertyDescriptorsRecursively.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOwnPropertyDescriptorsRecursively.d.mts","names":[],"sources":["../../../src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts"],"mappings":";;;;;;;;;AAuCA;;;;;;;;;;;;KAAY,6BAAA,eACI,qBAAA,CAAsB,KAAA,IAAS,SAAA,CAAU,cAAA,GAAiB,cAAA,6BAC9C,gBAAA,KACvB,iBAAA,yBAA0C,uCAAA,CAAwC,KAAA,EAAO,KAAA,kBACzF,iBAAA,uBAAwC,wBAAA,CAAyB,KAAA;;;;;;;;;;;KAa1D,kCAAA,eACI,qBAAA,CAAsB,KAAA,IAAS,SAAA,CAAU,cAAA,GAAiB,cAAA,iEAE1D,OAAA,oCACO,OAAA,gBACnB,KAAA,sBAA2B,cAAA,gBAA8B,cAAA,qCACzD,KAAA,sBAA2B,cAAA,IAAkB,6BAAA,CAA8B,SAAA,CAAU,KAAA,GAAQ,gBAAA,KAC3F,KAAA,sBAA2B,eAAA,CAAgB,KAAA,kBAEvC,6BAAA,CAA8B,KAAA,EAAO,gBAAA,MAClC,kCAAA,CACD,SAAA,CAAU,OAAA,CAAQ,KAAA,eAAoB,cAAA,IAAkB,SAAA,CAAU,cAAA,GAAiB,cAAA,IACnF,gBAAA,EACA,KAAA,EACA,SAAA,CAAU,YAAA;;;;AAdtB;;;;;;;;;;;iBAgCgB,oCAAA,eAEA,SAAA,CAAU,qBAAA,CAAsB,KAAA,IAAS,SAAA,CAAU,cAAA,GAAiB,cAAA,8BACxD,gBAAA,gBAEZ,OAAA,cAAA,CAEd,eAAA,EAAiB,KAAA,EACjB,gBAAA,EAAkB,iBAAA,GACjB,kCAAA,CAAmC,KAAA,EAAO,iBAAA"}
|
|
@@ -1,72 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/* eslint-disable jsdoc/check-tag-names */
|
|
5
|
-
/**
|
|
6
|
-
* JSDoc type imports
|
|
7
|
-
* @typedef {import('./getPrototypeOf.js').getPrototypeOf} getPrototypeOf
|
|
8
|
-
* @typedef {import('./listOwnGetters.js').listOwnGetters} listOwnGetters
|
|
9
|
-
* @typedef {import('./InstancePropertyDescriptorMap.js').InstancePropertyDescriptorMap} InstancePropertyDescriptorMap
|
|
10
|
-
*/
|
|
11
|
-
/* eslint-enable jsdoc/check-tag-names */
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* A conditional wrapper for {@link InstanceTypeOrSelfPropertyDescriptorMap} and
|
|
15
|
-
* {@link OwnPropertyDescriptorMap}.
|
|
16
|
-
*
|
|
17
|
-
* If {@link _InstanceOrStatic} is 'Instance', {@link InstanceTypeOrSelfPropertyDescriptorMap}.\
|
|
18
|
-
* Else if {@link _InstanceOrStatic} is 'Static',
|
|
19
|
-
* {@link OwnPropertyDescriptorMap }.\
|
|
20
|
-
* Else, `never`.
|
|
21
|
-
* @template {ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>} Class
|
|
22
|
-
* A class definition cast to {@link ClassLike}.
|
|
23
|
-
* @template {InstanceOrStatic} _InstanceOrStatic
|
|
24
|
-
* 'Instance' or 'Static'. Determines the return type.
|
|
25
|
-
* @since 3.0.0
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* An
|
|
30
|
-
* ordered array of {@link OwnPropertyDescriptorMap} or
|
|
31
|
-
* {@link InstancePropertyDescriptorMap} starting with {@link classDefinition}
|
|
32
|
-
* and ending with a {@link BaseClass}.
|
|
33
|
-
* @template {ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>} Class
|
|
34
|
-
* @template {'Instance' | 'Static'} InstanceOrStatic
|
|
35
|
-
* @template {Integer<number>} [Limit=16]
|
|
36
|
-
* @template {Integer<number>} [CurrentLevel=0]
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Walks the class inheritance chain to get a PropertyDescriptorMap of each class.
|
|
41
|
-
*
|
|
42
|
-
* While you _can_ use this to get an array of getter names/keys, you should use {@link getPrototypeOf} and {@link listOwnGetters}, instead!
|
|
43
|
-
* @template Class Any class definition type-cast to {@link ClassLike}
|
|
44
|
-
* @template _InstanceOrStatic
|
|
45
|
-
* @param classDefinition Any class definition type-cast to {@link ClassLike}
|
|
46
|
-
* @param instanceOrStatic 'Instance' or 'Static'. Determines the return type.
|
|
47
|
-
* @returns An
|
|
48
|
-
* ordered array of {@link OwnPropertyDescriptorMap} or
|
|
49
|
-
* {@link InstancePropertyDescriptorMap} starting with {@link classDefinition}
|
|
50
|
-
* and ending with a {@link BaseClass}.
|
|
51
|
-
* @since 3.0.0
|
|
52
|
-
*/
|
|
53
|
-
function getOwnPropertyDescriptorsRecursively(classDefinition, instanceOrStatic) {
|
|
54
|
-
const staticProtoChain = getPrototypesChainOf(classDefinition, 'classes');
|
|
55
|
-
if (isSingleTuple(staticProtoChain)) {
|
|
56
|
-
return [getOwnPropertyDescriptors(staticProtoChain[0], instanceOrStatic)];
|
|
57
|
-
}
|
|
58
|
-
const recursedPropertyDescriptorMapArray = staticProtoChain.map(classDefinition => getOwnPropertyDescriptors(classDefinition, instanceOrStatic));
|
|
59
|
-
return recursedPropertyDescriptorMapArray;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Simple utility for single-tuple type assertion
|
|
64
|
-
* @template {T} T T in T[]
|
|
65
|
-
* @param array an array
|
|
66
|
-
* @returns array is [T]
|
|
67
|
-
*/
|
|
68
|
-
function isSingleTuple(array) {
|
|
69
|
-
return Array.isArray(array) && array.length === 1;
|
|
70
|
-
}
|
|
71
|
-
export { getOwnPropertyDescriptorsRecursively };
|
|
72
|
-
//# sourceMappingURL=getOwnPropertyDescriptorsRecursively.mjs.map
|
|
1
|
+
import{getOwnPropertyDescriptors as e}from"./getOwnPropertyDescriptors.mjs";import{getPrototypesChainOf as t}from"./getPrototypeChainOf.mjs";function n(n,i){let a=t(n,`classes`);return r(a)?[e(a[0],i)]:a.map(t=>e(t,i))}function r(e){return Array.isArray(e)&&e.length===1}export{n as getOwnPropertyDescriptorsRecursively};
|
|
2
|
+
//# sourceMappingURL=getOwnPropertyDescriptorsRecursively.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOwnPropertyDescriptorsRecursively.mjs","sources":["../../../src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts"],"
|
|
1
|
+
{"version":3,"file":"getOwnPropertyDescriptorsRecursively.mjs","names":[],"sources":["../../../src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts"],"sourcesContent":["import type { Increment } from '../GracefulRecursion.d.ts';\nimport type { InstanceOrStatic, Integer } from '../miscTypes.ts';\nimport { getOwnPropertyDescriptors } from './getOwnPropertyDescriptors.ts';\nimport { getPrototypesChainOf } from './getPrototypeChainOf.ts';\nimport type {\n BaseClass,\n BaseClassProto,\n ClassLike,\n ConstructorConstraint,\n ConstructorLike,\n ProtoChainOfClass,\n SuperClassLike,\n WithProto,\n} from './inheritance.ts';\nimport type { InstanceTypeOrSelfPropertyDescriptorMap } from './InstanceTypeOrSelfPropertyDescriptorMap.d.ts';\nimport type { OwnPropertyDescriptorMap } from './OwnPropertyDescriptorMap.d.ts';\n/**\n * JSDoc type imports\n */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { getPrototypeOf as _getPrototypeOf } from './getPrototypeOf.ts';\nimport type { listOwnGetters as _listOwnGetters } from './listOwnGetters.ts';\nimport type { InstancePropertyDescriptorMap as _InstancePropertyDescriptorMap } from './InstancePropertyDescriptorMap.d.ts';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * A conditional wrapper for {@link InstanceTypeOrSelfPropertyDescriptorMap} and\n * {@link OwnPropertyDescriptorMap}.\n *\n * If {@link _InstanceOrStatic} is 'Instance', {@link InstanceTypeOrSelfPropertyDescriptorMap}.\\\n * Else if {@link _InstanceOrStatic} is 'Static',\n * {@link OwnPropertyDescriptorMap }.\\\n * Else, `never`.\n * @template {ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>} Class\n * A class definition cast to {@link ClassLike}.\n * @template {InstanceOrStatic} _InstanceOrStatic\n * 'Instance' or 'Static'. Determines the return type.\n * @since 3.0.0\n */\nexport type RecursedPropertyDescriptorMap<\n Class extends ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>,\n _InstanceOrStatic extends InstanceOrStatic,\n> = [_InstanceOrStatic] extends ['Instance'] ? InstanceTypeOrSelfPropertyDescriptorMap<Class, Class['__proto__']>\n : [_InstanceOrStatic] extends ['Static'] ? OwnPropertyDescriptorMap<Class>\n : never;\n\n/**\n * An\n * ordered array of {@link OwnPropertyDescriptorMap} or\n * {@link InstancePropertyDescriptorMap} starting with {@link classDefinition}\n * and ending with a {@link BaseClass}.\n * @template {ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>} Class\n * @template {'Instance' | 'Static'} InstanceOrStatic\n * @template {Integer<number>} [Limit=16]\n * @template {Integer<number>} [CurrentLevel=0]\n */\nexport type RecursedPropertyDescriptorMapArray<\n Class extends ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>,\n InstanceOrStatic extends 'Instance' | 'Static',\n Limit extends Integer<number> = 16,\n CurrentLevel extends Integer<number> = 0,\n> = Class['__proto__'] extends BaseClassProto['__proto__'] | BaseClassProto['__proto__']['__proto__'] ? never\n : Class['__proto__'] extends BaseClassProto ? [RecursedPropertyDescriptorMap<BaseClass<Class>, InstanceOrStatic>]\n : Class['__proto__'] extends ConstructorLike<Class['__proto__']>\n ? [\n RecursedPropertyDescriptorMap<Class, InstanceOrStatic>,\n ...RecursedPropertyDescriptorMapArray<\n ClassLike<Exclude<Class['__proto__'], BaseClassProto> & WithProto<SuperClassLike | BaseClassProto>>,\n InstanceOrStatic,\n Limit,\n Increment<CurrentLevel>\n >,\n ]\n : never;\n/**\n * Walks the class inheritance chain to get a PropertyDescriptorMap of each class.\n *\n * While you _can_ use this to get an array of getter names/keys, you should use {@link getPrototypeOf} and {@link listOwnGetters}, instead!\n * @template Class Any class definition type-cast to {@link ClassLike}\n * @template _InstanceOrStatic\n * @param classDefinition Any class definition type-cast to {@link ClassLike}\n * @param instanceOrStatic 'Instance' or 'Static'. Determines the return type.\n * @returns An\n * ordered array of {@link OwnPropertyDescriptorMap} or\n * {@link InstancePropertyDescriptorMap} starting with {@link classDefinition}\n * and ending with a {@link BaseClass}.\n * @since 3.0.0\n */\nexport function getOwnPropertyDescriptorsRecursively<\n // Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>,\n Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>,\n _InstanceOrStatic extends InstanceOrStatic,\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters\n Limit extends Integer<number> = 16,\n>(\n classDefinition: Class,\n instanceOrStatic: _InstanceOrStatic,\n): RecursedPropertyDescriptorMapArray<Class, _InstanceOrStatic> {\n const staticProtoChain: ProtoChainOfClass<Class> = getPrototypesChainOf(classDefinition, 'classes');\n if (isSingleTuple(staticProtoChain)) {\n return [\n getOwnPropertyDescriptors(\n staticProtoChain[0],\n instanceOrStatic,\n ) as RecursedPropertyDescriptorMap<Class, _InstanceOrStatic>,\n ] as unknown as RecursedPropertyDescriptorMapArray<Class, _InstanceOrStatic, Limit>;\n }\n\n const recursedPropertyDescriptorMapArray = staticProtoChain.map(classDefinition =>\n getOwnPropertyDescriptors(\n classDefinition,\n instanceOrStatic,\n ),\n );\n\n return recursedPropertyDescriptorMapArray as RecursedPropertyDescriptorMapArray<Class, _InstanceOrStatic>;\n}\n\n/**\n * Simple utility for single-tuple type assertion\n * @template {T} T T in T[]\n * @param array an array\n * @returns array is [T]\n */\nfunction isSingleTuple<T>(array: T[]): array is [T] {\n return Array.isArray(array) && array.length === 1;\n}\n"],"mappings":"6IAwFA,SAAgB,EAOd,EACA,EAC8D,CAC9D,IAAM,EAA6C,EAAqB,EAAiB,UAAU,CAiBnG,OAhBI,EAAc,EAAiB,CAC1B,CACL,EACE,EAAiB,GACjB,EACD,CACF,CAGwC,EAAiB,IAAI,GAC9D,EACE,EACA,EACD,CACF,CAWH,SAAS,EAAiB,EAA0B,CAClD,OAAO,MAAM,QAAQ,EAAM,EAAI,EAAM,SAAW"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseClassProto, ClassLike, ConstructorConstraint, ProtoChainOfClass, ProtoChainOfClassInstance, SuperClassLike, WithProto } from "./inheritance.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/reflection/getPrototypeChainOf.d.ts
|
|
4
|
+
type ProtoChain<Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>, ClassesOrInstances extends "classes" | "classInstances"> = [ClassesOrInstances] extends ["classInstances"] ? ProtoChainOfClassInstance<Class> : [ClassesOrInstances] extends ["classes"] ? ProtoChainOfClass<Class> : never;
|
|
5
|
+
/**
|
|
6
|
+
* Iterate through the class and its base/super classes until an anonymous function is reached. This is the default superclass all classes extend.
|
|
7
|
+
* @template Class Any {@link ClassLike} type.
|
|
8
|
+
* @template ClassesOrInstances 'classes' or 'classInstances'
|
|
9
|
+
* @param classDefinition Any class type satisfying {@link Class}. This class (or its instance type) is included in the return value.
|
|
10
|
+
* @param [returnType='classes'] Determines return type. If 'classInstances', the return type is an array of the classes' `.prototype`. Else, the classes themselves are returned.
|
|
11
|
+
* @since 3.0.0
|
|
12
|
+
* @returns
|
|
13
|
+
* `returnType extends 'classInstances' ? ClassLike<T>[] : ClassLike<T>[].map(c => c.prototype)`
|
|
14
|
+
* Excludes default superclasses e.g. anonymous functions, native code.
|
|
15
|
+
*/
|
|
16
|
+
declare function getPrototypesChainOf<Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>, ClassesOrInstances extends "classes" | "classInstances">(classDefinition: Class, returnType: ClassesOrInstances): ProtoChain<Class, ClassesOrInstances>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { getPrototypesChainOf };
|
|
19
|
+
//# sourceMappingURL=getPrototypeChainOf.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPrototypeChainOf.d.mts","names":[],"sources":["../../../src/utils/reflection/getPrototypeChainOf.ts"],"mappings":";;;KAeK,UAAA,eACW,SAAA,CAAU,qBAAA,CAAsB,KAAA,IAAS,SAAA,CAAU,cAAA,GAAiB,cAAA,gEAE/E,kBAAA,+BAAiD,yBAAA,CAA0B,KAAA,KAC3E,kBAAA,wBAA0C,iBAAA,CAAkB,KAAA;;;;;;;;;;;;iBAcjD,oBAAA,eACA,SAAA,CAAU,qBAAA,CAAsB,KAAA,IAAS,SAAA,CAAU,cAAA,GAAiB,cAAA,4DAAA,CAGlF,eAAA,EAAiB,KAAA,EACjB,UAAA,EAAY,kBAAA,GACX,UAAA,CAAW,KAAA,EAAO,kBAAA"}
|
|
@@ -1,55 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { isConstructor } from './isConstructor.mjs';
|
|
4
|
-
|
|
5
|
-
/* eslint-disable jsdoc/no-defaults */
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Iterate through the class and its base/super classes until an anonymous function is reached. This is the default superclass all classes extend.
|
|
9
|
-
* @template Class Any {@link ClassLike} type.
|
|
10
|
-
* @template ClassesOrInstances 'classes' or 'classInstances'
|
|
11
|
-
* @param classDefinition Any class type satisfying {@link Class}. This class (or its instance type) is included in the return value.
|
|
12
|
-
* @param [returnType='classes'] Determines return type. If 'classInstances', the return type is an array of the classes' `.prototype`. Else, the classes themselves are returned.
|
|
13
|
-
* @since 3.0.0
|
|
14
|
-
* @returns
|
|
15
|
-
* `returnType extends 'classInstances' ? ClassLike<T>[] : ClassLike<T>[].map(c => c.prototype)`
|
|
16
|
-
* Excludes default superclasses e.g. anonymous functions, native code.
|
|
17
|
-
*/
|
|
18
|
-
function getPrototypesChainOf(classDefinition, returnType) {
|
|
19
|
-
// class definitions or their respective .prototype; exclude default superclasses.
|
|
20
|
-
let current = classDefinition;
|
|
21
|
-
let parent;
|
|
22
|
-
const returnValue = [];
|
|
23
|
-
let index = 0;
|
|
24
|
-
while (baseClassProto !== current) {
|
|
25
|
-
parent = getPrototypeOf(current);
|
|
26
|
-
// current is a Class symbol/constructor. Object.getOwnPropertyDescriptors on current will include static properties.
|
|
27
|
-
if (!isConstructor(current)) break;
|
|
28
|
-
if (returnType === 'classInstances') {
|
|
29
|
-
const instanceOfCurrent = current.prototype;
|
|
30
|
-
returnValue[index] = instanceOfCurrent;
|
|
31
|
-
} else {
|
|
32
|
-
returnValue[index] = current;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Assign the super class to current.
|
|
37
|
-
* If the argument is a class, Reflect.getPrototypeOf method returns the
|
|
38
|
-
* superclass.
|
|
39
|
-
*/
|
|
40
|
-
if (isConstructor(parent) && 'name' in parent && typeof parent.name === 'string' && '' !== parent.name // it's possible for a Function/Constructor to be anonymous...
|
|
41
|
-
) {
|
|
42
|
-
current = parent;
|
|
43
|
-
} else {
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
index++;
|
|
47
|
-
}
|
|
48
|
-
return returnValue;
|
|
49
|
-
/*
|
|
50
|
-
assuming current is NugetProjectProperties...
|
|
51
|
-
Reflect.getPrototypeOf(current).name is 'MSBuildProjectProperties'
|
|
52
|
-
*/
|
|
53
|
-
}
|
|
54
|
-
export { getPrototypesChainOf };
|
|
55
|
-
//# sourceMappingURL=getPrototypeChainOf.mjs.map
|
|
1
|
+
import{getPrototypeOf as e}from"./getPrototypeOf.mjs";import{baseClassProto as t}from"./inheritance.mjs";import{isConstructor as n}from"./isConstructor.mjs";function r(r,i){let a=r,o,s=[],c=0;for(;t!==a&&(o=e(a),n(a))&&(i===`classInstances`?s[c]=a.prototype:s[c]=a,n(o)&&`name`in o&&typeof o.name==`string`&&o.name!==``);)a=o,c++;return s}export{r as getPrototypesChainOf};
|
|
2
|
+
//# sourceMappingURL=getPrototypeChainOf.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPrototypeChainOf.mjs","sources":["../../../src/utils/reflection/getPrototypeChainOf.ts"],"
|
|
1
|
+
{"version":3,"file":"getPrototypeChainOf.mjs","names":[],"sources":["../../../src/utils/reflection/getPrototypeChainOf.ts"],"sourcesContent":["/* eslint-disable jsdoc/no-defaults */\nimport type { TupleIndices } from '../miscTypes.ts';\nimport { getPrototypeOf } from './getPrototypeOf.ts';\nimport {\n baseClassProto,\n type BaseClassProto,\n type ClassLike,\n type ConstructorConstraint,\n type ProtoChainOfClass,\n type ProtoChainOfClassInstance,\n type SuperClassLike,\n type WithProto,\n} from './inheritance.ts';\nimport { isConstructor } from './isConstructor.ts';\n\ntype ProtoChain<\n Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>,\n ClassesOrInstances extends 'classes' | 'classInstances',\n> = [ClassesOrInstances] extends ['classInstances'] ? ProtoChainOfClassInstance<Class>\n : [ClassesOrInstances] extends ['classes'] ? ProtoChainOfClass<Class>\n : never;\n\n/**\n * Iterate through the class and its base/super classes until an anonymous function is reached. This is the default superclass all classes extend.\n * @template Class Any {@link ClassLike} type.\n * @template ClassesOrInstances 'classes' or 'classInstances'\n * @param classDefinition Any class type satisfying {@link Class}. This class (or its instance type) is included in the return value.\n * @param [returnType='classes'] Determines return type. If 'classInstances', the return type is an array of the classes' `.prototype`. Else, the classes themselves are returned.\n * @since 3.0.0\n * @returns\n * `returnType extends 'classInstances' ? ClassLike<T>[] : ClassLike<T>[].map(c => c.prototype)`\n * Excludes default superclasses e.g. anonymous functions, native code.\n */\nexport function getPrototypesChainOf<\n Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>,\n ClassesOrInstances extends 'classes' | 'classInstances',\n>(\n classDefinition: Class,\n returnType: ClassesOrInstances,\n): ProtoChain<Class, ClassesOrInstances> {\n // class definitions or their respective .prototype; exclude default superclasses.\n let current: ProtoChainOfClass<Class>[TupleIndices<ProtoChainOfClass<Class>>] = classDefinition as ProtoChainOfClass<Class>[0 extends TupleIndices<ProtoChainOfClass<Class>> ? 0 : never];\n let parent: typeof current & WithProto<SuperClassLike | BaseClassProto> | object;\n const returnValue = [] as unknown as\n ProtoChain<Class, ClassesOrInstances>;\n let index: TupleIndices<typeof returnValue> = 0 as TupleIndices<typeof returnValue>;\n\n while (baseClassProto !== current) {\n parent = getPrototypeOf(current);\n // current is a Class symbol/constructor. Object.getOwnPropertyDescriptors on current will include static properties.\n if (!isConstructor(current))\n break;\n if (returnType === 'classInstances') {\n const instanceOfCurrent = current.prototype as InstanceType<typeof current>;\n\n returnValue[index] = instanceOfCurrent as typeof returnValue[typeof index];\n }\n else {\n returnValue[index] = current as typeof returnValue[typeof index];\n }\n\n /**\n * Assign the super class to current.\n * If the argument is a class, Reflect.getPrototypeOf method returns the\n * superclass.\n */\n if (\n isConstructor(parent)\n && 'name' in parent\n && typeof parent.name === 'string'\n && '' !== parent.name // it's possible for a Function/Constructor to be anonymous...\n ) {\n current = parent as ProtoChainOfClass<Class>[TupleIndices<ProtoChainOfClass<Class>>];\n }\n else {\n break;\n }\n index++;\n }\n return returnValue;\n /*\n assuming current is NugetProjectProperties...\n Reflect.getPrototypeOf(current).name is 'MSBuildProjectProperties'\n */\n}\n"],"mappings":"6JAiCA,SAAgB,EAId,EACA,EACuC,CAEvC,IAAI,EAA4E,EAC5E,EACE,EAAc,EAAE,CAElB,EAA0C,EAE9C,KAAO,IAAmB,IACxB,EAAS,EAAe,EAAQ,CAE3B,EAAc,EAAQ,IAEvB,IAAe,iBAGjB,EAAY,GAFc,EAAQ,UAKlC,EAAY,GAAS,EASrB,EAAc,EAAO,EAClB,SAAU,GACV,OAAO,EAAO,MAAS,UAChB,EAAO,OAAd,KAEH,EAAU,EAKZ,IAEF,OAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProtoOrSuperClass, WithProto } from "./inheritance.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/reflection/getPrototypeOf.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A nearly useless wrapper for {@link Reflect.getPrototypeOf}
|
|
6
|
+
* @param object An object with the internal `__proto__` property present in its type.
|
|
7
|
+
* @returns The `__proto__` of the `object` param.
|
|
8
|
+
*/
|
|
9
|
+
declare function getPrototypeOf<T extends WithProto<ProtoOrSuperClass>>(object: T): T["__proto__"];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { getPrototypeOf };
|
|
12
|
+
//# sourceMappingURL=getPrototypeOf.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPrototypeOf.d.mts","names":[],"sources":["../../../src/utils/reflection/getPrototypeOf.ts"],"mappings":";;;;;AAOA;;;iBAAgB,cAAA,WACJ,SAAA,CAAU,iBAAA,EAAA,CACpB,MAAA,EAAQ,CAAA,GAAI,CAAA"}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @param object An object with the internal `__proto__` property present in its type.
|
|
4
|
-
* @returns The `__proto__` of the `object` param.
|
|
5
|
-
*/
|
|
6
|
-
function getPrototypeOf(object) {
|
|
7
|
-
return Reflect.getPrototypeOf(object);
|
|
8
|
-
}
|
|
9
|
-
export { getPrototypeOf };
|
|
10
|
-
//# sourceMappingURL=getPrototypeOf.mjs.map
|
|
1
|
+
function e(e){return Reflect.getPrototypeOf(e)}export{e as getPrototypeOf};
|
|
2
|
+
//# sourceMappingURL=getPrototypeOf.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPrototypeOf.mjs","sources":["../../../src/utils/reflection/getPrototypeOf.ts"],"
|
|
1
|
+
{"version":3,"file":"getPrototypeOf.mjs","names":[],"sources":["../../../src/utils/reflection/getPrototypeOf.ts"],"sourcesContent":["import type { ProtoOrSuperClass, WithProto } from './inheritance.ts';\n\n/**\n * A nearly useless wrapper for {@link Reflect.getPrototypeOf}\n * @param object An object with the internal `__proto__` property present in its type.\n * @returns The `__proto__` of the `object` param.\n */\nexport function getPrototypeOf<\n T extends WithProto<ProtoOrSuperClass>,\n>(object: T): T['__proto__'] {\n return Reflect.getPrototypeOf(object) as T['__proto__'];\n}\n"],"mappings":"AAOA,SAAgB,EAEd,EAA2B,CAC3B,OAAO,QAAQ,eAAe,EAAO"}
|