inferred-types 0.18.2 → 0.19.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 (41) hide show
  1. package/dist/index.d.ts +24 -13
  2. package/dist/index.js +5 -11
  3. package/dist/index.mjs +5 -10
  4. package/on-hold/Builder/index.ts +2 -2
  5. package/on-hold/types/index.ts +2 -2
  6. package/package.json +13 -15
  7. package/src/Mutation/index.ts +2 -2
  8. package/src/index.ts +2 -2
  9. package/src/shared/index.ts +2 -2
  10. package/src/types/Where.ts +19 -15
  11. package/src/types/alphabetic/index.ts +2 -2
  12. package/src/types/dictionary/NotEmptyObject.ts +9 -0
  13. package/src/types/dictionary/index.ts +3 -2
  14. package/src/types/fluent/index.ts +2 -2
  15. package/src/types/index.ts +2 -2
  16. package/src/types/kv/index.ts +2 -2
  17. package/src/types/lists/index.ts +2 -2
  18. package/src/types/string-literals/index.ts +2 -2
  19. package/src/types/tuples/FromDictArray.ts +1 -1
  20. package/src/types/tuples/index.ts +2 -2
  21. package/src/types/type-conversion/UnwrapValue.ts +13 -0
  22. package/src/types/type-conversion/index.ts +3 -2
  23. package/src/utility/api/index.ts +2 -2
  24. package/src/utility/createFnWithProps.ts +1 -1
  25. package/src/utility/dictionary/index.ts +2 -3
  26. package/src/utility/dictionary/kv/index.ts +2 -2
  27. package/src/utility/index.ts +2 -2
  28. package/src/utility/lists/index.ts +2 -2
  29. package/src/utility/literals/index.ts +2 -2
  30. package/src/utility/map-reduce/index.ts +2 -2
  31. package/src/utility/modelling/index.ts +2 -2
  32. package/src/utility/runtime/conditions/index.ts +2 -2
  33. package/src/utility/runtime/index.ts +2 -2
  34. package/src/utility/state/Configurator.ts +12 -3
  35. package/src/utility/state/index.ts +2 -2
  36. package/tests/data/index.ts +2 -2
  37. package/tests/kv/dict-to-kv-and-back.spec.ts +24 -22
  38. package/.tsbuildinfo +0 -1
  39. package/pnpm-lock.yaml +0 -6388
  40. package/src/utility/dictionary/dictFilter.ts +0 -19
  41. package/tests/kv/dictFilter.ts +0 -8
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { Include as Include$1 } from 'native-dash';
2
1
  import { Alpha as Alpha$1 } from 'common-types';
3
2
 
4
3
  /**
@@ -326,7 +325,7 @@ declare type TypeGuard<T> = (thing: unknown) => thing is T;
326
325
  * type BA = Where<typeof arr, `ba${string}`>;
327
326
  * ```
328
327
  */
