inferred-types 0.52.10 → 0.52.11

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.
@@ -1 +1 @@
1
- {"version":3,"file":"RequireProps.d.ts","sourceRoot":"","sources":["../../../src/types/dictionary/RequireProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEtE;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,iBAAiB,CACpF,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CACzB,CAAC"}
1
+ {"version":3,"file":"RequireProps.d.ts","sourceRoot":"","sources":["../../../src/types/dictionary/RequireProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEtE;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,CACtB,CAAC,SAAS,WAAW,EACrB,CAAC,SAAS,MAAM,CAAC,IACf,iBAAiB,CACnB,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CACzB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { As, Dictionary, EmptyObject, IfUnset, ObjectKey, Unset } from "inferred-types/types";
1
+ import { AfterFirst, AnyObject, As, Dictionary, EmptyObject, First, IfUnset, Keys, ObjectKey, Unset } from "inferred-types/types";
2
2
  /**
3
3
  * **RequiredKeys**`<T,[V]>`
4
4
  *
@@ -9,11 +9,24 @@ import { As, Dictionary, EmptyObject, IfUnset, ObjectKey, Unset } from "inferred
9
9
  * by the _value_ of the key and then only keys which are required AND
10
10
  * who extend `V` will be included in the union.
11
11
  *
12
- * **Related:** `OptionalKeys`, `RequiredProps`
12
+ * **Related:** `OptionalKeys`, `RequiredProps`, `RequiredKeysTuple`
13
13
  */
14
14
  export type RequiredKeys<T extends Dictionary, V = Unset> = As<{
15
15
  [K in keyof T]-?: EmptyObject extends {
16
16
  [P in K]: T[K];
17
17
  } ? never : IfUnset<V, K, T[K] extends V ? K : never>;
18
18
  }[keyof T], ObjectKey>;
19
+ type KeyList<TObj extends AnyObject, TKeys extends readonly (keyof TObj & ObjectKey)[], TResult extends ObjectKey[] = []> = [] extends TKeys ? TResult : undefined extends TObj[First<TKeys>] ? KeyList<TObj, AfterFirst<TKeys>, TResult> : KeyList<TObj, AfterFirst<TKeys>, [
20
+ ...TResult,
21
+ First<TKeys>
22
+ ]>;
23
+ /**
24
+ * **RequiredKeysTuple**`<T,[E]>`
25
+ *
26
+ * Provides a tuple of the _keys_ in `T` which are
27
+ * **required** properties.
28
+ *
29
+ * **Related:** `OptionalKeys`, `RequiredProps`, `RequiredKeys`*/
30
+ export type RequiredKeysTuple<T extends Dictionary> = KeyList<T, Keys<T>>;
31
+ export {};
19
32
  //# sourceMappingURL=RequiredKeys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequiredKeys.d.ts","sourceRoot":"","sources":["../../../src/types/dictionary/RequiredKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE/F;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,CACtB,CAAC,SAAS,UAAU,EACpB,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC;KACf,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,WAAW,SAAS;SAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAAE,GACpD,KAAK,GACL,OAAO,CACL,CAAC,EACD,CAAC,EACD,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GACV,CAAC,GACD,KAAK,CACV;CACN,CAAC,MAAM,CAAC,CAA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