eslint-plugin-package-json 0.88.2 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +16 -10
- package/lib/createRule.d.mts +9 -5
- package/lib/index.d.mts +2 -2
- package/lib/node_modules/.pnpm/@types_estree@1.0.8/node_modules/@types/estree/index.d.mts +438 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/deserializationPattern.d.mts +7 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/fromSchemaOptions.d.mts +20 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.d.mts +60 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/index.d.mts +11 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-options.d.mts +16 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/allOf.d.mts +13 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/anyOf.d.mts +14 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/array.d.mts +58 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/const.d.mts +14 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/deserialize.d.mts +13 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/enum.d.mts +14 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/ifThenElse.d.mts +20 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/index.d.mts +34 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/multipleTypes.d.mts +14 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/not.d.mts +20 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/nullable.d.mts +14 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/object.d.mts +34 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/oneOf.d.mts +14 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/external.d.mts +22 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/index.d.mts +13 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/internal.d.mts +8 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/utils.d.mts +12 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/singleType.d.mts +24 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/utils.d.mts +20 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/and.d.mts +4 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/extends.d.mts +4 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/get.d.mts +4 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/join.d.mts +4 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/not.d.mts +4 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/pop.d.mts +4 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/split.d.mts +7 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/tail.d.mts +4 -0
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/writable.d.mts +4 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.d.mts +20 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.d.mts +28 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/const.d.mts +25 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/enum.d.mts +25 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/any.d.mts +16 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/array.d.mts +20 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/const.d.mts +28 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/enum.d.mts +23 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/index.d.mts +24 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/object.d.mts +44 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/primitive.d.mts +16 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/tuple.d.mts +43 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/union.d.mts +13 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/utils.d.mts +35 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/any.d.mts +23 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/array.d.mts +24 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/const.d.mts +34 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/enum.d.mts +26 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.d.mts +24 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/object.d.mts +25 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/primitive.d.mts +23 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/tuple.d.mts +26 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/union.d.mts +17 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/utils.d.mts +10 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.d.mts +9 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/object.d.mts +49 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/primitive.d.mts +26 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/resolve.d.mts +22 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/tuple.d.mts +36 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/type.d.mts +18 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.d.mts +23 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/utils.d.mts +7 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/and.d.mts +4 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/extends.d.mts +7 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/if.d.mts +4 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/intersectUnion.d.mts +4 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/isNever.d.mts +4 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/merge.d.mts +6 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/not.d.mts +4 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/or.d.mts +4 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/prettify.d.mts +6 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/tail.d.mts +4 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionLast.d.mts +6 -0
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionPop.d.mts +6 -0
- package/lib/plugin.d.mts +3 -4
- package/lib/plugin.mjs +3 -3
- package/lib/rules/no-empty-fields.mjs +2 -2
- package/lib/rules/repository-shorthand.mjs +3 -3
- package/lib/rules/require-attribution.d.mts +5 -0
- package/lib/rules/require-attribution.mjs +23 -7
- package/lib/rules/require-properties.mjs +14 -5
- package/lib/rules/restrict-private-properties.mjs +2 -2
- package/package.json +15 -15
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/writable.d.ts
|
|
2
|
+
type Writable<TYPE> = TYPE extends ((...args: unknown[]) => unknown) | Date | RegExp ? TYPE : TYPE extends ReadonlyMap<infer KEYS, infer VALUES> ? Map<Writable<KEYS>, Writable<VALUES>> : TYPE extends ReadonlySet<infer VALUES> ? Set<Writable<VALUES>> : TYPE extends ReadonlyArray<unknown> ? `${bigint}` extends `${keyof TYPE & any}` ? { -readonly [KEY in keyof TYPE]: Writable<TYPE[KEY]> } : Writable<TYPE[number]>[] : TYPE extends object ? { -readonly [KEY in keyof TYPE]: Writable<TYPE[KEY]> } : TYPE;
|
|
3
|
+
//#endregion
|
|
4
|
+
export { Writable };
|
package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { And } from "../utils/and.mjs";
|
|
2
|
+
import { If } from "../utils/if.mjs";
|
|
3
|
+
import { Deserialized, IsSerialized } from "./utils.mjs";
|
|
4
|
+
import { ResolveOptions } from "./resolve.mjs";
|
|
5
|
+
|
|
6
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.d.ts
|
|
7
|
+
declare type AnyTypeId = "any";
|
|
8
|
+
declare type Any<IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = {
|
|
9
|
+
type: AnyTypeId;
|
|
10
|
+
isSerialized: IS_SERIALIZED;
|
|
11
|
+
deserialized: DESERIALIZED;
|
|
12
|
+
};
|
|
13
|
+
declare type AnyType = {
|
|
14
|
+
type: AnyTypeId;
|
|
15
|
+
isSerialized: boolean;
|
|
16
|
+
deserialized: unknown;
|
|
17
|
+
};
|
|
18
|
+
declare type ResolveAny<META_ANY extends AnyType, OPTIONS extends ResolveOptions> = If<And<OPTIONS["deserialize"], IsSerialized<META_ANY>>, Deserialized<META_ANY>, unknown>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Any, AnyType, ResolveAny };
|
package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.d.mts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { And } from "../utils/and.mjs";
|
|
2
|
+
import { If } from "../utils/if.mjs";
|
|
3
|
+
import { Prettify } from "../utils/prettify.mjs";
|
|
4
|
+
import { NeverType } from "./never.mjs";
|
|
5
|
+
import { Deserialized, IsSerialized } from "./utils.mjs";
|
|
6
|
+
import { Type } from "./type.mjs";
|
|
7
|
+
import { Resolve, ResolveOptions } from "./resolve.mjs";
|
|
8
|
+
import { Any } from "./any.mjs";
|
|
9
|
+
|
|
10
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.d.ts
|
|
11
|
+
declare type ArrayTypeId = "array";
|
|
12
|
+
declare type _Array<VALUES extends Type = Any, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = _$Array<VALUES, IS_SERIALIZED, DESERIALIZED>;
|
|
13
|
+
declare type _$Array<VALUES = Any, IS_SERIALIZED = false, DESERIALIZED = never> = {
|
|
14
|
+
type: ArrayTypeId;
|
|
15
|
+
values: VALUES;
|
|
16
|
+
isSerialized: IS_SERIALIZED;
|
|
17
|
+
deserialized: DESERIALIZED;
|
|
18
|
+
};
|
|
19
|
+
declare type ArrayType = {
|
|
20
|
+
type: ArrayTypeId;
|
|
21
|
+
values: Type;
|
|
22
|
+
isSerialized: boolean;
|
|
23
|
+
deserialized: unknown;
|
|
24
|
+
};
|
|
25
|
+
declare type ArrayValues<META_ARRAY extends ArrayType> = META_ARRAY["values"];
|
|
26
|
+
declare type ResolveArray<META_ARRAY extends ArrayType, OPTIONS extends ResolveOptions> = If<And<OPTIONS["deserialize"], IsSerialized<META_ARRAY>>, Deserialized<META_ARRAY>, ArrayValues<META_ARRAY> extends NeverType ? [] : Prettify<Resolve<ArrayValues<META_ARRAY>, OPTIONS>[]>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ArrayType, ArrayValues, ResolveArray, _$Array, _Array };
|
package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/const.d.mts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { And } from "../utils/and.mjs";
|
|
2
|
+
import { If } from "../utils/if.mjs";
|
|
3
|
+
import { IsNever } from "../utils/isNever.mjs";
|
|
4
|
+
import { Never } from "./never.mjs";
|
|
5
|
+
import { Deserialized, IsSerialized } from "./utils.mjs";
|
|
6
|
+
import { ResolveOptions } from "./resolve.mjs";
|
|
7
|
+
|
|
8
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/const.d.ts
|
|
9
|
+
declare type ConstTypeId = "const";
|
|
10
|
+
declare type Const<VALUE, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = If<IsNever<VALUE>, Never, {
|
|
11
|
+
type: ConstTypeId;
|
|
12
|
+
value: VALUE;
|
|
13
|
+
isSerialized: IS_SERIALIZED;
|
|
14
|
+
deserialized: DESERIALIZED;
|
|
15
|
+
}>;
|
|
16
|
+
declare type ConstType = {
|
|
17
|
+
type: ConstTypeId;
|
|
18
|
+
value: unknown;
|
|
19
|
+
isSerialized: boolean;
|
|
20
|
+
deserialized: unknown;
|
|
21
|
+
};
|
|
22
|
+
declare type ConstValue<META_CONST extends ConstType> = META_CONST["value"];
|
|
23
|
+
declare type ResolveConst<META_CONST extends ConstType, OPTIONS extends ResolveOptions> = If<And<OPTIONS["deserialize"], IsSerialized<META_CONST>>, Deserialized<META_CONST>, ConstValue<META_CONST>>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Const, ConstType, ConstValue, ResolveConst };
|
package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/enum.d.mts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { And } from "../utils/and.mjs";
|
|
2
|
+
import { If } from "../utils/if.mjs";
|
|
3
|
+
import { IsNever } from "../utils/isNever.mjs";
|
|
4
|
+
import { Never } from "./never.mjs";
|
|
5
|
+
import { Deserialized, IsSerialized } from "./utils.mjs";
|
|
6
|
+
import { ResolveOptions } from "./resolve.mjs";
|
|
7
|
+
|
|
8
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/enum.d.ts
|
|
9
|
+
declare type EnumTypeId = "enum";
|
|
10
|
+
declare type Enum<VALUES, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = If<IsNever<VALUES>, Never, {
|
|
11
|
+
type: EnumTypeId;
|
|
12
|
+
values: VALUES;
|
|
13
|
+
isSerialized: IS_SERIALIZED;
|
|
14
|
+
deserialized: DESERIALIZED;
|
|
15
|
+
}>;
|
|
16
|
+
declare type EnumType = {
|
|
17
|
+
type: EnumTypeId;
|
|
18
|
+
values: unknown;
|
|
19
|
+
isSerialized: boolean;
|
|
20
|
+
deserialized: unknown;
|
|
21
|
+
};
|
|
22
|
+
declare type EnumValues<META_ENUM extends EnumType> = META_ENUM["values"];
|
|
23
|
+
declare type ResolveEnum<META_ENUM extends EnumType, OPTIONS extends ResolveOptions> = If<And<OPTIONS["deserialize"], IsSerialized<META_ENUM>>, Deserialized<META_ENUM>, EnumValues<META_ENUM>>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Enum, EnumType, EnumValues, ResolveEnum };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Never, NeverType } from "../never.mjs";
|
|
2
|
+
import { ConstType } from "../const.mjs";
|
|
3
|
+
import { EnumType } from "../enum.mjs";
|
|
4
|
+
import { ObjectType } from "../object.mjs";
|
|
5
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
6
|
+
import { TupleType } from "../tuple.mjs";
|
|
7
|
+
import { UnionType } from "../union.mjs";
|
|
8
|
+
import { Type } from "../type.mjs";
|
|
9
|
+
import { ArrayType } from "../array.mjs";
|
|
10
|
+
import { AnyType } from "../any.mjs";
|
|
11
|
+
import { ExcludeUnion } from "./union.mjs";
|
|
12
|
+
|
|
13
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/any.d.ts
|
|
14
|
+
declare type ExcludeFromAny<META_ANY extends AnyType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_ANY : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? META_ANY : META_TYPE extends EnumType ? META_ANY : META_TYPE extends PrimitiveType ? META_ANY : META_TYPE extends ArrayType ? META_ANY : META_TYPE extends TupleType ? META_ANY : META_TYPE extends ObjectType ? META_ANY : META_TYPE extends UnionType ? ExcludeUnion<META_ANY, META_TYPE> : Never : Never;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ExcludeFromAny };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { And } from "../../utils/and.mjs";
|
|
2
|
+
import { DoesExtend } from "../../utils/extends.mjs";
|
|
3
|
+
import { Never, NeverType } from "../never.mjs";
|
|
4
|
+
import { ConstType } from "../const.mjs";
|
|
5
|
+
import { EnumType } from "../enum.mjs";
|
|
6
|
+
import { ObjectType } from "../object.mjs";
|
|
7
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
8
|
+
import { IsTupleOpen, TupleOpenProps, TupleType, TupleValues } from "../tuple.mjs";
|
|
9
|
+
import { UnionType } from "../union.mjs";
|
|
10
|
+
import { Type } from "../type.mjs";
|
|
11
|
+
import { ArrayType, ArrayValues, _Array } from "../array.mjs";
|
|
12
|
+
import { AnyType } from "../any.mjs";
|
|
13
|
+
import { ExcludeUnion } from "./union.mjs";
|
|
14
|
+
import { _Exclude } from "./index.mjs";
|
|
15
|
+
|
|
16
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/array.d.ts
|
|
17
|
+
declare type ExcludeFromArray<META_ARRAY extends ArrayType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_ARRAY : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? META_ARRAY : META_TYPE extends EnumType ? META_ARRAY : META_TYPE extends PrimitiveType ? META_ARRAY : META_TYPE extends ArrayType ? ExcludeArrays<META_ARRAY, META_TYPE> : META_TYPE extends TupleType ? And<DoesExtend<TupleValues<META_TYPE>, []>, IsTupleOpen<META_TYPE>> extends true ? ExcludeArrays<META_ARRAY, _Array<TupleOpenProps<META_TYPE>>> : META_ARRAY : META_TYPE extends ObjectType ? META_ARRAY : META_TYPE extends UnionType ? ExcludeUnion<META_ARRAY, META_TYPE> : Never : Never;
|
|
18
|
+
declare type ExcludeArrays<META_ARRAY_A extends ArrayType, META_ARRAY_B extends ArrayType> = _Exclude<ArrayValues<META_ARRAY_A>, ArrayValues<META_ARRAY_B>> extends NeverType ? NeverType : META_ARRAY_A;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ExcludeFromArray };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IsObject } from "../../utils/extends.mjs";
|
|
2
|
+
import { If } from "../../utils/if.mjs";
|
|
3
|
+
import { IsNever } from "../../utils/isNever.mjs";
|
|
4
|
+
import { Never, NeverType } from "../never.mjs";
|
|
5
|
+
import { Const, ConstType, ConstValue } from "../const.mjs";
|
|
6
|
+
import { EnumType } from "../enum.mjs";
|
|
7
|
+
import { IsObjectOpen, ObjectOpenProps, ObjectRequiredKeys, ObjectType, ObjectValues } from "../object.mjs";
|
|
8
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
9
|
+
import { TupleType } from "../tuple.mjs";
|
|
10
|
+
import { UnionType } from "../union.mjs";
|
|
11
|
+
import { Type } from "../type.mjs";
|
|
12
|
+
import { ArrayType } from "../array.mjs";
|
|
13
|
+
import { Resolve } from "../resolve.mjs";
|
|
14
|
+
import { AnyType } from "../any.mjs";
|
|
15
|
+
import { ExcludeUnion } from "./union.mjs";
|
|
16
|
+
import { _Exclude } from "./index.mjs";
|
|
17
|
+
|
|
18
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/const.d.ts
|
|
19
|
+
declare type ExcludeFromConst<META_CONST extends ConstType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_CONST : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? CheckNotExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends EnumType ? CheckNotExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends PrimitiveType ? CheckNotExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends ArrayType ? CheckNotExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends TupleType ? CheckNotExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends ObjectType ? ExcludeObject<META_CONST, META_TYPE> : META_TYPE extends UnionType ? ExcludeUnion<META_CONST, META_TYPE> : Never : Never;
|
|
20
|
+
declare type CheckNotExtendsResolved<META_CONST extends ConstType, META_TYPE extends Type> = ConstValue<META_CONST> extends Resolve<META_TYPE, {
|
|
21
|
+
deserialize: false;
|
|
22
|
+
}> ? Never : META_CONST;
|
|
23
|
+
declare type ExcludeObject<META_CONST extends ConstType, META_OBJECT extends ObjectType> = If<IsObject<ConstValue<META_CONST>>, ObjectRequiredKeys<META_OBJECT> extends keyof ConstValue<META_CONST> ? ExcludeObjectFromConst<META_CONST, META_OBJECT> : META_CONST, META_CONST>;
|
|
24
|
+
declare type ExcludeObjectFromConst<META_CONST extends ConstType, META_OBJECT extends ObjectType, EXCLUDED_CONST_VALUES = ExcludeConstValues<ConstValue<META_CONST>, META_OBJECT>> = If<IsNever<RepresentableKeys<EXCLUDED_CONST_VALUES>>, Never, META_CONST>;
|
|
25
|
+
declare type ExcludeConstValues<VALUE, META_OBJECT extends ObjectType> = { [KEY in keyof VALUE]: KEY extends keyof ObjectValues<META_OBJECT> ? _Exclude<Const<VALUE[KEY]>, ObjectValues<META_OBJECT>[KEY]> : IsObjectOpen<META_OBJECT> extends true ? _Exclude<Const<VALUE[KEY]>, ObjectOpenProps<META_OBJECT>> : Const<VALUE[KEY]> };
|
|
26
|
+
declare type RepresentableKeys<VALUES> = { [KEY in keyof VALUES]: VALUES[KEY] extends Never ? never : KEY }[keyof VALUES];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ExcludeFromConst };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UnionLast } from "../../utils/unionLast.mjs";
|
|
2
|
+
import { Never, NeverType } from "../never.mjs";
|
|
3
|
+
import { Const, ConstType } from "../const.mjs";
|
|
4
|
+
import { Enum, EnumType, EnumValues } from "../enum.mjs";
|
|
5
|
+
import { ObjectType } from "../object.mjs";
|
|
6
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
7
|
+
import { TupleType } from "../tuple.mjs";
|
|
8
|
+
import { UnionType } from "../union.mjs";
|
|
9
|
+
import { Type } from "../type.mjs";
|
|
10
|
+
import { ArrayType } from "../array.mjs";
|
|
11
|
+
import { AnyType } from "../any.mjs";
|
|
12
|
+
import { $Intersect } from "../intersection/index.mjs";
|
|
13
|
+
import { ExcludeUnion } from "./union.mjs";
|
|
14
|
+
import { _Exclude } from "./index.mjs";
|
|
15
|
+
|
|
16
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/enum.d.ts
|
|
17
|
+
declare type ExcludeFromEnum<META_ENUM extends EnumType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_ENUM : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends EnumType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends PrimitiveType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends ArrayType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends TupleType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends ObjectType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends UnionType ? ExcludeUnion<META_ENUM, META_TYPE> : Never : Never;
|
|
18
|
+
declare type FilterEnumExcluded<META_ENUM extends EnumType, META_TYPE extends Type> = Enum<FilterEnumExcludedValues<EnumValues<META_ENUM>, META_TYPE>>;
|
|
19
|
+
declare type FilterEnumExcludedValues<ENUM_VALUES, META_TYPE extends Type> = ENUM_VALUES extends infer ENUM_VALUE ? _Exclude<Const<ENUM_VALUE>, META_TYPE> extends NeverType ? never : ENUM_VALUE : never;
|
|
20
|
+
declare type ExcludeEnum<META_TYPE extends Type, ENUM_TYPE extends EnumType, ENUM_VALUES = EnumValues<ENUM_TYPE>> = ExcludeEnumValue<META_TYPE, UnionLast<ENUM_VALUES>, ENUM_VALUES>;
|
|
21
|
+
declare type ExcludeEnumValue<META_TYPE extends Type, LAST_ENUM_VALUE, ENUM_VALUES> = $Intersect<_Exclude<META_TYPE, Const<LAST_ENUM_VALUE>>, _Exclude<META_TYPE, Enum<Exclude<ENUM_VALUES, LAST_ENUM_VALUE>>>>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ExcludeEnum, ExcludeFromEnum };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Never, NeverType } from "../never.mjs";
|
|
2
|
+
import { ConstType } from "../const.mjs";
|
|
3
|
+
import { EnumType } from "../enum.mjs";
|
|
4
|
+
import { ObjectType } from "../object.mjs";
|
|
5
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
6
|
+
import { TupleType } from "../tuple.mjs";
|
|
7
|
+
import { UnionType } from "../union.mjs";
|
|
8
|
+
import { Type } from "../type.mjs";
|
|
9
|
+
import { ArrayType } from "../array.mjs";
|
|
10
|
+
import { AnyType } from "../any.mjs";
|
|
11
|
+
import { ExcludeFromUnion } from "./union.mjs";
|
|
12
|
+
import { ExcludeFromAny } from "./any.mjs";
|
|
13
|
+
import { ExcludeFromArray } from "./array.mjs";
|
|
14
|
+
import { ExcludeFromConst } from "./const.mjs";
|
|
15
|
+
import { ExcludeFromEnum } from "./enum.mjs";
|
|
16
|
+
import { ExcludeFromObject } from "./object.mjs";
|
|
17
|
+
import { ExcludeFromPrimitive } from "./primitive.mjs";
|
|
18
|
+
import { ExcludeFromTuple } from "./tuple.mjs";
|
|
19
|
+
|
|
20
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/index.d.ts
|
|
21
|
+
declare type _Exclude<META_TYPE_A extends Type, META_TYPE_B extends Type> = _$Exclude<META_TYPE_A, META_TYPE_B>;
|
|
22
|
+
declare type _$Exclude<META_TYPE_A, META_TYPE_B> = META_TYPE_A extends NeverType ? META_TYPE_A : META_TYPE_A extends AnyType ? ExcludeFromAny<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ConstType ? ExcludeFromConst<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends EnumType ? ExcludeFromEnum<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends PrimitiveType ? ExcludeFromPrimitive<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ArrayType ? ExcludeFromArray<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends TupleType ? ExcludeFromTuple<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ObjectType ? ExcludeFromObject<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends UnionType ? ExcludeFromUnion<META_TYPE_A, META_TYPE_B> : Never;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { _$Exclude, _Exclude };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { And } from "../../utils/and.mjs";
|
|
2
|
+
import { DoesExtend, IsObject } from "../../utils/extends.mjs";
|
|
3
|
+
import { If } from "../../utils/if.mjs";
|
|
4
|
+
import { IsNever } from "../../utils/isNever.mjs";
|
|
5
|
+
import { Not } from "../../utils/not.mjs";
|
|
6
|
+
import { Or } from "../../utils/or.mjs";
|
|
7
|
+
import { UnionPop } from "../../utils/unionPop.mjs";
|
|
8
|
+
import { Never, NeverType } from "../never.mjs";
|
|
9
|
+
import { Deserialized, IsSerialized } from "../utils.mjs";
|
|
10
|
+
import { Const, ConstType, ConstValue } from "../const.mjs";
|
|
11
|
+
import { EnumType } from "../enum.mjs";
|
|
12
|
+
import { IsObjectClosedOnResolve, IsObjectOpen, ObjectOpenProps, ObjectRequiredKeys, ObjectType, ObjectValue, ObjectValues, _Object } from "../object.mjs";
|
|
13
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
14
|
+
import { TupleType } from "../tuple.mjs";
|
|
15
|
+
import { UnionType } from "../union.mjs";
|
|
16
|
+
import { Type } from "../type.mjs";
|
|
17
|
+
import { ArrayType } from "../array.mjs";
|
|
18
|
+
import { AnyType } from "../any.mjs";
|
|
19
|
+
import { ExcludeUnion } from "./union.mjs";
|
|
20
|
+
import { ExcludeEnum } from "./enum.mjs";
|
|
21
|
+
import { ExclusionResult, IsOmittable, IsOutsideOfExcludedScope, IsOutsideOfSourceScope, PropagateExclusion, SourceValue, ValueExclusionResult, ValueExclusionResultType } from "./utils.mjs";
|
|
22
|
+
import { _$Exclude, _Exclude } from "./index.mjs";
|
|
23
|
+
|
|
24
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/object.d.ts
|
|
25
|
+
declare type ExcludeFromObject<META_OBJECT extends ObjectType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_OBJECT : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? ExcludeConstFromObject<META_OBJECT, META_TYPE> : META_TYPE extends EnumType ? ExcludeEnum<META_OBJECT, META_TYPE> : META_TYPE extends PrimitiveType ? META_OBJECT : META_TYPE extends ArrayType ? META_OBJECT : META_TYPE extends TupleType ? META_OBJECT : META_TYPE extends ObjectType ? ExcludeObjects<META_OBJECT, META_TYPE> : META_TYPE extends UnionType ? ExcludeUnion<META_OBJECT, META_TYPE> : Never : Never;
|
|
26
|
+
declare type ExcludeObjects<META_OBJECT_A extends ObjectType, META_OBJECT_B extends ObjectType, VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType> = ExcludeObjectValues<META_OBJECT_A, META_OBJECT_B>, REPRESENTABLE_KEYS extends string = RepresentableKeys<VALUE_EXCLUSION_RESULTS>, OPEN_PROPS_EXCLUSION = _Exclude<ObjectOpenProps<META_OBJECT_A>, ObjectOpenProps<META_OBJECT_B>>> = DoesObjectSizesMatch<META_OBJECT_A, META_OBJECT_B, VALUE_EXCLUSION_RESULTS> extends true ? {
|
|
27
|
+
moreThanTwo: META_OBJECT_A;
|
|
28
|
+
onlyOne: PropagateExclusions<META_OBJECT_A, VALUE_EXCLUSION_RESULTS>;
|
|
29
|
+
none: OmitOmittableKeys<META_OBJECT_A, VALUE_EXCLUSION_RESULTS>;
|
|
30
|
+
}[And<IsObjectOpen<META_OBJECT_A>, Not<DoesExtend<OPEN_PROPS_EXCLUSION, NeverType>>> extends true ? "moreThanTwo" : GetUnionLength<REPRESENTABLE_KEYS>] : META_OBJECT_A;
|
|
31
|
+
declare type ExcludeObjectValues<META_OBJECT_A extends ObjectType, META_OBJECT_B extends ObjectType> = { [KEY in Extract<keyof ObjectValues<META_OBJECT_A> | keyof ObjectValues<META_OBJECT_B> | ObjectRequiredKeys<META_OBJECT_A> | ObjectRequiredKeys<META_OBJECT_B>, string>]: ValueExclusionResult<ObjectValue<META_OBJECT_A, KEY>, IsAllowedIn<META_OBJECT_A, KEY>, IsRequiredIn<META_OBJECT_A, KEY>, ObjectValue<META_OBJECT_B, KEY>, IsAllowedIn<META_OBJECT_B, KEY>, IsRequiredIn<META_OBJECT_B, KEY>> };
|
|
32
|
+
declare type GetUnionLength<UNION> = If<IsNever<UNION>, "none", If<IsNever<UnionPop<UNION>>, "onlyOne", "moreThanTwo">>;
|
|
33
|
+
declare type IsAllowedIn<META_OBJECT extends ObjectType, KEY extends string> = Or<DoesExtend<KEY, keyof ObjectValues<META_OBJECT>>, IsObjectOpen<META_OBJECT>>;
|
|
34
|
+
declare type IsRequiredIn<META_OBJECT extends ObjectType, KEY extends string> = DoesExtend<KEY, ObjectRequiredKeys<META_OBJECT>>;
|
|
35
|
+
declare type DoesObjectSizesMatch<META_OBJECT_A extends ObjectType, META_OBJECT_B extends ObjectType, VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = If<And<IsObjectOpen<META_OBJECT_A>, Not<IsObjectOpen<META_OBJECT_B>>>, false, And<IsExcludedSmallEnough<VALUE_EXCLUSION_RESULTS>, IsExcludedBigEnough<VALUE_EXCLUSION_RESULTS>>>;
|
|
36
|
+
declare type IsExcludedSmallEnough<VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = Not<DoesExtend<true, { [KEY in keyof VALUE_EXCLUSION_RESULTS]: IsOutsideOfSourceScope<VALUE_EXCLUSION_RESULTS[KEY]> }[keyof VALUE_EXCLUSION_RESULTS]>>;
|
|
37
|
+
declare type IsExcludedBigEnough<VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = Not<DoesExtend<true, { [KEY in keyof VALUE_EXCLUSION_RESULTS]: IsOutsideOfExcludedScope<VALUE_EXCLUSION_RESULTS[KEY]> }[keyof VALUE_EXCLUSION_RESULTS]>>;
|
|
38
|
+
declare type RepresentableKeys<VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = { [KEY in Extract<keyof VALUE_EXCLUSION_RESULTS, string>]: ExclusionResult<VALUE_EXCLUSION_RESULTS[KEY]> extends NeverType ? never : KEY }[Extract<keyof VALUE_EXCLUSION_RESULTS, string>];
|
|
39
|
+
declare type PropagateExclusions<META_OBJECT extends ObjectType, VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = _Object<{ [KEY in keyof VALUE_EXCLUSION_RESULTS]: PropagateExclusion<VALUE_EXCLUSION_RESULTS[KEY]> }, ObjectRequiredKeys<META_OBJECT>, ObjectOpenProps<META_OBJECT>, IsObjectClosedOnResolve<META_OBJECT>, IsSerialized<META_OBJECT>, Deserialized<META_OBJECT>>;
|
|
40
|
+
declare type OmitOmittableKeys<META_OBJECT extends ObjectType, VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>, OMITTABLE_KEYS extends string = OmittableKeys<VALUE_EXCLUSION_RESULTS>, OMITTABLE_KEYS_COUNT extends string = GetUnionLength<OMITTABLE_KEYS>> = OMITTABLE_KEYS_COUNT extends "moreThanTwo" ? META_OBJECT : OMITTABLE_KEYS_COUNT extends "onlyOne" ? _Object<{ [KEY in keyof VALUE_EXCLUSION_RESULTS]: KEY extends OMITTABLE_KEYS ? Never : SourceValue<VALUE_EXCLUSION_RESULTS[KEY]> }, ObjectRequiredKeys<META_OBJECT>, ObjectOpenProps<META_OBJECT>, IsObjectClosedOnResolve<META_OBJECT>, IsSerialized<META_OBJECT>, Deserialized<META_OBJECT>> : Never;
|
|
41
|
+
declare type OmittableKeys<VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = { [KEY in Extract<keyof VALUE_EXCLUSION_RESULTS, string>]: IsOmittable<VALUE_EXCLUSION_RESULTS[KEY]> extends true ? KEY : never }[Extract<keyof VALUE_EXCLUSION_RESULTS, string>];
|
|
42
|
+
declare type ExcludeConstFromObject<META_OBJECT extends ObjectType, META_CONST extends ConstType, CONST_VALUE = ConstValue<META_CONST>> = If<IsObject<CONST_VALUE>, _$Exclude<META_OBJECT, _Object<{ [KEY in Extract<keyof CONST_VALUE, string>]: Const<CONST_VALUE[KEY]> }, Extract<keyof CONST_VALUE, string>, Never, IsObjectClosedOnResolve<META_OBJECT>, IsSerialized<META_CONST>, Deserialized<META_CONST>>>, META_OBJECT>;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { ExcludeFromObject };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Never, NeverType } from "../never.mjs";
|
|
2
|
+
import { ConstType } from "../const.mjs";
|
|
3
|
+
import { EnumType } from "../enum.mjs";
|
|
4
|
+
import { ObjectType } from "../object.mjs";
|
|
5
|
+
import { PrimitiveType, PrimitiveValue } from "../primitive.mjs";
|
|
6
|
+
import { TupleType } from "../tuple.mjs";
|
|
7
|
+
import { UnionType } from "../union.mjs";
|
|
8
|
+
import { Type } from "../type.mjs";
|
|
9
|
+
import { ArrayType } from "../array.mjs";
|
|
10
|
+
import { AnyType } from "../any.mjs";
|
|
11
|
+
import { ExcludeUnion } from "./union.mjs";
|
|
12
|
+
|
|
13
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/primitive.d.ts
|
|
14
|
+
declare type ExcludeFromPrimitive<META_PRIMITIVE extends PrimitiveType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_PRIMITIVE : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? META_PRIMITIVE : META_TYPE extends EnumType ? META_PRIMITIVE : META_TYPE extends PrimitiveType ? PrimitiveValue<META_PRIMITIVE> extends PrimitiveValue<META_TYPE> ? Never : META_PRIMITIVE : META_TYPE extends ArrayType ? META_PRIMITIVE : META_TYPE extends TupleType ? META_PRIMITIVE : META_TYPE extends ObjectType ? META_PRIMITIVE : META_TYPE extends UnionType ? ExcludeUnion<META_PRIMITIVE, META_TYPE> : Never : Never;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ExcludeFromPrimitive };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { And } from "../../utils/and.mjs";
|
|
2
|
+
import { DoesExtend } from "../../utils/extends.mjs";
|
|
3
|
+
import { If } from "../../utils/if.mjs";
|
|
4
|
+
import { Not } from "../../utils/not.mjs";
|
|
5
|
+
import { Tail } from "../../utils/tail.mjs";
|
|
6
|
+
import { Never, NeverType } from "../never.mjs";
|
|
7
|
+
import { Deserialized, IsSerialized } from "../utils.mjs";
|
|
8
|
+
import { Const, ConstType, ConstValue } from "../const.mjs";
|
|
9
|
+
import { EnumType } from "../enum.mjs";
|
|
10
|
+
import { ObjectType } from "../object.mjs";
|
|
11
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
12
|
+
import { $Tuple, IsTupleOpen, Tuple, TupleOpenProps, TupleType, TupleValues } from "../tuple.mjs";
|
|
13
|
+
import { UnionType } from "../union.mjs";
|
|
14
|
+
import { Type } from "../type.mjs";
|
|
15
|
+
import { ArrayType, ArrayValues } from "../array.mjs";
|
|
16
|
+
import { AnyType } from "../any.mjs";
|
|
17
|
+
import { ExcludeUnion } from "./union.mjs";
|
|
18
|
+
import { ExcludeEnum } from "./enum.mjs";
|
|
19
|
+
import { ExclusionResult, IsOmittable, IsOutsideOfExcludedScope, IsOutsideOfSourceScope, PropagateExclusion, SourceValue, ValueExclusionResult, ValueExclusionResultType } from "./utils.mjs";
|
|
20
|
+
import { _Exclude } from "./index.mjs";
|
|
21
|
+
|
|
22
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/tuple.d.ts
|
|
23
|
+
declare type ExcludeFromTuple<META_TUPLE extends TupleType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TUPLE : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? ExcludeConst<META_TUPLE, META_TYPE> : META_TYPE extends EnumType ? ExcludeEnum<META_TUPLE, META_TYPE> : META_TYPE extends PrimitiveType ? META_TUPLE : META_TYPE extends ArrayType ? ExcludeArray<META_TUPLE, META_TYPE> : META_TYPE extends TupleType ? ExcludeTuples<META_TUPLE, META_TYPE> : META_TYPE extends ObjectType ? META_TUPLE : META_TYPE extends UnionType ? ExcludeUnion<META_TUPLE, META_TYPE> : Never : Never;
|
|
24
|
+
declare type ExcludeArray<META_TUPLE extends TupleType, META_ARRAY extends ArrayType> = ExcludeTuples<META_TUPLE, Tuple<[], ArrayValues<META_ARRAY>, IsSerialized<META_ARRAY>, Deserialized<META_ARRAY>>>;
|
|
25
|
+
declare type ExcludeTuples<META_TUPLE_A extends TupleType, META_TUPLE_B extends TupleType, VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[] = ExcludeTupleValues<TupleValues<META_TUPLE_A>, TupleValues<META_TUPLE_B>, IsTupleOpen<META_TUPLE_A>, IsTupleOpen<META_TUPLE_B>, TupleOpenProps<META_TUPLE_A>, TupleOpenProps<META_TUPLE_B>>, REPRESENTABLE_VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[] = RepresentableExcludedValues<VALUE_EXCLUSION_RESULTS>, EXCLUDED_OPEN_PROPS = _Exclude<TupleOpenProps<META_TUPLE_A>, TupleOpenProps<META_TUPLE_B>>, IS_OPEN_PROPS_EXCLUSION_REPRESENTABLE = Not<DoesExtend<EXCLUDED_OPEN_PROPS, NeverType>>> = If<DoesTupleSizesMatch<META_TUPLE_A, META_TUPLE_B, VALUE_EXCLUSION_RESULTS>, {
|
|
26
|
+
moreThanTwo: META_TUPLE_A;
|
|
27
|
+
onlyOne: $Tuple<PropagateExclusions<VALUE_EXCLUSION_RESULTS>, TupleOpenProps<META_TUPLE_A>, IsSerialized<META_TUPLE_A>, Deserialized<META_TUPLE_A>>;
|
|
28
|
+
none: OmitOmittableExcludedItems<META_TUPLE_A, VALUE_EXCLUSION_RESULTS>;
|
|
29
|
+
}[And<IsTupleOpen<META_TUPLE_A>, IS_OPEN_PROPS_EXCLUSION_REPRESENTABLE> extends true ? "moreThanTwo" : GetTupleLength<REPRESENTABLE_VALUE_EXCLUSION_RESULTS>], META_TUPLE_A>;
|
|
30
|
+
declare type ExcludeTupleValues<META_TUPLE_A_VALUES extends Type[], META_TUPLE_B_VALUES extends Type[], IS_META_TUPLE_A_OPEN extends boolean, IS_META_TUPLE_B_OPEN extends boolean, META_TUPLE_A_OPEN_PROPS extends Type, META_TUPLE_B_OPEN_PROPS extends Type, VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[] = []> = META_TUPLE_A_VALUES extends [infer META_TUPLE_A_VALUES_HEAD, ...infer META_TUPLE_A_VALUES_TAIL] ? META_TUPLE_A_VALUES_HEAD extends Type ? META_TUPLE_A_VALUES_TAIL extends Type[] ? META_TUPLE_B_VALUES extends [infer META_TUPLE_B_VALUES_HEAD, ...infer META_TUPLE_B_VALUES_TAIL] ? META_TUPLE_B_VALUES_HEAD extends Type ? META_TUPLE_B_VALUES_TAIL extends Type[] ? ExcludeTupleValues<META_TUPLE_A_VALUES_TAIL, META_TUPLE_B_VALUES_TAIL, IS_META_TUPLE_A_OPEN, IS_META_TUPLE_B_OPEN, META_TUPLE_A_OPEN_PROPS, META_TUPLE_B_OPEN_PROPS, [...VALUE_EXCLUSION_RESULTS, ValueExclusionResult<META_TUPLE_A_VALUES_HEAD, true, true, META_TUPLE_B_VALUES_HEAD, true, true>]> : never : never : ExcludeTupleValues<META_TUPLE_A_VALUES_TAIL, [], IS_META_TUPLE_A_OPEN, IS_META_TUPLE_B_OPEN, META_TUPLE_A_OPEN_PROPS, META_TUPLE_B_OPEN_PROPS, [...VALUE_EXCLUSION_RESULTS, ValueExclusionResult<META_TUPLE_A_VALUES_HEAD, true, true, META_TUPLE_B_OPEN_PROPS, IS_META_TUPLE_B_OPEN, false>]> : never : never : META_TUPLE_B_VALUES extends [infer META_TUPLE_B_VALUES_HEAD, ...infer META_TUPLE_B_VALUES_TAIL] ? META_TUPLE_B_VALUES_HEAD extends Type ? META_TUPLE_B_VALUES_TAIL extends Type[] ? ExcludeTupleValues<[], META_TUPLE_B_VALUES_TAIL, IS_META_TUPLE_A_OPEN, IS_META_TUPLE_B_OPEN, META_TUPLE_A_OPEN_PROPS, META_TUPLE_B_OPEN_PROPS, [...VALUE_EXCLUSION_RESULTS, ValueExclusionResult<META_TUPLE_A_OPEN_PROPS, IS_META_TUPLE_A_OPEN, false, META_TUPLE_B_VALUES_HEAD, true, true>]> : never : never : VALUE_EXCLUSION_RESULTS;
|
|
31
|
+
declare type GetTupleLength<ANY_TUPLE extends unknown[], TAIL extends unknown[] = Tail<ANY_TUPLE>> = If<DoesExtend<ANY_TUPLE, []>, "none", If<DoesExtend<TAIL, []>, "onlyOne", "moreThanTwo">>;
|
|
32
|
+
declare type DoesTupleSizesMatch<META_TUPLE_A extends TupleType, META_TUPLE_B extends TupleType, VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[]> = If<And<IsTupleOpen<META_TUPLE_A>, Not<IsTupleOpen<META_TUPLE_B>>>, false, And<IsExcludedSmallEnough<VALUE_EXCLUSION_RESULTS>, IsExcludedBigEnough<VALUE_EXCLUSION_RESULTS>>>;
|
|
33
|
+
declare type IsExcludedSmallEnough<VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[]> = VALUE_EXCLUSION_RESULTS extends [infer VALUE_EXCLUSION_RESULTS_HEAD, ...infer VALUE_EXCLUSION_RESULTS_TAIL] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? If<IsOutsideOfSourceScope<VALUE_EXCLUSION_RESULTS_HEAD>, false, IsExcludedSmallEnough<VALUE_EXCLUSION_RESULTS_TAIL>> : never : never : true;
|
|
34
|
+
declare type IsExcludedBigEnough<VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[]> = VALUE_EXCLUSION_RESULTS extends [infer VALUE_EXCLUSION_RESULTS_HEAD, ...infer VALUE_EXCLUSION_RESULTS_TAIL] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? If<IsOutsideOfExcludedScope<VALUE_EXCLUSION_RESULTS_HEAD>, false, IsExcludedBigEnough<VALUE_EXCLUSION_RESULTS_TAIL>> : never : never : true;
|
|
35
|
+
declare type RepresentableExcludedValues<VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[], REPRESENTABLE_VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[] = []> = VALUE_EXCLUSION_RESULTS extends [infer VALUE_EXCLUSION_RESULTS_HEAD, ...infer VALUE_EXCLUSION_RESULTS_TAIL] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? ExclusionResult<VALUE_EXCLUSION_RESULTS_HEAD> extends NeverType ? RepresentableExcludedValues<VALUE_EXCLUSION_RESULTS_TAIL, REPRESENTABLE_VALUE_EXCLUSION_RESULTS> : RepresentableExcludedValues<VALUE_EXCLUSION_RESULTS_TAIL, [...REPRESENTABLE_VALUE_EXCLUSION_RESULTS, VALUE_EXCLUSION_RESULTS_HEAD]> : never : never : REPRESENTABLE_VALUE_EXCLUSION_RESULTS;
|
|
36
|
+
declare type PropagateExclusions<VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[], RESULT extends unknown[] = []> = VALUE_EXCLUSION_RESULTS extends [infer VALUE_EXCLUSION_RESULTS_HEAD, ...infer VALUE_EXCLUSION_RESULTS_TAIL] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? PropagateExclusions<VALUE_EXCLUSION_RESULTS_TAIL, [...RESULT, PropagateExclusion<VALUE_EXCLUSION_RESULTS_HEAD>]> : never : never : RESULT;
|
|
37
|
+
declare type OmitOmittableExcludedItems<META_TUPLE extends TupleType, ITEM_EXCLUSION_RESULTS extends ValueExclusionResultType[], OMITTABLE_ITEM_EXCLUSION_RESULTS extends ValueExclusionResultType[] = OmittableExcludedItems<ITEM_EXCLUSION_RESULTS>, OMITTABLE_ITEMS_COUNT extends string = GetTupleLength<OMITTABLE_ITEM_EXCLUSION_RESULTS>> = OMITTABLE_ITEMS_COUNT extends "moreThanTwo" ? META_TUPLE : OMITTABLE_ITEMS_COUNT extends "onlyOne" ? $Tuple<RequiredExcludedItems<ITEM_EXCLUSION_RESULTS>, Never, IsSerialized<META_TUPLE>, Deserialized<META_TUPLE>> : Never;
|
|
38
|
+
declare type OmittableExcludedItems<ITEM_EXCLUSION_RESULTS extends ValueExclusionResultType[], RESULT extends ValueExclusionResultType[] = []> = ITEM_EXCLUSION_RESULTS extends [infer VALUE_EXCLUSION_RESULTS_HEAD, ...infer VALUE_EXCLUSION_RESULTS_TAIL] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? If<IsOmittable<VALUE_EXCLUSION_RESULTS_HEAD>, OmittableExcludedItems<VALUE_EXCLUSION_RESULTS_TAIL, [...RESULT, VALUE_EXCLUSION_RESULTS_HEAD]>, OmittableExcludedItems<VALUE_EXCLUSION_RESULTS_TAIL, RESULT>> : never : never : RESULT;
|
|
39
|
+
declare type RequiredExcludedItems<ITEM_EXCLUSION_RESULTS extends ValueExclusionResultType[], RESULT extends Type[] = []> = ITEM_EXCLUSION_RESULTS extends [infer VALUE_EXCLUSION_RESULTS_HEAD, ...infer VALUE_EXCLUSION_RESULTS_TAIL] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? IsOmittable<VALUE_EXCLUSION_RESULTS_HEAD> extends true ? RESULT : RequiredExcludedItems<VALUE_EXCLUSION_RESULTS_TAIL, [...RESULT, SourceValue<VALUE_EXCLUSION_RESULTS_HEAD>]> : never : never : RESULT;
|
|
40
|
+
declare type ExcludeConst<META_TUPLE extends TupleType, META_CONST extends ConstType, META_CONST_VALUE = ConstValue<META_CONST>> = META_CONST_VALUE extends unknown[] ? _Exclude<META_TUPLE, $Tuple<ExtractConstValues<META_CONST_VALUE>, Never, IsSerialized<META_CONST>, Deserialized<META_CONST>>> : META_TUPLE;
|
|
41
|
+
declare type ExtractConstValues<CONST_VALUES extends unknown[], RESULT extends unknown[] = []> = CONST_VALUES extends [infer CONST_VALUES_HEAD, ...infer CONST_VALUES_TAIL] ? ExtractConstValues<CONST_VALUES_TAIL, [...RESULT, Const<CONST_VALUES_HEAD>]> : RESULT;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { ExcludeFromTuple };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { If } from "../../utils/if.mjs";
|
|
2
|
+
import { IsNever } from "../../utils/isNever.mjs";
|
|
3
|
+
import { UnionLast } from "../../utils/unionLast.mjs";
|
|
4
|
+
import { $Union, UnionType, UnionValues } from "../union.mjs";
|
|
5
|
+
import { $Intersect } from "../intersection/index.mjs";
|
|
6
|
+
import { _$Exclude } from "./index.mjs";
|
|
7
|
+
|
|
8
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/union.d.ts
|
|
9
|
+
declare type ExcludeFromUnion<META_UNION extends UnionType, META_TYPE> = $Union<UnionValues<META_UNION> extends infer META_UNION_VALUE ? _$Exclude<META_UNION_VALUE, META_TYPE> : never>;
|
|
10
|
+
declare type ExcludeUnion<META_TYPE, META_UNION extends UnionType> = If<IsNever<UnionValues<META_UNION>>, META_TYPE, RecurseOnUnionValues<META_TYPE, UnionLast<UnionValues<META_UNION>>, META_UNION>>;
|
|
11
|
+
declare type RecurseOnUnionValues<META_TYPE, META_UNION_VALUE, META_UNION extends UnionType> = $Intersect<_$Exclude<META_TYPE, META_UNION_VALUE>, _$Exclude<META_TYPE, $Union<Exclude<UnionValues<META_UNION>, META_UNION_VALUE>>>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ExcludeFromUnion, ExcludeUnion };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { And } from "../../utils/and.mjs";
|
|
2
|
+
import { Not } from "../../utils/not.mjs";
|
|
3
|
+
import { NeverType } from "../never.mjs";
|
|
4
|
+
import { Type } from "../type.mjs";
|
|
5
|
+
import { _$Exclude } from "./index.mjs";
|
|
6
|
+
|
|
7
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/utils.d.ts
|
|
8
|
+
declare type ValueExclusionResult<VALUE_A extends Type, IS_ALLOWED_IN_A extends boolean, IS_REQUIRED_IN_A extends boolean, VALUE_B extends Type, IS_ALLOWED_IN_B extends boolean, IS_REQUIRED_IN_B extends boolean> = {
|
|
9
|
+
sourceValue: VALUE_A;
|
|
10
|
+
isAllowedInSource: IS_ALLOWED_IN_A;
|
|
11
|
+
isRequiredInSource: IS_REQUIRED_IN_A;
|
|
12
|
+
isAllowedInExcluded: IS_ALLOWED_IN_B;
|
|
13
|
+
isRequiredInExcluded: IS_REQUIRED_IN_B;
|
|
14
|
+
exclusionResult: _$Exclude<VALUE_A, VALUE_B>;
|
|
15
|
+
};
|
|
16
|
+
declare type ValueExclusionResultType = {
|
|
17
|
+
sourceValue: Type;
|
|
18
|
+
isAllowedInSource: boolean;
|
|
19
|
+
isRequiredInSource: boolean;
|
|
20
|
+
isAllowedInExcluded: boolean;
|
|
21
|
+
isRequiredInExcluded: boolean;
|
|
22
|
+
exclusionResult: any;
|
|
23
|
+
};
|
|
24
|
+
declare type SourceValue<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["sourceValue"];
|
|
25
|
+
declare type IsAllowedInSource<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["isAllowedInSource"];
|
|
26
|
+
declare type IsRequiredInSource<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["isRequiredInSource"];
|
|
27
|
+
declare type ExclusionResult<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["exclusionResult"];
|
|
28
|
+
declare type IsAllowedInExcluded<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["isAllowedInExcluded"];
|
|
29
|
+
declare type IsRequiredInExcluded<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["isRequiredInExcluded"];
|
|
30
|
+
declare type IsOutsideOfSourceScope<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = And<Not<IsAllowedInSource<VALUE_EXCLUSION_RESULT>>, IsRequiredInExcluded<VALUE_EXCLUSION_RESULT>>;
|
|
31
|
+
declare type IsOutsideOfExcludedScope<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = And<IsRequiredInSource<VALUE_EXCLUSION_RESULT>, Not<IsAllowedInExcluded<VALUE_EXCLUSION_RESULT>>>;
|
|
32
|
+
declare type IsOmittable<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = And<Not<IsRequiredInSource<VALUE_EXCLUSION_RESULT>>, IsRequiredInExcluded<VALUE_EXCLUSION_RESULT>>;
|
|
33
|
+
declare type PropagateExclusion<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = ExclusionResult<VALUE_EXCLUSION_RESULT> extends NeverType ? SourceValue<VALUE_EXCLUSION_RESULT> : ExclusionResult<VALUE_EXCLUSION_RESULT>;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ExclusionResult, IsOmittable, IsOutsideOfExcludedScope, IsOutsideOfSourceScope, PropagateExclusion, SourceValue, ValueExclusionResult, ValueExclusionResultType };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Never, NeverType } from "../never.mjs";
|
|
2
|
+
import { ConstType } from "../const.mjs";
|
|
3
|
+
import { EnumType, EnumValues } from "../enum.mjs";
|
|
4
|
+
import { IsObjectClosedOnResolve, ObjectOpenProps, ObjectRequiredKeys, ObjectType, ObjectValues } from "../object.mjs";
|
|
5
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
6
|
+
import { TupleOpenProps, TupleType, TupleValues } from "../tuple.mjs";
|
|
7
|
+
import { UnionType } from "../union.mjs";
|
|
8
|
+
import { Type } from "../type.mjs";
|
|
9
|
+
import { ArrayType, ArrayValues } from "../array.mjs";
|
|
10
|
+
import { Any, AnyType } from "../any.mjs";
|
|
11
|
+
import { DistributeIntersection } from "./union.mjs";
|
|
12
|
+
import { IntersectDeserialized, IntersectIsSerialized } from "./utils.mjs";
|
|
13
|
+
import { IntersectConstSerializationParams } from "./const.mjs";
|
|
14
|
+
import { IntersectEnumSerializationParams } from "./enum.mjs";
|
|
15
|
+
import { IntersectTupleSerializationParams } from "./tuple.mjs";
|
|
16
|
+
import { IntersectArraySerializationParams } from "./array.mjs";
|
|
17
|
+
import { IntersectObjectSerializationParams } from "./object.mjs";
|
|
18
|
+
import { IntersectPrimitiveSerializationParams } from "./primitive.mjs";
|
|
19
|
+
|
|
20
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/any.d.ts
|
|
21
|
+
declare type IntersectAny<META_ANY extends AnyType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? Any<IntersectIsSerialized<META_ANY, META_TYPE>, IntersectDeserialized<META_ANY, META_TYPE>> : META_TYPE extends ConstType ? IntersectConstSerializationParams<META_TYPE, META_ANY> : META_TYPE extends EnumType ? IntersectEnumSerializationParams<EnumValues<META_TYPE>, META_TYPE, META_ANY> : META_TYPE extends PrimitiveType ? IntersectPrimitiveSerializationParams<META_TYPE, META_ANY> : META_TYPE extends ArrayType ? IntersectArraySerializationParams<ArrayValues<META_TYPE>, META_TYPE, META_ANY> : META_TYPE extends TupleType ? IntersectTupleSerializationParams<TupleValues<META_TYPE>, TupleOpenProps<META_TYPE>, META_TYPE, META_ANY> : META_TYPE extends ObjectType ? IntersectObjectSerializationParams<ObjectValues<META_TYPE>, ObjectRequiredKeys<META_TYPE>, ObjectOpenProps<META_TYPE>, IsObjectClosedOnResolve<META_TYPE>, META_TYPE, META_ANY> : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_ANY> : Never : Never;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { IntersectAny };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Never, NeverType } from "../never.mjs";
|
|
2
|
+
import { ConstType } from "../const.mjs";
|
|
3
|
+
import { EnumType } from "../enum.mjs";
|
|
4
|
+
import { ObjectType } from "../object.mjs";
|
|
5
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
6
|
+
import { TupleType } from "../tuple.mjs";
|
|
7
|
+
import { UnionType } from "../union.mjs";
|
|
8
|
+
import { SerializableType, Type } from "../type.mjs";
|
|
9
|
+
import { ArrayType, ArrayValues, _$Array } from "../array.mjs";
|
|
10
|
+
import { AnyType } from "../any.mjs";
|
|
11
|
+
import { DistributeIntersection } from "./union.mjs";
|
|
12
|
+
import { IntersectDeserialized, IntersectIsSerialized } from "./utils.mjs";
|
|
13
|
+
import { IntersectConstToArray } from "./const.mjs";
|
|
14
|
+
import { IntersectEnumToArray } from "./enum.mjs";
|
|
15
|
+
import { IntersectTupleToArray } from "./tuple.mjs";
|
|
16
|
+
import { Intersect } from "./index.mjs";
|
|
17
|
+
|
|
18
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/array.d.ts
|
|
19
|
+
declare type IntersectArraySerializationParams<VALUES extends Type, META_ARRAY extends ArrayType, SERIALIZABLE_META_TYPE extends SerializableType> = $MergeArrayValuesToSerializable<VALUES, META_ARRAY, SERIALIZABLE_META_TYPE>;
|
|
20
|
+
declare type $MergeArrayValuesToSerializable<VALUES, META_ARRAY extends ArrayType, SERIALIZABLE_META_TYPE extends SerializableType> = _$Array<VALUES, IntersectIsSerialized<META_ARRAY, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_ARRAY, SERIALIZABLE_META_TYPE>>;
|
|
21
|
+
declare type IntersectArray<META_ARRAY extends ArrayType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectArraySerializationParams<ArrayValues<META_ARRAY>, META_ARRAY, META_TYPE> : META_TYPE extends ConstType ? IntersectConstToArray<META_TYPE, META_ARRAY> : META_TYPE extends EnumType ? IntersectEnumToArray<META_TYPE, META_ARRAY> : META_TYPE extends PrimitiveType ? Never : META_TYPE extends ArrayType ? IntersectArrays<META_ARRAY, META_TYPE> : META_TYPE extends TupleType ? IntersectTupleToArray<META_TYPE, META_ARRAY> : META_TYPE extends ObjectType ? Never : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_ARRAY> : Never : Never;
|
|
22
|
+
declare type IntersectArrays<META_ARRAY_A extends ArrayType, META_ARRAY_B extends ArrayType> = $MergeArrayValuesToSerializable<Intersect<ArrayValues<META_ARRAY_A>, ArrayValues<META_ARRAY_B>>, META_ARRAY_A, META_ARRAY_B>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { IntersectArray, IntersectArraySerializationParams };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IsObject } from "../../utils/extends.mjs";
|
|
2
|
+
import { If } from "../../utils/if.mjs";
|
|
3
|
+
import { IsNever } from "../../utils/isNever.mjs";
|
|
4
|
+
import { Never, NeverType } from "../never.mjs";
|
|
5
|
+
import { Const, ConstType, ConstValue } from "../const.mjs";
|
|
6
|
+
import { EnumType } from "../enum.mjs";
|
|
7
|
+
import { ObjectRequiredKeys, ObjectType, ObjectValue } from "../object.mjs";
|
|
8
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
9
|
+
import { TupleType } from "../tuple.mjs";
|
|
10
|
+
import { UnionType } from "../union.mjs";
|
|
11
|
+
import { SerializableType, Type } from "../type.mjs";
|
|
12
|
+
import { ArrayType } from "../array.mjs";
|
|
13
|
+
import { Resolve } from "../resolve.mjs";
|
|
14
|
+
import { AnyType } from "../any.mjs";
|
|
15
|
+
import { DistributeIntersection } from "./union.mjs";
|
|
16
|
+
import { IntersectDeserialized, IntersectIsSerialized } from "./utils.mjs";
|
|
17
|
+
import { Intersect } from "./index.mjs";
|
|
18
|
+
|
|
19
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/const.d.ts
|
|
20
|
+
declare type IntersectConstSerializationParams<META_CONST extends ConstType, SERIALIZABLE_META_TYPE extends SerializableType> = Const<ConstValue<META_CONST>, IntersectIsSerialized<META_CONST, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_CONST, SERIALIZABLE_META_TYPE>>;
|
|
21
|
+
declare type IntersectConst<META_CONST extends ConstType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectConstSerializationParams<META_CONST, META_TYPE> : META_TYPE extends ConstType ? CheckExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends EnumType ? IntersectConstToEnum<META_CONST, META_TYPE> : META_TYPE extends PrimitiveType ? IntersectConstToPrimitive<META_CONST, META_TYPE> : META_TYPE extends ArrayType ? IntersectConstToArray<META_CONST, META_TYPE> : META_TYPE extends TupleType ? IntersectConstToTuple<META_CONST, META_TYPE> : META_TYPE extends ObjectType ? IntersectConstToObject<META_CONST, META_TYPE> : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_CONST> : Never : Never;
|
|
22
|
+
declare type CheckExtendsResolved<META_CONST extends ConstType, SERIALIZABLE_META_TYPE extends SerializableType> = ConstValue<META_CONST> extends Resolve<SERIALIZABLE_META_TYPE, {
|
|
23
|
+
deserialize: false;
|
|
24
|
+
}> ? IntersectConstSerializationParams<META_CONST, SERIALIZABLE_META_TYPE> : Never;
|
|
25
|
+
declare type IntersectConstToEnum<META_CONST extends ConstType, META_ENUM extends EnumType> = CheckExtendsResolved<META_CONST, META_ENUM>;
|
|
26
|
+
declare type IntersectConstToPrimitive<META_CONST extends ConstType, META_PRIMITIVE extends PrimitiveType> = CheckExtendsResolved<META_CONST, META_PRIMITIVE>;
|
|
27
|
+
declare type IntersectConstToArray<META_CONST extends ConstType, META_ARRAY extends ArrayType> = CheckExtendsResolved<META_CONST, META_ARRAY>;
|
|
28
|
+
declare type IntersectConstToTuple<META_CONST extends ConstType, META_TUPLE extends TupleType> = CheckExtendsResolved<META_CONST, META_TUPLE>;
|
|
29
|
+
declare type IntersectConstToObject<META_CONST extends ConstType, META_OBJECT extends ObjectType> = If<IsObject<ConstValue<META_CONST>>, IntersectObjectConstToObject<META_CONST, META_OBJECT>, Never>;
|
|
30
|
+
declare type IntersectObjectConstToObject<META_CONST extends ConstType, META_OBJECT extends ObjectType, INTERSECTED_META_OBJECT = IntersectConstValuesToObjectValues<ConstValue<META_CONST>, META_OBJECT>> = If<IsNever<NeverKeys<INTERSECTED_META_OBJECT>>, IntersectConstSerializationParams<META_CONST, META_OBJECT>, Never>;
|
|
31
|
+
declare type IntersectConstValuesToObjectValues<CONST_VALUE, META_OBJECT extends ObjectType> = { [KEY in Extract<keyof CONST_VALUE | ObjectRequiredKeys<META_OBJECT>, string>]: KEY extends keyof CONST_VALUE ? Intersect<Const<CONST_VALUE[KEY]>, ObjectValue<META_OBJECT, KEY>> : Never };
|
|
32
|
+
declare type NeverKeys<META_OBJECT> = { [KEY in keyof META_OBJECT]: META_OBJECT[KEY] extends Never ? KEY : never }[keyof META_OBJECT];
|
|
33
|
+
//#endregion
|
|
34
|
+
export { IntersectConst, IntersectConstSerializationParams, IntersectConstToArray, IntersectConstToEnum, IntersectConstToObject, IntersectConstToPrimitive, IntersectConstToTuple };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Never, NeverType } from "../never.mjs";
|
|
2
|
+
import { Const, ConstType } from "../const.mjs";
|
|
3
|
+
import { Enum, EnumType, EnumValues } from "../enum.mjs";
|
|
4
|
+
import { ObjectType } from "../object.mjs";
|
|
5
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
6
|
+
import { TupleType } from "../tuple.mjs";
|
|
7
|
+
import { UnionType } from "../union.mjs";
|
|
8
|
+
import { SerializableType, Type } from "../type.mjs";
|
|
9
|
+
import { ArrayType } from "../array.mjs";
|
|
10
|
+
import { AnyType } from "../any.mjs";
|
|
11
|
+
import { DistributeIntersection } from "./union.mjs";
|
|
12
|
+
import { IntersectDeserialized, IntersectIsSerialized } from "./utils.mjs";
|
|
13
|
+
import { IntersectConstToEnum } from "./const.mjs";
|
|
14
|
+
import { $Intersect } from "./index.mjs";
|
|
15
|
+
|
|
16
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/enum.d.ts
|
|
17
|
+
declare type IntersectEnumSerializationParams<META_ENUM_VALUES, META_ENUM extends EnumType, SERIALIZABLE_META_TYPE extends SerializableType> = Enum<META_ENUM_VALUES, IntersectIsSerialized<META_ENUM, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_ENUM, SERIALIZABLE_META_TYPE>>;
|
|
18
|
+
declare type IntersectEnum<META_ENUM extends EnumType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectEnumSerializationParams<EnumValues<META_ENUM>, META_ENUM, META_TYPE> : META_TYPE extends ConstType ? IntersectConstToEnum<META_TYPE, META_ENUM> : META_TYPE extends EnumType ? FilterEnum<META_ENUM, META_TYPE> : META_TYPE extends PrimitiveType ? IntersectEnumToPrimitive<META_ENUM, META_TYPE> : META_TYPE extends ArrayType ? FilterEnum<META_ENUM, META_TYPE> : META_TYPE extends TupleType ? FilterEnum<META_ENUM, META_TYPE> : META_TYPE extends ObjectType ? FilterEnum<META_ENUM, META_TYPE> : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_ENUM> : Never : Never;
|
|
19
|
+
declare type FilterEnum<META_ENUM extends EnumType, SERIALIZABLE_META_TYPE extends SerializableType> = IntersectEnumSerializationParams<FilterEnumValues<EnumValues<META_ENUM>, SERIALIZABLE_META_TYPE>, META_ENUM, SERIALIZABLE_META_TYPE>;
|
|
20
|
+
declare type FilterEnumValues<ENUM_VALUES, SERIALIZABLE_META_TYPE> = ENUM_VALUES extends infer ENUM_VALUE ? $Intersect<Const<ENUM_VALUE>, SERIALIZABLE_META_TYPE> extends Never ? never : ENUM_VALUE : never;
|
|
21
|
+
declare type IntersectEnumToPrimitive<META_ENUM extends EnumType, META_PRIMITIVE extends PrimitiveType> = FilterEnum<META_ENUM, META_PRIMITIVE>;
|
|
22
|
+
declare type IntersectEnumToArray<META_ENUM extends EnumType, META_ARRAY extends ArrayType> = FilterEnum<META_ENUM, META_ARRAY>;
|
|
23
|
+
declare type IntersectEnumToTuple<META_ENUM extends EnumType, META_TUPLE extends TupleType> = FilterEnum<META_ENUM, META_TUPLE>;
|
|
24
|
+
declare type IntersectEnumToObject<META_ENUM extends EnumType, META_OBJECT extends ObjectType> = FilterEnum<META_ENUM, META_OBJECT>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { IntersectEnum, IntersectEnumSerializationParams, IntersectEnumToArray, IntersectEnumToObject, IntersectEnumToPrimitive, IntersectEnumToTuple };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Never, NeverType } from "../never.mjs";
|
|
2
|
+
import { ConstType } from "../const.mjs";
|
|
3
|
+
import { EnumType } from "../enum.mjs";
|
|
4
|
+
import { ObjectType } from "../object.mjs";
|
|
5
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
6
|
+
import { TupleType } from "../tuple.mjs";
|
|
7
|
+
import { UnionType } from "../union.mjs";
|
|
8
|
+
import { Type } from "../type.mjs";
|
|
9
|
+
import { ArrayType } from "../array.mjs";
|
|
10
|
+
import { AnyType } from "../any.mjs";
|
|
11
|
+
import { IntersectUnion } from "./union.mjs";
|
|
12
|
+
import { IntersectConst } from "./const.mjs";
|
|
13
|
+
import { IntersectEnum } from "./enum.mjs";
|
|
14
|
+
import { IntersectTuple } from "./tuple.mjs";
|
|
15
|
+
import { IntersectArray } from "./array.mjs";
|
|
16
|
+
import { IntersectObject } from "./object.mjs";
|
|
17
|
+
import { IntersectPrimitive } from "./primitive.mjs";
|
|
18
|
+
import { IntersectAny } from "./any.mjs";
|
|
19
|
+
|
|
20
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.d.ts
|
|
21
|
+
declare type Intersect<META_TYPE_A extends Type, META_TYPE_B extends Type> = $Intersect<META_TYPE_A, META_TYPE_B>;
|
|
22
|
+
declare type $Intersect<META_TYPE_A, META_TYPE_B> = META_TYPE_A extends NeverType ? META_TYPE_A : META_TYPE_A extends AnyType ? IntersectAny<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ConstType ? IntersectConst<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends EnumType ? IntersectEnum<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends PrimitiveType ? IntersectPrimitive<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ArrayType ? IntersectArray<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends TupleType ? IntersectTuple<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ObjectType ? IntersectObject<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends UnionType ? IntersectUnion<META_TYPE_A, META_TYPE_B> : Never;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { $Intersect, Intersect };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Or } from "../../utils/or.mjs";
|
|
2
|
+
import { Never, NeverType } from "../never.mjs";
|
|
3
|
+
import { ConstType } from "../const.mjs";
|
|
4
|
+
import { EnumType } from "../enum.mjs";
|
|
5
|
+
import { IsObjectClosedOnResolve, ObjectOpenProps, ObjectRequiredKeys, ObjectType, ObjectValue, ObjectValues, _$Object } from "../object.mjs";
|
|
6
|
+
import { PrimitiveType } from "../primitive.mjs";
|
|
7
|
+
import { TupleType } from "../tuple.mjs";
|
|
8
|
+
import { UnionType } from "../union.mjs";
|
|
9
|
+
import { SerializableType, Type } from "../type.mjs";
|
|
10
|
+
import { ArrayType } from "../array.mjs";
|
|
11
|
+
import { AnyType } from "../any.mjs";
|
|
12
|
+
import { DistributeIntersection } from "./union.mjs";
|
|
13
|
+
import { IntersectDeserialized, IntersectIsSerialized } from "./utils.mjs";
|
|
14
|
+
import { IntersectConstToObject } from "./const.mjs";
|
|
15
|
+
import { IntersectEnumToObject } from "./enum.mjs";
|
|
16
|
+
import { $Intersect, Intersect } from "./index.mjs";
|
|
17
|
+
|
|
18
|
+
//#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/object.d.ts
|
|
19
|
+
declare type IntersectObjectSerializationParams<VALUES extends Record<string, Type>, REQUIRED_KEYS extends string, OPEN_PROPS extends Type, CLOSE_ON_RESOLVE extends boolean, META_OBJECT extends ObjectType, SERIALIZABLE_META_TYPE extends SerializableType> = $MergeObjectPropsToSerializable<VALUES, REQUIRED_KEYS, OPEN_PROPS, CLOSE_ON_RESOLVE, META_OBJECT, SERIALIZABLE_META_TYPE>;
|
|
20
|
+
declare type $MergeObjectPropsToSerializable<VALUES, REQUIRED_KEYS, OPEN_PROPS, CLOSE_ON_RESOLVE, META_OBJECT extends ObjectType, SERIALIZABLE_META_TYPE extends SerializableType> = _$Object<VALUES, REQUIRED_KEYS, OPEN_PROPS, CLOSE_ON_RESOLVE, IntersectIsSerialized<META_OBJECT, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_OBJECT, SERIALIZABLE_META_TYPE>>;
|
|
21
|
+
declare type IntersectObject<META_OBJECT extends ObjectType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectObjectSerializationParams<ObjectValues<META_OBJECT>, ObjectRequiredKeys<META_OBJECT>, ObjectOpenProps<META_OBJECT>, IsObjectClosedOnResolve<META_OBJECT>, META_OBJECT, META_TYPE> : META_TYPE extends ConstType ? IntersectConstToObject<META_TYPE, META_OBJECT> : META_TYPE extends EnumType ? IntersectEnumToObject<META_TYPE, META_OBJECT> : META_TYPE extends PrimitiveType ? Never : META_TYPE extends ArrayType ? Never : META_TYPE extends TupleType ? Never : META_TYPE extends ObjectType ? IntersectObjects<META_OBJECT, META_TYPE> : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_OBJECT> : Never : Never;
|
|
22
|
+
declare type IntersectObjects<META_OBJECT_A extends ObjectType, META_OBJECT_B extends ObjectType, INTERSECTED_VALUES extends Record<string, unknown> = IntersectObjectsValues<META_OBJECT_A, META_OBJECT_B>, INTERSECTED_OPEN_PROPS = Intersect<ObjectOpenProps<META_OBJECT_A>, ObjectOpenProps<META_OBJECT_B>>, INTERSECTED_CLOSE_ON_RESOLVE = Or<IsObjectClosedOnResolve<META_OBJECT_A>, IsObjectClosedOnResolve<META_OBJECT_B>>> = $MergeObjectPropsToSerializable<{ [KEY in keyof INTERSECTED_VALUES]: INTERSECTED_VALUES[KEY] }, ObjectRequiredKeys<META_OBJECT_A> | ObjectRequiredKeys<META_OBJECT_B>, INTERSECTED_OPEN_PROPS, INTERSECTED_CLOSE_ON_RESOLVE, META_OBJECT_A, META_OBJECT_B>;
|
|
23
|
+
declare type IntersectObjectsValues<META_OBJECT_A extends ObjectType, META_OBJECT_B extends ObjectType> = { [KEY in Extract<keyof ObjectValues<META_OBJECT_A> | keyof ObjectValues<META_OBJECT_B>, string>]: $Intersect<ObjectValue<META_OBJECT_A, KEY>, ObjectValue<META_OBJECT_B, KEY>> };
|
|
24
|
+
//#endregion
|
|
25
|
+
export { IntersectObject, IntersectObjectSerializationParams };
|