329
- declare type Where<T extends Record<string, any> | readonly string[], U> = T extends readonly string[] ? Include$1<T[number], U> : {
328
+ declare type Where<T extends Record<string, any> | readonly string[], U> = T extends readonly string[] ? Include<T[number], U> : {
330
329
  [K in keyof T]: K extends U ? K : never;
331
330
  }[keyof T];
332
331
  /**
@@ -900,6 +899,11 @@ declare type SnakeCase<S extends string> = string extends S ? string : DashUpper
900
899
  */
901
900
  declare type Get<T, K> = K extends `${infer FK}.${infer L}` ? FK extends keyof T ? Get<T[FK], L> : never : K extends keyof T ? T[K] : never;
902
901
 
902
+ /**
903
+ * Accepts an object with at least one property defined on it
904
+ */
905
+ declare type NotEmptyObject<T extends {}> = ExpandRecursively<Length<UnionToTuple<Keys<T>>> extends 0 ? false : T>;
906
+
903
907
  /**
904
908
  * **ToFluent**
905
909
  *
@@ -1038,7 +1042,7 @@ declare type FirstKeyValue<T extends object> = FirstKey<T> extends keyof T ? T[F
1038
1042
  declare type FirstOfEach<T extends readonly any[][]> = T[number][0] extends T[number][number] ? T[number][0] : never;
1039
1043
 
1040
1044
  /**
1041
- * Typescript utility which recieves `T` as shape which resembles `DictArray<D>`
1045
+ * Typescript utility which receives `T` as shape which resembles `DictArray<D>`
1042
1046
  * and if the type `D` can be inferred it is returned.
1043
1047
  * ```ts
1044
1048
  * // { foo: 1; bar: "hi" }
@@ -1083,6 +1087,19 @@ declare type LastInUnion<U> = UnionToIntersection<U extends unknown ? (x: U) =>
1083
1087
  */
1084
1088
  declare type UnionToTuple<U, Last = LastInUnion<U>> = [U] extends [never] ? [] : [...UnionToTuple<Exclude<U, Last>>, Last];
1085
1089
 
1090
+ /**
1091
+ * Given a dictionary of key/values, where the value is a function, this
1092
+ * type utility will maintain the keys but change the values to whatever
1093
+ * the `ReturnType` of the function was.
1094
+ * ```ts
1095
+ * // { foo: string }
1096
+ * type Test = UnwrapValue<{ foo: (name: string) => name }>
1097
+ * ```
1098
+ */
1099
+ declare type UnwrapValue<T extends Record<string, (...args: any[]) => any>> = {
1100
+ [K in keyof T]: T[K] extends Function ? ReturnType<T[K]> : never;
1101
+ }[keyof T];
1102
+
1086
1103
  declare type ValueFunction<T extends any> = <R extends any>(v: T) => R;
1087
1104
  /**
1088
1105
  * **SameKeys**
@@ -1133,14 +1150,6 @@ declare const api: <N extends Narrowable, TPrivate extends Readonly<Record<any,
1133
1150
  */
1134
1151
  declare function arrayToKeyLookup<T extends readonly string[]>(...keys: T): Record<T[number], true>;
1135
1152
 
1136
- declare type ObjFilterCallback<T extends object, R extends boolean> = (k: keyof T, state: T) => R;
1137
- /**
1138
- * **dictFilter**
1139
- *
1140
- * Provides a means ot filter down the properties on a given object.
1141
- */
1142
- declare function dictFilter<N extends Narrowable, T extends Record<string, N>, R extends boolean>(obj: T, cb: ObjFilterCallback<T, R>): Exclude<T, (keyof T)[]>;
1143
-
1144
1153
  /**
1145
1154
  * Takes a dictionary of type `I` and converts it to a dictionary of type `O` where
1146
1155
  * they _keys_ used in both dictionaries are the same.
@@ -1518,11 +1527,13 @@ declare function type<T extends any, V extends Function>(fn: TypeDefinition<T, V
1518
1527
  */
1519
1528
  declare function withValue<T extends any, V extends Function>(td: TypeDefinition<T, V>): <N extends Narrowable, R extends Record<string, N>>(obj: R) => ExpandRecursively<Pick<R, KeysWithValue<T, R>>>;
1520
1529
 
1530
+ declare type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
1531
+
1521
1532
  interface IConfigurator<C = {}> {
1522
1533
  set<V, K extends string, KV = {
1523
1534
  [U in K]: V;
1524
1535
  }>(key: K, value: V): asserts this is IConfigurator<ExpandRecursively<C & KV>>;
1525
- remove<K extends string & keyof C>(key: K): asserts this is IConfigurator<ExpandRecursively<Omit<C, K>>>;
1536
+ remove<K extends string & keyof C>(key: K): asserts this is IConfigurator<ExpandRecursively<Omit$1<C, K>>>;
1526
1537
  done(): C;
1527
1538
  }
1528
1539
  /**
@@ -9777,4 +9788,4 @@ declare function KeyStorage(): {
9777
9788
  done: () => never[];
9778
9789
  };
9779
9790
 
9780
- export { AllCaps, Alpha, AlphaNumeric, Api, ApiFunction, ApiValue, AppendToDictionary, AppendToObject, ArrConcat, Array$1 as Array, ArrayConverter, AssertExtends, Bracket, Break, CamelCase, CapitalizeWords, ClosingBracket, Condition, Configurator, Constructor, DashToSnake, DashUppercase, Dasherize, DictArray, DictArrayFilterCallback, DictArrayKv, DictFromKv, DictKvTuple, DynamicRule, DynamicRuleSet, Email, EnumValues, ExpandRecursively, ExpectExtends, ExplicitFunction, ExtendsClause, ExtendsNarrowlyClause, Filter, First, FirstKey, FirstKeyValue, FirstOfEach, FluentConfigurator, FluentFunction, FromDictArray, FunctionType, GeneralDictionary, Get, HasUppercase, IConfigurator, IFluentConfigurator, If, IfExtends, IfExtendsThen, Include, Includes, IsArray, IsBoolean, IsCapitalized, IsFalse, IsFunction, IsLiteral, IsObject, IsString, IsTrue, KebabCase, KeyStorage, KeyStorageApi, KeyValue, KeyedRecord, Keys, KeysWithValue, KvFrom, KvTuple, LastInUnion, LeftWhitespace, Length, LowerAllCaps, LowerAlpha, MaybeFalse, MaybeTrue, Model, Mutable, MutationFunction, MutationIdentity, Narrowable, NonAlpha, NonNumericKeys, NonStringKeys, Not, Numeric, NumericKeys, NumericString, ObjFilterCallback, ObjectType, Opaque, OpenningBracket, OptionalKeys, OptionalProps, Parenthesis, PascalCase, Pluralize, PrivateKey, PrivateKeys, PublicKeys, Punctuation, PureFluentApi, Replace, RequiredKeys, RequiredProps, Retain, RightWhitespace, RuleDefinition, RuntimeProp, RuntimeType, SameKeys, SecondOfEach, SnakeCase, SpecialCharacters, StringDelimiter, StringKeys, StringLength, ToFluent, Transformer, Trim, TrimLeft, TrimRight, TupleToUnion, Type, TypeApi, TypeCondition, TypeDefinition, TypeGuard, TypeOptions, UnionToIntersection, UnionToTuple, UniqueDictionary, UniqueForProp, UpperAlpha, ValueTuple, ValueTypeFunc, ValueTypes, Where, WhereNot, Whitespace, WithNumericKeys, WithStringKeys, WithValue, WrapValue, ZipCode, and, api, arrayToKeyLookup, arrayToObject, condition, createFnWithProps, createMutationFunction, defineType, dictFilter, dictToKv, dictionaryTransform, entries, equals, filterDictArray, greater, groupBy, idLiteral, idTypeGuard, identity, ifTypeOf, isArray, isBoolean, isFalse, isFunction, isLiteral, isNull, isNumber, isObject, isString, isSymbol, isTrue, isType, isUndefined, keys, kindLiteral, kv, kvToDict, less, literal, mapValues, nameLiteral, or, randomString, ruleSet, strArrayToDict, type, typeApi, uuid, valueTypes, valuesOfProp, withValue };
9791
+ export { AllCaps, Alpha, AlphaNumeric, Api, ApiFunction, ApiValue, AppendToDictionary, AppendToObject, ArrConcat, Array$1 as Array, ArrayConverter, AssertExtends, Bracket, Break, CamelCase, CapitalizeWords, ClosingBracket, Condition, Configurator, Constructor, DashToSnake, DashUppercase, Dasherize, DictArray, DictArrayFilterCallback, DictArrayKv, DictFromKv, DictKvTuple, DynamicRule, DynamicRuleSet, Email, EnumValues, ExpandRecursively, ExpectExtends, ExplicitFunction, ExtendsClause, ExtendsNarrowlyClause, Filter, First, FirstKey, FirstKeyValue, FirstOfEach, FluentConfigurator, FluentFunction, FromDictArray, FunctionType, GeneralDictionary, Get, HasUppercase, IConfigurator, IFluentConfigurator, If, IfExtends, IfExtendsThen, Include, Includes, IsArray, IsBoolean, IsCapitalized, IsFalse, IsFunction, IsLiteral, IsObject, IsString, IsTrue, KebabCase, KeyStorage, KeyStorageApi, KeyValue, KeyedRecord, Keys, KeysWithValue, KvFrom, KvTuple, LastInUnion, LeftWhitespace, Length, LowerAllCaps, LowerAlpha, MaybeFalse, MaybeTrue, Model, Mutable, MutationFunction, MutationIdentity, Narrowable, NonAlpha, NonNumericKeys, NonStringKeys, Not, NotEmptyObject, Numeric, NumericKeys, NumericString, ObjectType, Opaque, OpenningBracket, OptionalKeys, OptionalProps, Parenthesis, PascalCase, Pluralize, PrivateKey, PrivateKeys, PublicKeys, Punctuation, PureFluentApi, Replace, RequiredKeys, RequiredProps, Retain, RightWhitespace, RuleDefinition, RuntimeProp, RuntimeType, SameKeys, SecondOfEach, SnakeCase, SpecialCharacters, StringDelimiter, StringKeys, StringLength, ToFluent, Transformer, Trim, TrimLeft, TrimRight, TupleToUnion, Type, TypeApi, TypeCondition, TypeDefinition, TypeGuard, TypeOptions, UnionToIntersection, UnionToTuple, UniqueDictionary, UniqueForProp, UnwrapValue, UpperAlpha, ValueTuple, ValueTypeFunc, ValueTypes, Where, WhereNot, Whitespace, WithNumericKeys, WithStringKeys, WithValue, WrapValue, ZipCode, and, api, arrayToKeyLookup, arrayToObject, condition, createFnWithProps, createMutationFunction, defineType, dictToKv, dictionaryTransform, entries, equals, filterDictArray, greater, groupBy, idLiteral, idTypeGuard, identity, ifTypeOf, isArray, isBoolean, isFalse, isFunction, isLiteral, isNull, isNumber, isObject, isString, isSymbol, isTrue, isType, isUndefined, keys, kindLiteral, kv, kvToDict, less, literal, mapValues, nameLiteral, or, randomString, ruleSet, strArrayToDict, type, typeApi, uuid, valueTypes, valuesOfProp, withValue };
package/dist/index.js CHANGED
@@ -55,7 +55,6 @@ __export(src_exports, {
55
55
  createFnWithProps: () => createFnWithProps,
56
56
  createMutationFunction: () => createMutationFunction,
57
57
  defineType: () => defineType,
58
- dictFilter: () => dictFilter,
59
58
  dictToKv: () => dictToKv,
60
59
  dictionaryTransform: () => dictionaryTransform,
61
60
  entries: () => entries,
@@ -181,13 +180,6 @@ function arrayToKeyLookup(...keys2) {
181
180
  return obj;
182
181
  }
183
182
 
184
- // src/utility/dictionary/dictFilter.ts
185
- var import_native_dash = require("native-dash");
186
- function dictFilter(obj, cb) {
187
- const remove = keys(obj).filter((k) => !cb(k, obj));
188
- return (0, import_native_dash.omit)(obj, ...keys(obj).filter((k) => !cb(k, obj)));
189
- }
190
-
191
183
  // src/utility/dictionary/dictionaryTransform.ts
192
184
  function dictionaryTransform(input, transform) {
193
185
  return keys(input).reduce((acc, i) => {
@@ -233,7 +225,10 @@ function dictToKv(obj, _makeTuple = false) {
233
225
  }
234
226
 
235
227
  // src/utility/state/Configurator.ts
236
- var import_native_dash2 = require("native-dash");
228
+ function omit(obj, ...removals) {
229
+ const untyped = removals;
230
+ return Object.fromEntries(Object.entries(obj).filter(([key]) => !untyped.includes(key)));
231
+ }
237
232
  function Configurator() {
238
233
  let configuration = () => ({});
239
234
  const api2 = () => {
@@ -247,7 +242,7 @@ function Configurator() {
247
242
  },
248
243
  remove(key) {
249
244
  const config = configuration();
250
- const updated = (0, import_native_dash2.omit)(config, key);
245
+ const updated = omit(config, key);
251
246
  configuration = () => updated;
252
247
  return updated;
253
248
  },
@@ -641,7 +636,6 @@ module.exports = __toCommonJS(src_exports);
641
636
  createFnWithProps,
642
637
  createMutationFunction,
643
638
  defineType,
644
- dictFilter,
645
639
  dictToKv,
646
640
  dictionaryTransform,
647
641
  entries,
package/dist/index.mjs CHANGED
@@ -99,13 +99,6 @@ function arrayToKeyLookup(...keys2) {
99
99
  return obj;
100
100
  }
101
101
 
102
- // src/utility/dictionary/dictFilter.ts
103
- import { omit } from "native-dash";
104
- function dictFilter(obj, cb) {
105
- const remove = keys(obj).filter((k) => !cb(k, obj));
106
- return omit(obj, ...keys(obj).filter((k) => !cb(k, obj)));
107
- }
108
-
109
102
  // src/utility/dictionary/dictionaryTransform.ts
110
103
  function dictionaryTransform(input, transform) {
111
104
  return keys(input).reduce((acc, i) => {
@@ -151,7 +144,10 @@ function dictToKv(obj, _makeTuple = false) {
151
144
  }
152
145
 
153
146
  // src/utility/state/Configurator.ts
154
- import { omit as omit2 } from "native-dash";
147
+ function omit(obj, ...removals) {
148
+ const untyped = removals;
149
+ return Object.fromEntries(Object.entries(obj).filter(([key]) => !untyped.includes(key)));
150
+ }
155
151
  function Configurator() {
156
152
  let configuration = () => ({});
157
153
  const api2 = () => {
@@ -165,7 +161,7 @@ function Configurator() {
165
161
  },
166
162
  remove(key) {
167
163
  const config = configuration();
168
- const updated = omit2(config, key);
164
+ const updated = omit(config, key);
169
165
  configuration = () => updated;
170
166
  return updated;
171
167
  },
@@ -557,7 +553,6 @@ export {
557
553
  createFnWithProps,
558
554
  createMutationFunction,
559
555
  defineType,
560
- dictFilter,
561
556
  dictToKv,
562
557
  dictionaryTransform,
563
558
  entries,
@@ -1,8 +1,8 @@
1
1
  // #autoindex
2
2
 
3
3
  // #region autoindexed files
4
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
5
- // hash-code: 3659802676
4
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
5
+ // hash-code: da242834
6
6
 
7
7
 
8
8
 
@@ -1,7 +1,7 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 3659802676
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: da242834
5
5
 
6
6
 
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inferred-types",
3
- "version": "0.18.2",
3
+ "version": "0.19.0",
4
4
  "description": "Functions which provide useful type inference on TS projects",
5
5
  "license": "MIT",
6
6
  "author": "Ken Snyder<ken@ken.net>",
@@ -21,33 +21,31 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "@type-challenges/utils": "~0.1.1",
24
- "@types/jest": "^27.0.3",
25
- "@types/node": "^14.18.3",
26
- "@typescript-eslint/eslint-plugin": "^5.8.0",
27
- "@typescript-eslint/parser": "^5.8.0",
24
+ "@types/jest": "^27.4.0",
25
+ "@types/node": "^14.18.5",
26
+ "@typescript-eslint/eslint-plugin": "^5.9.1",
27
+ "@typescript-eslint/parser": "^5.9.1",
28
28
  "common-types": "^1.30.0",
29
29
  "cross-env": "^7.0.3",
30
- "dd": "^0.16.7",
30
+ "dd": "^0.18.0",
31
31
  "dotenv": "^10.0.0",
32
- "eslint": "^8.5.0",
32
+ "eslint": "^8.6.0",
33
33
  "eslint-config-prettier": "^8.3.0",
34
- "eslint-plugin-import": "^2.25.3",
34
+ "eslint-plugin-import": "^2.25.4",
35
35
  "eslint-plugin-prettier": "^4.0.0",
36
36
  "eslint-plugin-promise": "^6.0.0",
37
- "eslint-plugin-unicorn": "^39.0.0",
38
- "jest": "^27.4.5",
37
+ "eslint-plugin-unicorn": "^40.0.0",
38
+ "jest": "^27.4.7",
39
39
  "jest-extended": "~1.2.0",
40
40
  "npm-run-all": "~4.1.5",
41
41
  "prettier": "~2.5.1",
42
42
  "rimraf": "^3.0.2",
43
43
  "ts-jest": "^27.1.2",
44
44
  "ts-node": "^10.4.0",
45
- "tsup": "^5.11.9",
45
+ "tsup": "^5.11.11",
46
46
  "typescript": "^4.5.4"
47
47
  },
48
48
  "dependencies": {
49
- "brilliant-errors": "^0.5.4",
50
- "common-types": "^1.31.0",
51
- "native-dash": "^1.21.2"
49
+ "common-types": "^1.31.0"
52
50
  }
53
- }
51
+ }
@@ -1,8 +1,8 @@
1
1
  // #autoindex
2
2
 
3
3
  // #region autoindexed files
4
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
5
- // hash-code: 4139440866
4
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
5
+ // hash-code: f6badae2
6
6
 
7
7
  // file exports
8
8
  export * from "./MutationFunction";
package/src/index.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  // #autoindex
2
2
 
3
3
  // #region autoindexed files
4
- // index last changed at: 12th Dec, 2021, 09:30 AM ( GMT-8 )
5
- // hash-code: 1064662042
4
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
5
+ // hash-code: 3f75741a
6
6
 
7
7
  // directory exports
8
8
  export * from "./Mutation/index";
@@ -1,8 +1,8 @@
1
1
  // #autoindex: orphan
2
2
 
3
3
  // #region autoindexed files
4
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
5
- // hash-code: 1491784011
4
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
5
+ // hash-code: 58ead14b
6
6
 
7
7
  // file exports
8
8
  export * from "./randomString";
@@ -1,8 +1,7 @@
1
- import { Include } from "native-dash";
2
-
1
+ import { Include } from "./Include";
3
2
  /**
4
3
  * Allows filtering down `T` to those which extend a given type `U`.
5
- *
4
+ *
6
5
  * - `T` is either a dictionary (where keys will be used to compare) or
7
6
  * a readonly sting array.
8
7
  * ```ts
@@ -11,16 +10,18 @@ import { Include } from "native-dash";
11
10
  * type BA = Where<typeof arr, `ba${string}`>;
12
11
  * ```
13
12
  */
14
- export type Where<T extends Record<string, any> | readonly string[], U> = T extends readonly string[]
15
- ? Include<T[number], U>
16
- : {
17
- [K in keyof T]: K extends U ? K : never;
18
- }[keyof T];
19
-
13
+ export type Where<
14
+ T extends Record<string, any> | readonly string[],
15
+ U
16
+ > = T extends readonly string[]
17
+ ? Include<T[number], U>
18
+ : {
19
+ [K in keyof T]: K extends U ? K : never;
20
+ }[keyof T];
20
21
 
21
22
  /**
22
23
  * Allows filtering down `T` to those which extend a given type `U`.
23
- *
24
+ *
24
25
  * - `T` is either a dictionary (where keys will be used to compare) or
25
26
  * a readonly sting array.
26
27
  * ```ts
@@ -29,8 +30,11 @@ import { Include } from "native-dash";
29
30
  * type F = WhereNot<typeof arr, `ba${string}`>;
30
31
  * ```
31
32
  */
32
- export type WhereNot<T extends Record<string, any> | readonly string[], U> = T extends readonly string[]
33
- ? Exclude<T[number], U>
34
- : {
35
- [K in keyof T]: K extends U ? never : K;
36
- }[keyof T];
33
+ export type WhereNot<
34
+ T extends Record<string, any> | readonly string[],
35
+ U
36
+ > = T extends readonly string[]
37
+ ? Exclude<T[number], U>
38
+ : {
39
+ [K in keyof T]: K extends U ? never : K;
40
+ }[keyof T];
@@ -1,7 +1,7 @@
1
1
  // #autoindex, exclude: Alpha
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 265264203
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: fcf9c4b
5
5
 
6
6
  // file exports
7
7
  export * from "./AllCaps";
@@ -0,0 +1,9 @@
1
+ import { ExpandRecursively } from "../ExpandRecursively";
2
+ import { Keys, Length, UnionToTuple } from "../index";
3
+
4
+ /**
5
+ * Accepts an object with at least one property defined on it
6
+ */
7
+ export type NotEmptyObject<T extends {}> = ExpandRecursively<
8
+ Length<UnionToTuple<Keys<T>>> extends 0 ? false : T
9
+ >;
@@ -1,10 +1,11 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 1199590002
3
+ // index last changed at: 6th Jun, 2022, 03:36 AM ( GMT-7 )
4
+ // hash-code: 1f3a5076
5
5
 
6
6
  // file exports
7
7
  export * from "./Get";
8
+ export * from "./NotEmptyObject";
8
9
 
9
10
  // #endregion
10
11
 
@@ -1,7 +1,7 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 3321613880
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: c5fbce38
5
5
 
6
6
  // file exports
7
7
  export * from "./fluent";
@@ -1,7 +1,7 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 2121148832
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: 7e6e29a0
5
5
 
6
6
  // file exports
7
7
  export * from "./Api";
@@ -1,7 +1,7 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 2882639582
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: abd196de
5
5
 
6
6
  // file exports
7
7
  export * from "./DictFromKv";
@@ -1,8 +1,8 @@
1
1
  // #autoindex
2
2
 
3
3
  // #region autoindexed files
4
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
5
- // hash-code: 1638858978
4
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
5
+ // hash-code: 61af00e2
6
6
 
7
7
  // file exports
8
8
  export * from "./UniqueForProp";
@@ -1,7 +1,7 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 2819423703
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: a80cfdd7
5
5
 
6
6
  // file exports
7
7
  export * from "./Break";
@@ -2,7 +2,7 @@ import { ExpandRecursively, UnionToIntersection } from "~/types";
2
2
 
3
3
 
4
4
  /**
5
- * Typescript utility which recieves `T` as shape which resembles `DictArray<D>`
5
+ * Typescript utility which receives `T` as shape which resembles `DictArray<D>`
6
6
  * and if the type `D` can be inferred it is returned.
7
7
  * ```ts
8
8
  * // { foo: 1; bar: "hi" }
@@ -1,7 +1,7 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 934853479
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: 37b8bb67
5
5
 
6
6
  // file exports
7
7
  export * from "./DictArray";
@@ -0,0 +1,13 @@
1
+
2
+ /**
3
+ * Given a dictionary of key/values, where the value is a function, this
4
+ * type utility will maintain the keys but change the values to whatever
5
+ * the `ReturnType` of the function was.
6
+ * ```ts
7
+ * // { foo: string }
8
+ * type Test = UnwrapValue<{ foo: (name: string) => name }>
9
+ * ```
10
+ */
11
+ export type UnwrapValue<T extends Record<string, (...args: any[]) => any>> = {
12
+ [K in keyof T]: T[K] extends Function ? ReturnType<T[K]> : never;
13
+ }[keyof T];
@@ -1,14 +1,15 @@
1
1
  // #autoindex
2
2
 
3
3
  // #region autoindexed files
4
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
5
- // hash-code: 1015918361
4
+ // index last changed at: 6th Jun, 2022, 03:36 AM ( GMT-7 )
5
+ // hash-code: ac142b94
6
6
 
7
7
  // file exports
8
8
  export * from "./SameKeys";
9
9
  export * from "./TupleToUnion";
10
10
  export * from "./UnionToIntersection";
11
11
  export * from "./UnionToTuple";
12
+ export * from "./UnwrapValue";
12
13
  export * from "./WrapValue";
13
14
 
14
15
  // #endregion
@@ -1,7 +1,7 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 3537087800
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: d2d3ad38
5
5
 
6
6
  // file exports
7
7
  export * from "./api";
@@ -9,4 +9,4 @@ export function createFnWithProps<F extends Function, P extends {}>(fn: F, props
9
9
  }
10
10
  return combined;
11
11
  })() as unknown as F & P;
