@dereekb/util 8.12.1 → 8.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [8.12.2](https://github.com/dereekb/dbx-components/compare/v8.12.1-dev...v8.12.2) (2022-07-08)
6
+
7
+
8
+
5
9
  ## [8.12.1](https://github.com/dereekb/dbx-components/compare/v8.12.0-dev...v8.12.1) (2022-07-08)
6
10
 
7
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util",
3
- "version": "8.12.1",
3
+ "version": "8.12.2",
4
4
  "type": "commonjs",
5
5
  "exports": {
6
6
  ".": {
package/src/lib/type.d.ts CHANGED
@@ -69,17 +69,25 @@ export declare type StringKeyPropertyKeys<T> = keyof StringKeyProperties<T>;
69
69
  * Makes a readonly type able to be configured. Useful for configurating readonly types before they are used.
70
70
  */
71
71
  export declare type Configurable<T> = Writable<T>;
72
+ /**
73
+ * StringOrder of all keys of an object.
74
+ */
75
+ export declare type CommaSeparatedKeyOrderOfObject<T extends object> = CommaSeparatedKeyOrder<`${KeyCanBeString<keyof T>}`>;
76
+ export declare type CommaSeparatedKeyOrder<T extends string> = StringOrder<T, ','>;
77
+ /**
78
+ * StringCombinations of all keys of an object.
79
+ */
80
+ export declare type CommaSeparatedKeyCombinationsOfObject<T extends object> = CommaSeparatedKeyCombinations<`${KeyCanBeString<keyof T>}`>;
81
+ export declare type CommaSeparatedKeyCombinations<T extends string> = StringCombination<T, ','>;
72
82
  /**
73
83
  * StringConcatination of all keys of an object.
74
84
  */
75
85
  export declare type CommaSeparatedKeysOfObject<T extends object> = CommaSeparatedKeys<`${KeyCanBeString<keyof T>}`>;
76
86
  export declare type CommaSeparatedKeys<T extends string> = StringConcatination<T, ','>;
77
- export declare type CommaSeparatedKeyCombinationsOfObject<T extends object> = CommaSeparatedKeyCombinations<`${KeyCanBeString<keyof T>}`>;
78
- export declare type CommaSeparatedKeyCombinations<T extends string> = StringCombinations<T, ','>;
79
87
  export declare type UnionToOvlds<U> = UnionToIntersection<U extends any ? (f: U) => void : never>;
80
88
  export declare type PopUnion<U> = UnionToOvlds<U> extends (a: infer A) => void ? A : never;
81
89
  /**
82
- * A type that merges all combinations of strings together using a separator.
90
+ * A type that merges all combinations of strings together using a separator, but restricts a certain order.
83
91
  *
84
92
  * Example:
85
93
  * 'a' | 'b' | 'c' w/ ',' -> 'a' | 'b' | 'c' | 'a,b' | 'a,c' | 'a,b,c' | etc...
@@ -88,7 +96,14 @@ export declare type PopUnion<U> = UnionToOvlds<U> extends (a: infer A) => void ?
88
96
  *
89
97
  * https://stackoverflow.com/a/65157132
90
98
  */
91
- export declare type StringCombinations<S extends string, SEPARATOR extends string> = PopUnion<S> extends infer SELF ? SELF extends string ? Exclude<S, SELF> extends never ? SELF : `${StringCombinations<Exclude<S, SELF>, SEPARATOR>}${SEPARATOR}${SELF}` | StringCombinations<Exclude<S, SELF>, SEPARATOR> | SELF : never : never;
99
+ export declare type StringOrder<S extends string, SEPARATOR extends string> = PopUnion<S> extends infer SELF ? SELF extends string ? Exclude<S, SELF> extends never ? SELF : `${StringOrder<Exclude<S, SELF>, SEPARATOR>}${SEPARATOR}${SELF}` | StringOrder<Exclude<S, SELF>, SEPARATOR> | SELF : never : never;
100
+ /**
101
+ * A type that merges all combinations of strings together using a separator.
102
+ *
103
+ * Example:
104
+ * 'a' | 'b' | 'c' w/ ',' -> 'a' | 'b' | 'c' | 'a,b' | 'b,a' | 'c,a,b' | etc...
105
+ */
106
+ export declare type StringCombination<S extends string, SEPARATOR extends string> = PopUnion<S> extends infer SELF ? SELF extends string ? Exclude<S, SELF> extends never ? SELF : `${StringCombination<Exclude<S, SELF>, SEPARATOR>}${SEPARATOR}${SELF}` | `${SELF}${SEPARATOR}${StringCombination<Exclude<S, SELF>, SEPARATOR>}` | StringCombination<Exclude<S, SELF>, SEPARATOR> | SELF : never : never;
92
107
  /**
93
108
  * A type that merges all the input strings together using a separator.
94
109
  *
@@ -96,3 +111,7 @@ export declare type StringCombinations<S extends string, SEPARATOR extends strin
96
111
  * 'a' | 'b' | 'c' w/ ',' -> 'a,b,c' | 'a,c,b'
97
112
  */
98
113
  export declare type StringConcatination<S extends string, SEPARATOR extends string> = PopUnion<S> extends infer SELF ? SELF extends string ? Exclude<S, SELF> extends never ? SELF : `${StringConcatination<Exclude<S, SELF>, SEPARATOR>}${SEPARATOR}${SELF}` | `${SELF}${SEPARATOR}${StringConcatination<Exclude<S, SELF>, SEPARATOR>}` : never : never;
114
+ /**
115
+ * @deprecated use StringCombination
116
+ */
117
+ export declare type StringCombinations<S extends string, SEPARATOR extends string> = StringCombination<S, SEPARATOR>;
package/test/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [8.12.2](https://github.com/dereekb/dbx-components/compare/v8.12.1-dev...v8.12.2) (2022-07-08)
6
+
7
+
8
+
5
9
  ## [8.12.1](https://github.com/dereekb/dbx-components/compare/v8.12.0-dev...v8.12.1) (2022-07-08)
6
10
 
7
11
 
package/test/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dereekb/util/test",
3
- "version": "8.12.1",
3
+ "version": "8.12.2",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./src/index.d.ts",
7
7
  "dependencies": {},
8
8
  "peerDependencies": {
9
- "@dereekb/util": "8.12.1",
9
+ "@dereekb/util": "8.12.2",
10
10
  "make-error": "^1.3.0",
11
11
  "ts-essentials": "^9.1.2",
12
12
  "extra-set": "^2.2.11",