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.
Files changed (91) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +16 -10
  3. package/lib/createRule.d.mts +9 -5
  4. package/lib/index.d.mts +2 -2
  5. package/lib/node_modules/.pnpm/@types_estree@1.0.8/node_modules/@types/estree/index.d.mts +438 -0
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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
  38. 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
  39. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.d.mts +20 -0
  40. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.d.mts +28 -0
  41. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/const.d.mts +25 -0
  42. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/enum.d.mts +25 -0
  43. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/any.d.mts +16 -0
  44. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/array.d.mts +20 -0
  45. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/const.d.mts +28 -0
  46. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/enum.d.mts +23 -0
  47. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/index.d.mts +24 -0
  48. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/object.d.mts +44 -0
  49. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/primitive.d.mts +16 -0
  50. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/tuple.d.mts +43 -0
  51. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/union.d.mts +13 -0
  52. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/utils.d.mts +35 -0
  53. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/any.d.mts +23 -0
  54. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/array.d.mts +24 -0
  55. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/const.d.mts +34 -0
  56. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/enum.d.mts +26 -0
  57. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.d.mts +24 -0
  58. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/object.d.mts +25 -0
  59. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/primitive.d.mts +23 -0
  60. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/tuple.d.mts +26 -0
  61. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/union.d.mts +17 -0
  62. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/utils.d.mts +10 -0
  63. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.d.mts +9 -0
  64. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/object.d.mts +49 -0
  65. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/primitive.d.mts +26 -0
  66. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/resolve.d.mts +22 -0
  67. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/tuple.d.mts +36 -0
  68. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/type.d.mts +18 -0
  69. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.d.mts +23 -0
  70. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/utils.d.mts +7 -0
  71. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/and.d.mts +4 -0
  72. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/extends.d.mts +7 -0
  73. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/if.d.mts +4 -0
  74. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/intersectUnion.d.mts +4 -0
  75. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/isNever.d.mts +4 -0
  76. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/merge.d.mts +6 -0
  77. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/not.d.mts +4 -0
  78. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/or.d.mts +4 -0
  79. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/prettify.d.mts +6 -0
  80. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/tail.d.mts +4 -0
  81. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionLast.d.mts +6 -0
  82. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionPop.d.mts +6 -0
  83. package/lib/plugin.d.mts +3 -4
  84. package/lib/plugin.mjs +3 -3
  85. package/lib/rules/no-empty-fields.mjs +2 -2
  86. package/lib/rules/repository-shorthand.mjs +3 -3
  87. package/lib/rules/require-attribution.d.mts +5 -0
  88. package/lib/rules/require-attribution.mjs +23 -7
  89. package/lib/rules/require-properties.mjs +14 -5
  90. package/lib/rules/restrict-private-properties.mjs +2 -2
  91. package/package.json +15 -15