12
- }
12
+ }
@@ -1,11 +1,10 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 1609486729
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: c3587066
5
5
 
6
6
  // file exports
7
7
  export * from "./arrayToKeyLookup";
8
- export * from "./dictFilter";
9
8
  export * from "./dictionaryTransform";
10
9
  export * from "./entries";
11
10
  export * from "./mapValues";
@@ -1,7 +1,7 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 3790237505
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: e1ea6f41
5
5
 
6
6
  // file exports
7
7
  export * from "./dictToKv";
@@ -1,8 +1,8 @@
1
1
  // #autoindex
2
2
 
3
3
  // #region autoindexed files
4
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
5
- // hash-code: 1753666426
4
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
5
+ // hash-code: 6886d37a
6
6
 
7
7
  // file exports
8
8
  export * from "./createFnWithProps";
@@ -1,8 +1,8 @@
1
1
  // #autoindex
2
2
 
3
3
  // #region autoindexed files
4
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
5
- // hash-code: 22070035
4
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
5
+ // hash-code: 150c313
6
6
 
7
7
  // file exports
8
8
  export * from "./groupBy";
@@ -1,7 +1,7 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 192569155
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: b7a5f43
5
5
 
6
6
  // file exports
7
7
  export * from "./ExplicitFunction";
@@ -1,7 +1,7 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 1933921503
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: 73454cdf
5
5
 
6
6
  // file exports
7
7
  export * from "./filter";
@@ -1,7 +1,7 @@
1
1
  // #autoindex, exclude: IoModel
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 886488599
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: 34d6be17
5
5
 
6
6
  // file exports
7
7
  export * from "./Model";
@@ -1,8 +1,8 @@
1
1
  // #autoindex
2
2
 
3
3
  // #region autoindexed files
4
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
5
- // hash-code: 2742585618
4
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
5
+ // hash-code: a3788912
6
6
 
7
7
  // file exports
8
8
  export * from "./isArray";
@@ -1,7 +1,7 @@
1
1
  // #autoindex
2
2
  // #region autoindexed files
3
- // index last changed at: 12th Dec, 2021, 09:28 AM ( GMT-8 )
4
- // hash-code: 152540854
3
+ // index last changed at: 1st Jan, 2022, 03:27 PM ( GMT-8 )
4
+ // hash-code: 91796b6
5
5
 
6
6
  // file exports
7
7
  export * from "./condition";