@@ -0,0 +1,23 @@
1
+ import { And } from "../../utils/and.mjs";
2
+ import { DoesExtend } from "../../utils/extends.mjs";
3
+ import { If } from "../../utils/if.mjs";
4
+ import { Never, NeverType } from "../never.mjs";
5
+ import { ConstType } from "../const.mjs";
6
+ import { EnumType } from "../enum.mjs";
7
+ import { ObjectType } from "../object.mjs";
8
+ import { Primitive, PrimitiveType, PrimitiveValue } 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 { AnyType } from "../any.mjs";
14
+ import { DistributeIntersection } from "./union.mjs";
15
+ import { IntersectDeserialized, IntersectIsSerialized } from "./utils.mjs";
16
+ import { IntersectConstToPrimitive } from "./const.mjs";
17
+ import { IntersectEnumToPrimitive } from "./enum.mjs";
18
+
19
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/primitive.d.ts
20
+ declare type IntersectPrimitiveSerializationParams<META_PRIMITIVE extends PrimitiveType, SERIALIZABLE_META_TYPE extends SerializableType> = Primitive<PrimitiveValue<META_PRIMITIVE>, IntersectIsSerialized<META_PRIMITIVE, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_PRIMITIVE, SERIALIZABLE_META_TYPE>>;
21
+ declare type IntersectPrimitive<META_PRIMITIVE extends PrimitiveType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectPrimitiveSerializationParams<META_PRIMITIVE, META_TYPE> : META_TYPE extends ConstType ? IntersectConstToPrimitive<META_TYPE, META_PRIMITIVE> : META_TYPE extends EnumType ? IntersectEnumToPrimitive<META_TYPE, META_PRIMITIVE> : META_TYPE extends PrimitiveType ? If<And<DoesExtend<PrimitiveValue<META_PRIMITIVE>, PrimitiveValue<META_TYPE>>, DoesExtend<PrimitiveValue<META_TYPE>, PrimitiveValue<META_PRIMITIVE>>>, IntersectPrimitiveSerializationParams<META_PRIMITIVE, META_TYPE>, Never> : META_TYPE extends ArrayType ? Never : META_TYPE extends TupleType ? Never : META_TYPE extends ObjectType ? Never : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_PRIMITIVE> : Never : Never;
22
+ //#endregion
23
+ export { IntersectPrimitive, IntersectPrimitiveSerializationParams };
@@ -0,0 +1,26 @@
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 { $Tuple, IsTupleOpen, TupleOpenProps, TupleType, TupleValues } from "../tuple.mjs";
7
+ import { UnionType } from "../union.mjs";
8
+ import { SerializableType, Type } from "../type.mjs";
9
+ import { ArrayType, ArrayValues } from "../array.mjs";
10
+ import { AnyType } from "../any.mjs";
11
+ import { DistributeIntersection } from "./union.mjs";
12
+ import { IntersectDeserialized, IntersectIsSerialized } from "./utils.mjs";
13
+ import { IntersectConstToTuple } from "./const.mjs";
14
+ import { IntersectEnumToTuple } from "./enum.mjs";
15
+ import { $Intersect, Intersect } from "./index.mjs";
16
+
17
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/tuple.d.ts
18
+ declare type IntersectTupleSerializationParams<VALUES extends Type[], OPEN_PROPS extends Type, META_TUPLE extends TupleType, SERIALIZABLE_META_TYPE extends SerializableType> = $MergeTuplePropsToSerializable<VALUES, OPEN_PROPS, META_TUPLE, SERIALIZABLE_META_TYPE>;
19
+ declare type $MergeTuplePropsToSerializable<VALUES, OPEN_PROPS, META_TUPLE extends TupleType, SERIALIZABLE_META_TYPE extends SerializableType> = $Tuple<VALUES, OPEN_PROPS, IntersectIsSerialized<META_TUPLE, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_TUPLE, SERIALIZABLE_META_TYPE>>;
20
+ declare type IntersectTuple<META_TUPLE extends TupleType, META_TYPE> = META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectTupleSerializationParams<TupleValues<META_TUPLE>, TupleOpenProps<META_TUPLE>, META_TUPLE, META_TYPE> : META_TYPE extends ConstType ? IntersectConstToTuple<META_TYPE, META_TUPLE> : META_TYPE extends EnumType ? IntersectEnumToTuple<META_TYPE, META_TUPLE> : META_TYPE extends PrimitiveType ? Never : META_TYPE extends ArrayType ? IntersectTupleToArray<META_TUPLE, META_TYPE> : META_TYPE extends TupleType ? IntersectTuples<META_TUPLE, META_TYPE> : META_TYPE extends ObjectType ? Never : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_TUPLE> : Never;
21
+ declare type IntersectTupleToArray<META_TUPLE extends TupleType, META_ARRAY extends ArrayType, INTERSECTED_VALUES extends unknown[] = IntersectTupleToArrayValues<TupleValues<META_TUPLE>, ArrayValues<META_ARRAY>>, INTERSECTED_OPEN_PROPS = $Intersect<TupleOpenProps<META_TUPLE>, ArrayValues<META_ARRAY>>> = $MergeTuplePropsToSerializable<INTERSECTED_VALUES, INTERSECTED_OPEN_PROPS, META_TUPLE, META_ARRAY>;
22
+ declare type IntersectTupleToArrayValues<TUPLE_VALUES extends Type[], ARRAY_VALUES extends Type, RESULT extends unknown[] = []> = TUPLE_VALUES extends [infer TUPLE_VALUES_HEAD, ...infer TUPLE_VALUES_TAIL] ? TUPLE_VALUES_HEAD extends Type ? TUPLE_VALUES_TAIL extends Type[] ? IntersectTupleToArrayValues<TUPLE_VALUES_TAIL, ARRAY_VALUES, [...RESULT, Intersect<TUPLE_VALUES_HEAD, ARRAY_VALUES>]> : never : never : RESULT;
23
+ declare type IntersectTuples<META_TUPLE_A extends TupleType, META_TUPLE_B extends TupleType, INTERSECTED_VALUES extends unknown[] = IntersectTupleValues<TupleValues<META_TUPLE_A>, TupleValues<META_TUPLE_B>, IsTupleOpen<META_TUPLE_A>, IsTupleOpen<META_TUPLE_B>, TupleOpenProps<META_TUPLE_A>, TupleOpenProps<META_TUPLE_B>>, INTERSECTED_OPEN_PROPS = $Intersect<TupleOpenProps<META_TUPLE_A>, TupleOpenProps<META_TUPLE_B>>> = $MergeTuplePropsToSerializable<INTERSECTED_VALUES, INTERSECTED_OPEN_PROPS, META_TUPLE_A, META_TUPLE_B>;
24
+ declare type IntersectTupleValues<TUPLE_A_VALUES extends Type[], TUPLE_B_VALUES extends Type[], TUPLE_A_IS_OPEN extends boolean, TUPLE_B_IS_OPEN extends boolean, TUPLE_A_OPEN_PROPS extends Type, TUPLE_B_OPEN_PROPS extends Type, RESULT extends unknown[] = []> = TUPLE_A_VALUES extends [infer TUPLE_A_VALUES_HEAD, ...infer TUPLE_A_VALUES_TAIL] ? TUPLE_A_VALUES_HEAD extends Type ? TUPLE_A_VALUES_TAIL extends Type[] ? TUPLE_B_VALUES extends [infer TUPLE_B_VALUES_HEAD, ...infer TUPLE_B_VALUES_TAIL] ? TUPLE_B_VALUES_HEAD extends Type ? TUPLE_B_VALUES_TAIL extends Type[] ? IntersectTupleValues<TUPLE_A_VALUES_TAIL, TUPLE_B_VALUES_TAIL, TUPLE_A_IS_OPEN, TUPLE_B_IS_OPEN, TUPLE_A_OPEN_PROPS, TUPLE_B_OPEN_PROPS, [...RESULT, Intersect<TUPLE_A_VALUES_HEAD, TUPLE_B_VALUES_HEAD>]> : never : never : IntersectTupleValues<TUPLE_A_VALUES_TAIL, TUPLE_B_VALUES, TUPLE_A_IS_OPEN, TUPLE_B_IS_OPEN, TUPLE_A_OPEN_PROPS, TUPLE_B_OPEN_PROPS, [...RESULT, TUPLE_B_IS_OPEN extends true ? Intersect<TUPLE_A_VALUES_HEAD, TUPLE_B_OPEN_PROPS> : Never]> : never : never : TUPLE_B_VALUES extends [infer TUPLE_B_VALUES_HEAD, ...infer TUPLE_B_VALUES_TAIL] ? TUPLE_B_VALUES_HEAD extends Type ? TUPLE_B_VALUES_TAIL extends Type[] ? IntersectTupleValues<TUPLE_A_VALUES, TUPLE_B_VALUES_TAIL, TUPLE_A_IS_OPEN, TUPLE_B_IS_OPEN, TUPLE_A_OPEN_PROPS, TUPLE_B_OPEN_PROPS, [...RESULT, TUPLE_A_IS_OPEN extends true ? Intersect<TUPLE_B_VALUES_HEAD, TUPLE_A_OPEN_PROPS> : Never]> : never : never : RESULT;
25
+ //#endregion
26
+ export { IntersectTuple, IntersectTupleSerializationParams, IntersectTupleToArray };
@@ -0,0 +1,17 @@
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 { $Union, UnionType, UnionValues } from "../union.mjs";
8
+ import { Type } from "../type.mjs";
9
+ import { ArrayType } from "../array.mjs";
10
+ import { AnyType } from "../any.mjs";
11
+ import { $Intersect } from "./index.mjs";
12
+
13
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/union.d.ts
14
+ declare type IntersectUnion<META_UNION extends UnionType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? META_UNION : META_TYPE extends ConstType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends EnumType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends PrimitiveType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends ArrayType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends TupleType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends ObjectType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends UnionType ? DistributeIntersection<META_UNION, META_TYPE> : Never : Never;
15
+ declare type DistributeIntersection<META_UNION extends UnionType, META_TYPE> = $Union<UnionValues<META_UNION> extends infer UNION_VALUE ? $Intersect<UNION_VALUE, META_TYPE> : never>;
16
+ //#endregion
17
+ export { DistributeIntersection, IntersectUnion };
@@ -0,0 +1,10 @@
1
+ import { If } from "../../utils/if.mjs";
2
+ import { Or } from "../../utils/or.mjs";
3
+ import { Deserialized, IsSerialized } from "../utils.mjs";
4
+ import { SerializableType } from "../type.mjs";
5
+
6
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/utils.d.ts
7
+ declare type IntersectIsSerialized<SERIALIZABLE_META_TYPE_A extends SerializableType, SERIALIZABLE_META_TYPE_B extends SerializableType> = Or<IsSerialized<SERIALIZABLE_META_TYPE_A>, IsSerialized<SERIALIZABLE_META_TYPE_B>>;
8
+ declare type IntersectDeserialized<SERIALIZABLE_META_TYPE_A extends SerializableType, SERIALIZABLE_META_TYPE_B extends SerializableType> = If<IsSerialized<SERIALIZABLE_META_TYPE_A>, If<IsSerialized<SERIALIZABLE_META_TYPE_B>, Deserialized<SERIALIZABLE_META_TYPE_A> & Deserialized<SERIALIZABLE_META_TYPE_B>, Deserialized<SERIALIZABLE_META_TYPE_A>>, If<IsSerialized<SERIALIZABLE_META_TYPE_B>, Deserialized<SERIALIZABLE_META_TYPE_B>>>;
9
+ //#endregion
10
+ export { IntersectDeserialized, IntersectIsSerialized };
@@ -0,0 +1,9 @@
1
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.d.ts
2
+ declare type NeverTypeId = "never";
3
+ declare type Never = {
4
+ type: NeverTypeId;
5
+ };
6
+ declare type NeverType = Never;
7
+ declare type ResolveNever = never;
8
+ //#endregion
9
+ export { Never, NeverType, ResolveNever };
@@ -0,0 +1,49 @@
1
+ import { And } from "../utils/and.mjs";
2
+ import { DoesExtend } from "../utils/extends.mjs";
3
+ import { If } from "../utils/if.mjs";
4
+ import { IsNever } from "../utils/isNever.mjs";
5
+ import { DeepMergeUnsafe } from "../utils/merge.mjs";
6
+ import { Not } from "../utils/not.mjs";
7
+ import { Never, NeverType } from "./never.mjs";
8
+ import { Deserialized, IsSerialized } from "./utils.mjs";
9
+ import { Type } from "./type.mjs";
10
+ import { Resolve, ResolveOptions } from "./resolve.mjs";
11
+ import { Any } from "./any.mjs";
12
+
13
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/object.d.ts
14
+ declare type ObjectTypeId = "object";
15
+ declare type _Object<VALUES extends Record<string, Type> = {}, REQUIRED_KEYS extends string = never, OPEN_PROPS extends Type = Never, CLOSE_ON_RESOLVE extends boolean = false, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = _$Object<VALUES, REQUIRED_KEYS, OPEN_PROPS, CLOSE_ON_RESOLVE, IS_SERIALIZED, DESERIALIZED>;
16
+ declare type _$Object<VALUES = {}, REQUIRED_KEYS = never, OPEN_PROPS = Never, CLOSE_ON_RESOLVE = false, IS_SERIALIZED = false, DESERIALIZED = never> = DoesExtend<true, { [KEY in Extract<REQUIRED_KEYS, string>]: KEY extends keyof VALUES ? DoesExtend<VALUES[KEY], NeverType> : DoesExtend<OPEN_PROPS, NeverType> }[Extract<REQUIRED_KEYS, string>]> extends true ? Never : {
17
+ type: ObjectTypeId;
18
+ values: VALUES;
19
+ required: REQUIRED_KEYS;
20
+ isOpen: Not<DoesExtend<OPEN_PROPS, NeverType>>;
21
+ openProps: OPEN_PROPS;
22
+ closeOnResolve: CLOSE_ON_RESOLVE;
23
+ isSerialized: IS_SERIALIZED;
24
+ deserialized: DESERIALIZED;
25
+ };
26
+ declare type ObjectType = {
27
+ type: ObjectTypeId;
28
+ values: Record<string, Type>;
29
+ required: string;
30
+ isOpen: boolean;
31
+ openProps: Type;
32
+ closeOnResolve: boolean;
33
+ isSerialized: boolean;
34
+ deserialized: unknown;
35
+ };
36
+ declare type ObjectValues<META_OBJECT extends ObjectType> = META_OBJECT["values"];
37
+ declare type ObjectValue<META_OBJECT extends ObjectType, KEY extends string> = KEY extends keyof ObjectValues<META_OBJECT> ? ObjectValues<META_OBJECT>[KEY] : IsObjectOpen<META_OBJECT> extends true ? ObjectOpenProps<META_OBJECT> : Never;
38
+ declare type ObjectRequiredKeys<META_OBJECT extends ObjectType> = META_OBJECT["required"];
39
+ declare type IsObjectOpen<META_OBJECT extends ObjectType> = META_OBJECT["isOpen"];
40
+ declare type ObjectOpenProps<META_OBJECT extends ObjectType> = META_OBJECT["openProps"];
41
+ declare type IsObjectClosedOnResolve<META_OBJECT extends ObjectType> = META_OBJECT["closeOnResolve"];
42
+ declare type IsObjectEmpty<META_OBJECT extends ObjectType> = IsNever<keyof ObjectValues<META_OBJECT>>;
43
+ declare type ResolveObject<META_OBJECT extends ObjectType, OPTIONS extends ResolveOptions> = If<And<OPTIONS["deserialize"], IsSerialized<META_OBJECT>>, Deserialized<META_OBJECT>, DeepMergeUnsafe<If<And<IsObjectOpen<META_OBJECT>, Not<IsObjectClosedOnResolve<META_OBJECT>>>, If<IsObjectEmpty<META_OBJECT>, {
44
+ [KEY: string]: Resolve<ObjectOpenProps<META_OBJECT>, OPTIONS>;
45
+ }, {
46
+ [KEY: string]: Resolve<Any, OPTIONS>;
47
+ }>, {}>, DeepMergeUnsafe<{ [KEY in Exclude<keyof ObjectValues<META_OBJECT>, ObjectRequiredKeys<META_OBJECT>>]?: Resolve<ObjectValues<META_OBJECT>[KEY], OPTIONS> }, { [KEY in ObjectRequiredKeys<META_OBJECT>]: KEY extends keyof ObjectValues<META_OBJECT> ? Resolve<ObjectValues<META_OBJECT>[KEY], OPTIONS> : Resolve<Any, OPTIONS> }>>>;
48
+ //#endregion
49
+ export { IsObjectClosedOnResolve, IsObjectOpen, ObjectOpenProps, ObjectRequiredKeys, ObjectType, ObjectValue, ObjectValues, ResolveObject, _$Object, _Object };
@@ -0,0 +1,26 @@
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/primitive.d.ts
9
+ declare type PrimitiveTypeId = "primitive";
10
+ declare type Primitive<VALUE extends null | boolean | number | string, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = $Primitive<VALUE, IS_SERIALIZED, DESERIALIZED>;
11
+ declare type $Primitive<VALUE, IS_SERIALIZED = false, DESERIALIZED = never> = If<IsNever<VALUE>, Never, {
12
+ type: PrimitiveTypeId;
13
+ value: VALUE;
14
+ isSerialized: IS_SERIALIZED;
15
+ deserialized: DESERIALIZED;
16
+ }>;
17
+ declare type PrimitiveType = {
18
+ type: PrimitiveTypeId;
19
+ value: null | boolean | number | string;
20
+ isSerialized: boolean;
21
+ deserialized: unknown;
22
+ };
23
+ declare type PrimitiveValue<META_PRIMITIVE extends PrimitiveType> = META_PRIMITIVE["value"];
24
+ declare type ResolvePrimitive<META_PRIMITIVE extends PrimitiveType, OPTIONS extends ResolveOptions> = If<And<OPTIONS["deserialize"], IsSerialized<META_PRIMITIVE>>, Deserialized<META_PRIMITIVE>, PrimitiveValue<META_PRIMITIVE>>;
25
+ //#endregion
26
+ export { Primitive, PrimitiveType, PrimitiveValue, ResolvePrimitive };
@@ -0,0 +1,22 @@
1
+ import { NeverType, ResolveNever } from "./never.mjs";
2
+ import { ConstType, ResolveConst } from "./const.mjs";
3
+ import { EnumType, ResolveEnum } from "./enum.mjs";
4
+ import { ObjectType, ResolveObject } from "./object.mjs";
5
+ import { PrimitiveType, ResolvePrimitive } from "./primitive.mjs";
6
+ import { ResolveTuple, TupleType } from "./tuple.mjs";
7
+ import { ResolveUnion, UnionType } from "./union.mjs";
8
+ import { Type } from "./type.mjs";
9
+ import { ArrayType, ResolveArray } from "./array.mjs";
10
+ import { AnyType, ResolveAny } from "./any.mjs";
11
+
12
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/resolve.d.ts
13
+ declare type ResolveOptions = {
14
+ deserialize: boolean;
15
+ };
16
+ declare type ResolveDefaultOptions = {
17
+ deserialize: true;
18
+ };
19
+ declare type Resolve<META_TYPE extends Type, OPTIONS extends ResolveOptions = ResolveDefaultOptions> = $Resolve<META_TYPE, OPTIONS>;
20
+ declare type $Resolve<META_TYPE, OPTIONS extends ResolveOptions = ResolveDefaultOptions> = META_TYPE extends AnyType ? ResolveAny<META_TYPE, OPTIONS> : META_TYPE extends NeverType ? ResolveNever : META_TYPE extends ConstType ? ResolveConst<META_TYPE, OPTIONS> : META_TYPE extends EnumType ? ResolveEnum<META_TYPE, OPTIONS> : META_TYPE extends PrimitiveType ? ResolvePrimitive<META_TYPE, OPTIONS> : META_TYPE extends ArrayType ? ResolveArray<META_TYPE, OPTIONS> : META_TYPE extends TupleType ? ResolveTuple<META_TYPE, OPTIONS> : META_TYPE extends ObjectType ? ResolveObject<META_TYPE, OPTIONS> : META_TYPE extends UnionType ? ResolveUnion<META_TYPE, OPTIONS> : never;
21
+ //#endregion
22
+ export { $Resolve, Resolve, ResolveOptions };
@@ -0,0 +1,36 @@
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 { Never, NeverType } from "./never.mjs";
6
+ import { Deserialized, IsSerialized } from "./utils.mjs";
7
+ import { Type } from "./type.mjs";
8
+ import { Resolve, ResolveOptions } from "./resolve.mjs";
9
+
10
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/tuple.d.ts
11
+ declare type TupleTypeId = "tuple";
12
+ declare type Tuple<VALUES extends Type[], OPEN_PROPS extends Type = Never, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = $Tuple<VALUES, OPEN_PROPS, IS_SERIALIZED, DESERIALIZED>;
13
+ declare type $Tuple<VALUES, OPEN_PROPS = Never, IS_SERIALIZED = false, DESERIALIZED = never> = IsAnyValueNever<VALUES> extends true ? Never : {
14
+ type: TupleTypeId;
15
+ values: VALUES;
16
+ isOpen: Not<DoesExtend<OPEN_PROPS, NeverType>>;
17
+ openProps: OPEN_PROPS;
18
+ isSerialized: IS_SERIALIZED;
19
+ deserialized: DESERIALIZED;
20
+ };
21
+ declare type IsAnyValueNever<TUPLE> = TUPLE extends [infer TUPLE_HEAD, ...infer TUPLE_TAIL] ? TUPLE_HEAD extends NeverType ? true : IsAnyValueNever<TUPLE_TAIL> : false;
22
+ declare type TupleType = {
23
+ type: TupleTypeId;
24
+ values: Type[];
25
+ isOpen: boolean;
26
+ openProps: Type;
27
+ isSerialized: boolean;
28
+ deserialized: unknown;
29
+ };
30
+ declare type TupleValues<META_TUPLE extends TupleType> = META_TUPLE["values"];
31
+ declare type IsTupleOpen<META_TUPLE extends TupleType> = META_TUPLE["isOpen"];
32
+ declare type TupleOpenProps<META_TUPLE extends TupleType> = META_TUPLE["openProps"];
33
+ declare type ResolveTuple<META_TUPLE extends TupleType, OPTIONS extends ResolveOptions> = If<And<OPTIONS["deserialize"], IsSerialized<META_TUPLE>>, Deserialized<META_TUPLE>, If<IsTupleOpen<META_TUPLE>, [...RecurseOnTuple<TupleValues<META_TUPLE>, OPTIONS>, ...Resolve<TupleOpenProps<META_TUPLE>, OPTIONS>[]], RecurseOnTuple<TupleValues<META_TUPLE>, OPTIONS>>>;
34
+ declare type RecurseOnTuple<VALUES extends Type[], OPTIONS extends ResolveOptions, RESULT extends unknown[] = []> = VALUES extends [infer VALUES_HEAD, ...infer VALUES_TAIL] ? VALUES_HEAD extends Type ? VALUES_TAIL extends Type[] ? RecurseOnTuple<VALUES_TAIL, OPTIONS, [...RESULT, Resolve<VALUES_HEAD, OPTIONS>]> : never : never : RESULT;
35
+ //#endregion
36
+ export { $Tuple, IsTupleOpen, ResolveTuple, Tuple, TupleOpenProps, TupleType, TupleValues };
@@ -0,0 +1,18 @@
1
+ import { 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 { ArrayType } from "./array.mjs";
9
+ import { AnyType } from "./any.mjs";
10
+
11
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/type.d.ts
12
+ declare type Type = NeverType | AnyType | ConstType | EnumType | PrimitiveType | ArrayType | TupleType | ObjectType | UnionType;
13
+ declare type SerializableType = Type extends infer META_TYPE ? META_TYPE extends {
14
+ isSerialized: boolean;
15
+ deserialized: unknown;
16
+ } ? META_TYPE : never : never;
17
+ //#endregion
18
+ export { SerializableType, Type };
@@ -0,0 +1,23 @@
1
+ import { DoesExtend } 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 { Type } from "./type.mjs";
6
+ import { $Resolve, ResolveOptions } from "./resolve.mjs";
7
+
8
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.d.ts
9
+ declare type UnionTypeId = "union";
10
+ declare type Union<VALUES extends Type> = $Union<VALUES>;
11
+ declare type $Union<VALUES> = If<IsNever<VALUES>, Never, DoesExtend<VALUES, NeverType> extends true ? Never : {
12
+ type: UnionTypeId;
13
+ values: VALUES;
14
+ }>;
15
+ declare type UnionType = {
16
+ type: UnionTypeId;
17
+ values: Type;
18
+ };
19
+ declare type UnionValues<META_UNION extends UnionType> = META_UNION["values"];
20
+ declare type ResolveUnion<META_UNION extends UnionType, OPTIONS extends ResolveOptions> = RecurseOnUnion<UnionValues<META_UNION>, OPTIONS>;
21
+ declare type RecurseOnUnion<VALUES extends Type, OPTIONS extends ResolveOptions> = VALUES extends infer META_TYPE ? $Resolve<META_TYPE, OPTIONS> : never;
22
+ //#endregion
23
+ export { $Union, ResolveUnion, Union, UnionType, UnionValues };
@@ -0,0 +1,7 @@
1
+ import { SerializableType } from "./type.mjs";
2
+
3
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/utils.d.ts
4
+ declare type IsSerialized<SERIALIZABLE_META_TYPE extends SerializableType> = SERIALIZABLE_META_TYPE["isSerialized"];
5
+ declare type Deserialized<SERIALIZABLE_META_TYPE extends SerializableType> = SERIALIZABLE_META_TYPE["deserialized"];
6
+ //#endregion
7
+ export { Deserialized, IsSerialized };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/and.d.ts
2
+ declare type And<BOOL_A, BOOL_B> = BOOL_A extends true ? BOOL_B extends true ? true : false : false;
3
+ //#endregion
4
+ export { And };
@@ -0,0 +1,7 @@
1
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/extends.d.ts
2
+ declare type DoesExtend<TYPE_A, TYPE_B> = [TYPE_A] extends [TYPE_B] ? true : false;
3
+ declare type ArrayKeys = keyof [];
4
+ declare type IsObject<TYPE> = TYPE extends object ? ArrayKeys extends Extract<keyof TYPE, ArrayKeys> ? false : true : false;
5
+ declare type IsArray<TYPE> = TYPE extends object ? ArrayKeys extends Extract<keyof TYPE, ArrayKeys> ? true : false : false;
6
+ //#endregion
7
+ export { DoesExtend, IsArray, IsObject };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/if.d.ts
2
+ declare type If<CONDITION extends boolean, THEN, ELSE = never> = CONDITION extends true ? THEN : ELSE;
3
+ //#endregion
4
+ export { If };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/intersectUnion.d.ts
2
+ declare type IntersectUnion<UNION> = (UNION extends unknown ? (arg: UNION) => void : never) extends ((arg: infer INTERSECTION) => void) ? INTERSECTION : never;
3
+ //#endregion
4
+ export { IntersectUnion };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/isNever.d.ts
2
+ declare type IsNever<TYPE> = [TYPE] extends [never] ? true : false;
3
+ //#endregion
4
+ export { IsNever };
@@ -0,0 +1,6 @@
1
+ import { IsArray, IsObject } from "./extends.mjs";
2
+
3
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/merge.d.ts
4
+ declare type DeepMergeUnsafe<TYPE_A, TYPE_B> = IsObject<TYPE_A> extends true ? IsObject<TYPE_B> extends true ? { [KEY in keyof (TYPE_A & TYPE_B)]: KEY extends keyof TYPE_B ? KEY extends keyof TYPE_A ? DeepMergeUnsafe<TYPE_A[KEY], TYPE_B[KEY]> : TYPE_B[KEY] : KEY extends keyof TYPE_A ? TYPE_A[KEY] : never } : TYPE_B : IsArray<TYPE_A> extends true ? IsArray<TYPE_B> extends true ? TYPE_B extends unknown[] ? [...(TYPE_A extends unknown[] ? TYPE_A : never), TYPE_B] : never : TYPE_B : TYPE_B;
5
+ //#endregion
6
+ export { DeepMergeUnsafe };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/not.d.ts
2
+ declare type Not<BOOL extends boolean> = BOOL extends false ? true : BOOL extends true ? false : never;
3
+ //#endregion
4
+ export { Not };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/or.d.ts
2
+ declare type Or<BOOL_A extends boolean, BOOL_B extends boolean> = BOOL_A extends true ? true : BOOL_B extends true ? true : false;
3
+ //#endregion
4
+ export { Or };
@@ -0,0 +1,6 @@
1
+ import { IsObject } from "./extends.mjs";
2
+
3
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/prettify.d.ts
4
+ declare type Prettify<TYPE> = IsObject<TYPE> extends true ? { [KEY in keyof TYPE]: KEY extends keyof TYPE ? TYPE[KEY] : never } : TYPE;
5
+ //#endregion
6
+ export { Prettify };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/tail.d.ts
2
+ declare type Tail<ARRAY extends unknown[]> = ARRAY extends readonly [] ? ARRAY : ARRAY extends readonly [unknown?, ...infer TAIL] ? TAIL : ARRAY;
3
+ //#endregion
4
+ export { Tail };
@@ -0,0 +1,6 @@
1
+ import { IntersectUnion } from "./intersectUnion.mjs";
2
+
3
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionLast.d.ts
4
+ declare type UnionLast<UNION> = IntersectUnion<UNION extends unknown ? (x: UNION) => void : never> extends ((x: infer LAST) => void) ? LAST : never;
5
+ //#endregion
6
+ export { UnionLast };
@@ -0,0 +1,6 @@
1
+ import { UnionLast } from "./unionLast.mjs";
2
+
3
+ //#region node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionPop.d.ts
4
+ declare type UnionPop<UNION> = Exclude<UNION, UnionLast<UNION>>;
5
+ //#endregion
6
+ export { UnionPop };
package/lib/plugin.d.mts CHANGED
@@ -1,13 +1,12 @@
1
+ import { JSONSchema } from "./node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.mjs";
1
2
  import { PackageJsonRuleModule } from "./createRule.mjs";
2
3
  import * as parserJsonc from "jsonc-eslint-parser";
3
- import * as json_schema_to_ts0 from "json-schema-to-ts";
4
4
  import { ESLint } from "eslint";
5
5
 
6
6
  //#region src/plugin.d.ts
7
7
  declare const plugin: {
8
8
  configs: {
9
- /** @deprecated please use the recommended (flat) config. This will be removed in early 2026 */
10
- "legacy-recommended": {
9
+ /** @deprecated please use the recommended (flat) config. This will be removed in early 2026 */"legacy-recommended": {
11
10
  plugins: string[];
12
11
  rules: {
13
12
  [k: string]: "error";
@@ -57,7 +56,7 @@ declare const plugin: {
57
56
  name: string;
58
57
  version: string;
59
58
  };
60
- rules: Record<string, PackageJsonRuleModule<unknown[], json_schema_to_ts0.JSONSchema[]>>;
59
+ rules: Record<string, PackageJsonRuleModule<unknown[], JSONSchema[]>>;
61
60
  };
62
61
  //#endregion
63
62
  export { plugin };
package/lib/plugin.mjs CHANGED
@@ -45,12 +45,12 @@ const rules = {
45
45
  "valid-repository-directory": rule$16,
46
46
  "valid-version": rule$17
47
47
  };
48
- const recommendedRules = { ...Object.fromEntries(Object.entries(rules).filter(([, rule$18]) => rule$18.meta.docs?.recommended).map(([name$1]) => ["package-json/" + name$1, "error"])) };
48
+ const recommendedRules = { ...Object.fromEntries(Object.entries(rules).filter(([, rule]) => rule.meta.docs?.recommended).map(([name]) => ["package-json/" + name, "error"])) };
49
49
  const recommendedPublishableRules = {
50
50
  ...recommendedRules,
51
- ...Object.fromEntries(Object.entries(rules).filter(([, rule$18]) => rule$18.meta.docs?.category === "Publishable").map(([name$1]) => ["package-json/" + name$1, "error"]))
51
+ ...Object.fromEntries(Object.entries(rules).filter(([, rule]) => rule.meta.docs?.category === "Publishable").map(([name]) => ["package-json/" + name, "error"]))
52
52
  };
53
- const stylisticRules = { ...Object.fromEntries(Object.entries(rules).filter(([, rule$18]) => rule$18.meta.docs?.category === "Stylistic").map(([name$1]) => ["package-json/" + name$1, "error"])) };
53
+ const stylisticRules = { ...Object.fromEntries(Object.entries(rules).filter(([, rule]) => rule.meta.docs?.category === "Stylistic").map(([name]) => ["package-json/" + name, "error"])) };
54
54
  const { name, version } = require("../package.json");
55
55
  const plugin = {
56
56
  configs: {
@@ -69,8 +69,8 @@ const rule = createRule({
69
69
  },
70
70
  hasSuggestions: true,
71
71
  messages: {
72
- emptyExpression: "This {{expressionType}} does nothing and can be removed.",
73
- emptyFields: "The field '{{field}}' does nothing and can be removed.",
72
+ emptyExpression: "This {{ expressionType }} does nothing and can be removed.",
73
+ emptyFields: "The field '{{ field }}' does nothing and can be removed.",
74
74
  remove: "Remove this empty field."
75
75
  },
76
76
  schema: [{
@@ -50,10 +50,10 @@ const rule = createRule({
50
50
  function validateRepositoryForShorthand(node) {
51
51
  if (isJSONStringLiteral(node.value)) {
52
52
  const { value } = node.value;
53
- const provider$1 = getProviderFromUrl(value);
54
- if (provider$1) context.report({
53
+ const provider = getProviderFromUrl(value);
54
+ if (provider) context.report({
55
55
  fix(fixer) {
56
- return fixer.replaceText(node.value, JSON.stringify(createShorthand(value, provider$1)));
56
+ return fixer.replaceText(node.value, JSON.stringify(createShorthand(value, provider)));
57
57
  },
58
58
  messageId: "preferShorthand",
59
59
  node: node.value
@@ -2,10 +2,15 @@ import { PackageJsonRuleModule } from "../createRule.mjs";
2
2
 
3
3
  //#region src/rules/require-attribution.d.ts
4
4
  declare const rule: PackageJsonRuleModule<[({
5
+ ignorePrivate?: boolean | undefined;
5
6
  preferContributorsOnly?: boolean | undefined;
6
7
  } | undefined)?], [{
7
8
  readonly additionalProperties: false;
8
9
  readonly properties: {
10
+ readonly ignorePrivate: {
11
+ readonly description: "Skip attribution requirements for packages with `\"private\": true`.";
12
+ readonly type: "boolean";
13
+ };
9
14
  readonly preferContributorsOnly: {
10
15
  readonly description: "Require that only `contributors` is present, and `author` is not defined.";
11
16
  readonly type: "boolean";
@@ -5,8 +5,10 @@ import { fixRemoveObjectProperty } from "eslint-fix-utils";
5
5
  const rule = createRule({
6
6
  create(context) {
7
7
  const preferContributorsOnly = context.options[0]?.preferContributorsOnly ?? false;
8
+ const ignorePrivate = context.options[0]?.ignorePrivate ?? true;
8
9
  let authorPropertyNode;
9
10
  let contributorsPropertyNode;
11
+ let isPrivatePackage = false;
10
12
  return {
11
13
  "Program > JSONExpressionStatement > JSONObjectExpression > JSONProperty[key.value=author]"(node) {
12
14
  authorPropertyNode = node;
@@ -19,7 +21,11 @@ const rule = createRule({
19
21
  node
20
22
  });
21
23
  },
24
+ "Program > JSONExpressionStatement > JSONObjectExpression > JSONProperty[key.value=private]"(node) {
25
+ if (node.value.type === "JSONLiteral" && node.value.value === true) isPrivatePackage = true;
26
+ },
22
27
  "Program:exit"(node) {
28
+ if (ignorePrivate && isPrivatePackage) return;
23
29
  if (preferContributorsOnly) {
24
30
  if (authorPropertyNode) context.report({
25
31
  messageId: "contributorsOnly",
@@ -41,10 +47,14 @@ const rule = createRule({
41
47
  };
42
48
  },
43
49
  meta: {
44
- defaultOptions: [{ preferContributorsOnly: false }],
50
+ defaultOptions: [{
51
+ ignorePrivate: true,
52
+ preferContributorsOnly: false
53
+ }],
45
54
  docs: {
46
- category: "Publishable",
47
- description: "Ensures that proper attribution is included, requiring that either `author` or `contributors` is defined, and that if `contributors` is present, it should include at least one contributor."
55
+ category: "Best Practices",
56
+ description: "Ensures that proper attribution is included, requiring that either `author` or `contributors` is defined, and that if `contributors` is present, it should include at least one contributor.",
57
+ recommended: true
48
58
  },
49
59
  hasSuggestions: true,
50
60
  messages: {
@@ -56,10 +66,16 @@ const rule = createRule({
56
66
  },
57
67
  schema: [{
58
68
  additionalProperties: false,
59
- properties: { preferContributorsOnly: {
60
- description: "Require that only `contributors` is present, and `author` is not defined.",
61
- type: "boolean"
62
- } },
69
+ properties: {
70
+ ignorePrivate: {
71
+ description: "Skip attribution requirements for packages with `\"private\": true`.",
72
+ type: "boolean"
73
+ },
74
+ preferContributorsOnly: {
75
+ description: "Require that only `contributors` is present, and `author` is not defined.",
76
+ type: "boolean"
77
+ }
78
+ },
63
79
  type: "object"
64
80
  }],
65
81
  type: "suggestion"
@@ -9,8 +9,14 @@ const propertyConfig = [
9
9
  ["description", { isRecommended: true }],
10
10
  ["devDependencies"],
11
11
  ["engines"],
12
- ["exports", { category: "Publishable" }],
13
- ["files", { category: "Publishable" }],
12
+ ["exports", {
13
+ ignorePrivateDefault: true,
14
+ isRecommended: true
15
+ }],
16
+ ["files", {
17
+ ignorePrivateDefault: true,
18
+ isRecommended: true
19
+ }],
14
20
  ["homepage"],
15
21
  ["keywords"],
16
22
  ["license", {
@@ -24,11 +30,14 @@ const propertyConfig = [
24
30
  ["optionalDependencies"],
25
31
  ["peerDependencies"],
26
32
  ["repository", {
27
- category: "Publishable",
28
- ignorePrivateDefault: true
33
+ ignorePrivateDefault: true,
34
+ isRecommended: true
29
35
  }],
30
36
  ["scripts"],
31
- ["sideEffects", { category: "Publishable" }],
37
+ ["sideEffects", {
38
+ ignorePrivateDefault: true,
39
+ isRecommended: true
40
+ }],
32
41
  ["type", {
33
42
  fixValue: "commonjs",
34
43
  isRecommended: true
@@ -34,8 +34,8 @@ const rule = createRule({
34
34
  fixable: "code",
35
35
  hasSuggestions: true,
36
36
  messages: {
37
- removePropertySuggestion: "Remove the '{{property}}' field.",
38
- unnecessaryProperty: "The '{{property}}' field is unnecessary in private packages and can be removed."
37
+ removePropertySuggestion: "Remove the '{{ property }}' field.",
38
+ unnecessaryProperty: "The '{{ property }}' field is unnecessary in private packages and can be removed."
39
39
  },
40
40
  schema: [{
41
41
  additionalProperties: false,