@dereekb/util 9.25.16 → 10.0.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 +8 -0
- package/fetch/CHANGELOG.md +8 -0
- package/fetch/package.json +2 -14
- package/fetch/src/lib/fetch.d.ts +5 -5
- package/fetch/src/lib/fetch.type.d.ts +3 -3
- package/fetch/src/lib/json.d.ts +8 -8
- package/fetch/src/lib/timeout.js +3 -2
- package/fetch/src/lib/timeout.js.map +1 -1
- package/fetch/src/lib/url.d.ts +10 -10
- package/package.json +5 -8
- package/src/lib/array/array.boolean.d.ts +3 -3
- package/src/lib/array/array.d.ts +25 -6
- package/src/lib/array/array.factory.d.ts +4 -4
- package/src/lib/array/array.filter.d.ts +1 -1
- package/src/lib/array/array.find.d.ts +2 -2
- package/src/lib/array/array.index.d.ts +3 -3
- package/src/lib/array/array.indexed.d.ts +6 -6
- package/src/lib/array/array.js +31 -11
- package/src/lib/array/array.js.map +1 -1
- package/src/lib/array/array.make.d.ts +1 -1
- package/src/lib/array/array.number.d.ts +2 -2
- package/src/lib/array/array.random.d.ts +1 -1
- package/src/lib/array/array.string.d.ts +8 -5
- package/src/lib/array/array.string.js +6 -6
- package/src/lib/array/array.string.js.map +1 -1
- package/src/lib/array/array.unique.d.ts +3 -11
- package/src/lib/array/array.unique.js +1 -10
- package/src/lib/array/array.unique.js.map +1 -1
- package/src/lib/assertion/assertion.d.ts +2 -2
- package/src/lib/auth/auth.role.claims.d.ts +12 -12
- package/src/lib/auth/auth.role.d.ts +2 -2
- package/src/lib/boolean.d.ts +2 -2
- package/src/lib/contact/domain.d.ts +1 -1
- package/src/lib/contact/email.d.ts +3 -3
- package/src/lib/contact/phone.d.ts +5 -5
- package/src/lib/contact/random.d.ts +2 -2
- package/src/lib/date/date.d.ts +22 -22
- package/src/lib/date/date.time.d.ts +4 -4
- package/src/lib/date/date.time.js +1 -1
- package/src/lib/date/date.time.js.map +1 -1
- package/src/lib/date/hour.d.ts +1 -1
- package/src/lib/date/week.d.ts +10 -10
- package/src/lib/date/week.js +1 -1
- package/src/lib/date/week.js.map +1 -1
- package/src/lib/error/error.d.ts +5 -5
- package/src/lib/error/error.server.d.ts +1 -1
- package/src/lib/file/xml.d.ts +1 -1
- package/src/lib/filter/filter.d.ts +2 -2
- package/src/lib/function/function.boolean.d.ts +1 -1
- package/src/lib/function/function.forward.d.ts +2 -2
- package/src/lib/getter/getter.cache.d.ts +2 -2
- package/src/lib/getter/getter.d.ts +12 -12
- package/src/lib/getter/getter.map.d.ts +1 -1
- package/src/lib/getter/getter.util.d.ts +1 -1
- package/src/lib/getter/type.d.ts +1 -1
- package/src/lib/grouping.d.ts +2 -2
- package/src/lib/hash.d.ts +2 -2
- package/src/lib/iterable/iterable.d.ts +1 -1
- package/src/lib/iterate.d.ts +2 -2
- package/src/lib/key.d.ts +6 -6
- package/src/lib/key.js +1 -1
- package/src/lib/key.js.map +1 -1
- package/src/lib/lifecycle.d.ts +1 -1
- package/src/lib/map/map.intersection.js +1 -1
- package/src/lib/map/map.intersection.js.map +1 -1
- package/src/lib/map/map.key.d.ts +2 -2
- package/src/lib/model/id.batch.d.ts +3 -9
- package/src/lib/model/id.batch.js +2 -2
- package/src/lib/model/id.batch.js.map +1 -1
- package/src/lib/model/model.conversion.d.ts +32 -32
- package/src/lib/model/model.copy.d.ts +3 -3
- package/src/lib/model/model.d.ts +11 -11
- package/src/lib/model/model.modify.d.ts +4 -4
- package/src/lib/nodejs/stream.d.ts +1 -1
- package/src/lib/number/bitwise.dencoder.d.ts +10 -10
- package/src/lib/number/bitwise.dencoder.js +1 -1
- package/src/lib/number/bitwise.dencoder.js.map +1 -1
- package/src/lib/number/bound.d.ts +3 -3
- package/src/lib/number/dollar.d.ts +4 -4
- package/src/lib/number/factory.d.ts +1 -1
- package/src/lib/number/number.d.ts +5 -5
- package/src/lib/number/pay.d.ts +2 -2
- package/src/lib/number/random.d.ts +2 -2
- package/src/lib/number/round.d.ts +11 -11
- package/src/lib/number/sort.d.ts +1 -1
- package/src/lib/number/transform.d.ts +2 -2
- package/src/lib/object/object.array.delta.d.ts +4 -4
- package/src/lib/object/object.d.ts +2 -2
- package/src/lib/object/object.equal.d.ts +1 -1
- package/src/lib/object/object.filter.pojo.d.ts +16 -16
- package/src/lib/object/object.filter.tuple.d.ts +5 -5
- package/src/lib/object/object.filter.tuple.js +1 -1
- package/src/lib/object/object.filter.tuple.js.map +1 -1
- package/src/lib/object/object.map.d.ts +5 -5
- package/src/lib/page/page.d.ts +1 -1
- package/src/lib/path/path.d.ts +13 -13
- package/src/lib/path/path.js +1 -1
- package/src/lib/path/path.js.map +1 -1
- package/src/lib/promise/callback.d.ts +2 -2
- package/src/lib/promise/promise.d.ts +4 -33
- package/src/lib/promise/promise.js +2 -31
- package/src/lib/promise/promise.js.map +1 -1
- package/src/lib/promise/promise.loop.d.ts +2 -2
- package/src/lib/promise/promise.ref.d.ts +2 -2
- package/src/lib/promise/promise.type.d.ts +1 -1
- package/src/lib/promise/use.d.ts +1 -1
- package/src/lib/relation/relation.d.ts +8 -8
- package/src/lib/relation/relation.js +1 -1
- package/src/lib/relation/relation.js.map +1 -1
- package/src/lib/service/handler.config.d.ts +6 -6
- package/src/lib/service/handler.d.ts +6 -6
- package/src/lib/set/set.d.ts +6 -18
- package/src/lib/set/set.decision.d.ts +1 -1
- package/src/lib/set/set.delta.d.ts +2 -2
- package/src/lib/set/set.delta.js +1 -1
- package/src/lib/set/set.delta.js.map +1 -1
- package/src/lib/set/set.js +5 -18
- package/src/lib/set/set.js.map +1 -1
- package/src/lib/set/set.mode.d.ts +1 -1
- package/src/lib/set/set.selection.d.ts +1 -1
- package/src/lib/sort.d.ts +9 -9
- package/src/lib/sort.js.map +1 -1
- package/src/lib/storage/storage.d.ts +2 -2
- package/src/lib/string/char.d.ts +1 -1
- package/src/lib/string/dencoder.d.ts +7 -7
- package/src/lib/string/html.d.ts +2 -2
- package/src/lib/string/password.d.ts +1 -1
- package/src/lib/string/replace.d.ts +5 -5
- package/src/lib/string/search.d.ts +3 -3
- package/src/lib/string/sort.d.ts +1 -1
- package/src/lib/string/string.d.ts +4 -4
- package/src/lib/string/transform.d.ts +4 -4
- package/src/lib/string/url.d.ts +14 -14
- package/src/lib/string/url.js.map +1 -1
- package/src/lib/tree/tree.array.d.ts +1 -1
- package/src/lib/tree/tree.d.ts +1 -1
- package/src/lib/tree/tree.expand.d.ts +1 -1
- package/src/lib/tree/tree.flatten.d.ts +1 -1
- package/src/lib/type.d.ts +51 -51
- package/src/lib/value/address.d.ts +7 -7
- package/src/lib/value/bound.d.ts +13 -13
- package/src/lib/value/build.d.ts +2 -2
- package/src/lib/value/comparator.d.ts +47 -1
- package/src/lib/value/comparator.js +35 -1
- package/src/lib/value/comparator.js.map +1 -1
- package/src/lib/value/cron.d.ts +1 -1
- package/src/lib/value/decision.d.ts +3 -3
- package/src/lib/value/equal.d.ts +2 -8
- package/src/lib/value/indexed.d.ts +21 -21
- package/src/lib/value/indexed.js.map +1 -1
- package/src/lib/value/map.d.ts +14 -8
- package/src/lib/value/map.js.map +1 -1
- package/src/lib/value/maybe.type.d.ts +4 -4
- package/src/lib/value/modifier.d.ts +3 -3
- package/src/lib/value/pixel.d.ts +2 -2
- package/src/lib/value/point.d.ts +22 -26
- package/src/lib/value/sync.d.ts +2 -2
- package/src/lib/value/sync.js +1 -1
- package/src/lib/value/sync.js.map +1 -1
- package/src/lib/value/use.d.ts +7 -7
- package/src/lib/value/vector.d.ts +5 -5
- package/src/lib/value/zoom.d.ts +1 -1
- package/test/CHANGELOG.md +8 -0
- package/test/package.json +2 -14
- package/test/src/lib/jest.d.ts +5 -5
- package/test/src/lib/jest.fail.d.ts +5 -5
- package/test/src/lib/jest.function.d.ts +7 -7
- package/test/src/lib/jest.wrap.d.ts +1 -1
package/src/lib/type.d.ts
CHANGED
|
@@ -3,14 +3,14 @@ import { Maybe } from './value/maybe.type';
|
|
|
3
3
|
/**
|
|
4
4
|
* Boolean, string or number value.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type PrimativeValue = boolean | string | number;
|
|
7
7
|
/**
|
|
8
8
|
* Class typing, restricted to types that have a constructor via the new keyword.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type ClassType<T = unknown> = {
|
|
11
11
|
new (...args: unknown[]): T;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type ObjectWithConstructor = {
|
|
14
14
|
constructor: Function;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
@@ -27,7 +27,7 @@ export declare function isObjectWithConstructor(obj: any): obj is ObjectWithCons
|
|
|
27
27
|
* @returns
|
|
28
28
|
*/
|
|
29
29
|
export declare function isClassLikeType(obj: unknown): obj is ClassLikeType;
|
|
30
|
-
export
|
|
30
|
+
export type FunctionType = 'function' | 'class' | 'arrow';
|
|
31
31
|
/**
|
|
32
32
|
* Returns the input value's function type, or null if not a function.
|
|
33
33
|
*
|
|
@@ -45,42 +45,42 @@ export declare function isNonClassFunction(x: unknown): x is Function;
|
|
|
45
45
|
/**
|
|
46
46
|
* Similar to ClassType, but allows for abstract classes.
|
|
47
47
|
*/
|
|
48
|
-
export
|
|
48
|
+
export type ClassLikeType<T = unknown> = abstract new (...args: unknown[]) => T;
|
|
49
49
|
/**
|
|
50
50
|
* Special type used to defined other type definitions that state the defined type has every key of one type, but each key has a single/new value type.
|
|
51
51
|
*/
|
|
52
|
-
export
|
|
52
|
+
export type KeyValueTransformMap<T, V, X extends keyof T = keyof T> = {
|
|
53
53
|
[K in X]: V;
|
|
54
54
|
};
|
|
55
|
-
export
|
|
55
|
+
export type StringKeyValueTransformMap<T, V> = {
|
|
56
56
|
[K in keyof T as string]: V;
|
|
57
57
|
};
|
|
58
|
-
export
|
|
58
|
+
export type KeysAsStrings<T> = {
|
|
59
59
|
[K in keyof T as string]: T[K];
|
|
60
60
|
};
|
|
61
|
-
export
|
|
61
|
+
export type ValuesTypesAsArray<T> = T[keyof T][];
|
|
62
62
|
/**
|
|
63
63
|
* Converts the input value to a string, if possible. Never otherwise.
|
|
64
64
|
*/
|
|
65
|
-
export
|
|
66
|
-
export
|
|
67
|
-
export
|
|
65
|
+
export type KeyAsString<K> = `${KeyCanBeString<K>}`;
|
|
66
|
+
export type KeyCanBeString<K> = K extends number | boolean | string | null | undefined ? K : never;
|
|
67
|
+
export type BooleanKeyValueTransformMap<T> = KeyValueTransformMap<T, boolean>;
|
|
68
68
|
/**
|
|
69
69
|
* Merges the types T and R, but replaces keys within T with those in R.
|
|
70
70
|
*/
|
|
71
|
-
export
|
|
71
|
+
export type MergeReplace<T, R> = Merge<T, R>;
|
|
72
72
|
/**
|
|
73
73
|
* Similar to MergeReplace, but only allows keys that are defined within T.
|
|
74
74
|
*/
|
|
75
|
-
export
|
|
75
|
+
export type Replace<T, R> = StrictOmit<MergeReplace<T, R>, Exclude<keyof R, keyof T>>;
|
|
76
76
|
/**
|
|
77
77
|
* Similar to Replace, but all types that were not replaced are set to the third type (default unknown).
|
|
78
78
|
*/
|
|
79
|
-
export
|
|
79
|
+
export type ReplaceType<I extends object, O extends object, X = unknown> = {
|
|
80
80
|
[K in keyof I]: K extends keyof O ? O[K] : X;
|
|
81
81
|
};
|
|
82
|
-
export
|
|
83
|
-
export
|
|
82
|
+
export type OnlyStringKeys<T> = PickProperties<T, 'string'>;
|
|
83
|
+
export type RemoveIndex<T> = {
|
|
84
84
|
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
@@ -88,62 +88,62 @@ export declare type RemoveIndex<T> = {
|
|
|
88
88
|
*
|
|
89
89
|
* https://stackoverflow.com/questions/51954558/how-can-i-remove-a-wider-type-from-a-union-type-without-removing-its-subtypes-in/51955852#51955852
|
|
90
90
|
*/
|
|
91
|
-
export
|
|
91
|
+
export type KnownKeys<T> = keyof RemoveIndex<T>;
|
|
92
92
|
/**
|
|
93
93
|
* Makes the input key(s) required.
|
|
94
94
|
*/
|
|
95
|
-
export
|
|
95
|
+
export type RequiredOnKeys<T, K> = K extends keyof T ? Omit<T, K> & Required<Pick<T, K>> : T;
|
|
96
96
|
/**
|
|
97
97
|
* Makes the input key(s) partials.
|
|
98
98
|
*/
|
|
99
|
-
export
|
|
99
|
+
export type PartialOnKeys<T, K> = K extends keyof T ? Omit<T, K> & Partial<Pick<T, K>> : T;
|
|
100
100
|
/**
|
|
101
101
|
* Returns only properties that have string keys.
|
|
102
102
|
*/
|
|
103
|
-
export
|
|
103
|
+
export type StringKeyProperties<T> = NonNever<{
|
|
104
104
|
[K in keyof T]: K extends string ? T[K] : never;
|
|
105
105
|
}>;
|
|
106
106
|
/**
|
|
107
107
|
* Returns the name of all keys that are strings.
|
|
108
108
|
*/
|
|
109
|
-
export
|
|
109
|
+
export type StringKeyPropertyKeys<T> = keyof StringKeyProperties<T>;
|
|
110
110
|
/**
|
|
111
111
|
* Makes a readonly type able to be configured. Useful for configurating readonly types before they are used.
|
|
112
112
|
*/
|
|
113
|
-
export
|
|
113
|
+
export type Configurable<T> = Writable<T>;
|
|
114
114
|
/**
|
|
115
115
|
* StringOrder of all keys of an object.
|
|
116
116
|
*
|
|
117
117
|
* NOTE: Intellisense may not return the correct order.
|
|
118
118
|
*/
|
|
119
|
-
export
|
|
120
|
-
export
|
|
119
|
+
export type CommaSeparatedKeyOrderOfObject<T extends object> = CommaSeparatedKeyOrder<`${KeyCanBeString<keyof T>}`>;
|
|
120
|
+
export type CommaSeparatedKeyOrder<T extends string> = StringOrder<T, ','>;
|
|
121
121
|
/**
|
|
122
122
|
* StringCombinations of all keys of an object.
|
|
123
123
|
*/
|
|
124
|
-
export
|
|
125
|
-
export
|
|
124
|
+
export type CommaSeparatedKeyCombinationsOfObject<T extends object> = CommaSeparatedKeyCombinations<`${KeyCanBeString<keyof T>}`>;
|
|
125
|
+
export type CommaSeparatedKeyCombinations<T extends string> = StringCombination<T, ','>;
|
|
126
126
|
/**
|
|
127
127
|
* StringConcatenationApproximation of keys of an object in approximate order.
|
|
128
128
|
*/
|
|
129
|
-
export
|
|
130
|
-
export
|
|
129
|
+
export type CommaSeparatedKeysOfObject<T extends object> = CommaSeparatedKeys<`${KeyCanBeString<keyof T>}`>;
|
|
130
|
+
export type CommaSeparatedKeys<T extends string> = StringConcatenationApproximation<T, ','>;
|
|
131
131
|
/**
|
|
132
132
|
* StringConcatenation of all keys of an object in no particular order.
|
|
133
133
|
*
|
|
134
134
|
* May fail for more complex types, requiring the use of CommaSeparatedKeysOfObject.
|
|
135
135
|
*/
|
|
136
|
-
export
|
|
137
|
-
export
|
|
136
|
+
export type AllCommaSeparatedKeysOfObject<T extends object> = AllCommaSeparatedKeys<`${KeyCanBeString<keyof T>}`>;
|
|
137
|
+
export type AllCommaSeparatedKeys<T extends string> = StringConcatenation<T, ','>;
|
|
138
138
|
/**
|
|
139
139
|
* StringConcatenationOrder of all keys of an object in ascending order.
|
|
140
140
|
*
|
|
141
141
|
* NOTE: Intellisense may not return the correct order.
|
|
142
142
|
*/
|
|
143
|
-
export
|
|
144
|
-
export
|
|
145
|
-
export
|
|
146
|
-
export
|
|
143
|
+
export type OrderedCommaSeparatedKeysOfObject<T extends object> = OrderedCommaSeparatedKeys<`${KeyCanBeString<keyof T>}`>;
|
|
144
|
+
export type OrderedCommaSeparatedKeys<T extends string> = StringConcatenationOrder<T, ','>;
|
|
145
|
+
export type UnionToOvlds<U> = UnionToIntersection<U extends any ? (f: U) => void : never>;
|
|
146
|
+
export type PopUnion<U> = UnionToOvlds<U> extends (a: infer A) => void ? A : never;
|
|
147
147
|
/**
|
|
148
148
|
* A type that merges all combinations of strings together using a separator, but restricts the result to ascending lexigraphical order.
|
|
149
149
|
*
|
|
@@ -156,7 +156,7 @@ export declare type PopUnion<U> = UnionToOvlds<U> extends (a: infer A) => void ?
|
|
|
156
156
|
*
|
|
157
157
|
* https://stackoverflow.com/a/65157132
|
|
158
158
|
*/
|
|
159
|
-
export
|
|
159
|
+
export type StringOrder<S extends string, SEPARATOR extends string> = PopUnion<S> extends infer SELF ? SELF extends string ? Exclude<S, SELF> extends never ? SELF : // This works because the values of S are always sorted and interpreted in an ascending order
|
|
160
160
|
`${StringOrder<Exclude<S, SELF>, SEPARATOR>}${SEPARATOR}${SELF}` | StringOrder<Exclude<S, SELF>, SEPARATOR> | SELF : never : never;
|
|
161
161
|
/**
|
|
162
162
|
* A type that merges all combinations of strings together using a separator.
|
|
@@ -164,7 +164,7 @@ export declare type StringOrder<S extends string, SEPARATOR extends string> = Po
|
|
|
164
164
|
* Example:
|
|
165
165
|
* 'a' | 'b' | 'c' w/ ',' -> 'a' | 'b' | 'c' | 'a,b' | 'b,a' | 'c,a,b' | etc...
|
|
166
166
|
*/
|
|
167
|
-
export
|
|
167
|
+
export 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;
|
|
168
168
|
/**
|
|
169
169
|
* A type that merges all the input strings together and requires them sorted and interpreted in an ascending order
|
|
170
170
|
*
|
|
@@ -173,18 +173,18 @@ export declare type StringCombination<S extends string, SEPARATOR extends string
|
|
|
173
173
|
* Example:
|
|
174
174
|
* 'a' | 'c' | 'b' w/ ',' -> 'a,b,c'
|
|
175
175
|
*/
|
|
176
|
-
export
|
|
176
|
+
export type StringConcatenationOrder<S extends string, SEPARATOR extends string> = PopUnion<S> extends infer SELF ? SELF extends string ? Exclude<S, SELF> extends never ? `${SELF}` : `${StringConcatenationOrder<Exclude<S, SELF>, SEPARATOR>}${SEPARATOR}${SELF}` : never : never;
|
|
177
177
|
/**
|
|
178
178
|
* A type that merges all the input strings together using a separator.
|
|
179
179
|
*
|
|
180
180
|
* Example:
|
|
181
181
|
* 'a' | 'b' | 'c' w/ ',' -> 'a,b,c' | 'a,c,b' | 'b,a,c' | etc...
|
|
182
182
|
*/
|
|
183
|
-
export
|
|
183
|
+
export type StringConcatenation<S extends string, SEPARATOR extends string> = StringConcatenationMany<S, SEPARATOR>;
|
|
184
184
|
/**
|
|
185
185
|
* Used to "approximate" larger concatenations. In reality, this just excludes the earlier types from being present in the middle.
|
|
186
186
|
*/
|
|
187
|
-
export
|
|
187
|
+
export type StringConcatenationApproximation<S extends string, SEPARATOR extends string> = PopUnion<S> extends infer SELF ? SELF extends string ? Exclude<S, SELF> extends never ? `${SELF}` : `${StringConcatenationApproximation<Exclude<S, SELF>, SEPARATOR>}${SEPARATOR}${SELF}` | `${SELF}${SEPARATOR}${StringConcatenationApproximation<Exclude<S, SELF>, SEPARATOR>}` : never : never;
|
|
188
188
|
/**
|
|
189
189
|
* Creates the concatenations for the input.
|
|
190
190
|
*
|
|
@@ -192,14 +192,14 @@ export declare type StringConcatenationApproximation<S extends string, SEPARATOR
|
|
|
192
192
|
*
|
|
193
193
|
* The max number of strings allowed is 7. If there are more than 7 strings passed, this function will use StringConcatenationApproximation.
|
|
194
194
|
*/
|
|
195
|
-
export
|
|
196
|
-
export
|
|
197
|
-
export
|
|
198
|
-
export
|
|
199
|
-
export
|
|
200
|
-
export
|
|
201
|
-
export
|
|
202
|
-
export
|
|
203
|
-
export
|
|
204
|
-
export
|
|
205
|
-
export
|
|
195
|
+
export type StringConcatenationMany<S extends string, SEPARATOR extends string> = PopUnion<S> extends infer ONE ? ONE extends string ? PopUnion<Exclude<S, ONE>> extends infer TWO ? TWO extends string ? Exclude<S, ONE | TWO> extends never ? StringConcatinateTwo<ONE, TWO, SEPARATOR> : PopUnion<Exclude<S, ONE | TWO>> extends infer THREE ? THREE extends string ? Exclude<S, ONE | TWO | THREE> extends never ? StringConcatinateThree<ONE, TWO, THREE, SEPARATOR> : PopUnion<Exclude<S, ONE | TWO | THREE>> extends infer FOUR ? FOUR extends string ? Exclude<S, ONE | TWO | THREE | FOUR> extends never ? StringConcatinateFour<ONE, TWO, THREE, FOUR, SEPARATOR> : PopUnion<Exclude<S, ONE | TWO | THREE | FOUR>> extends infer FIVE ? FIVE extends string ? Exclude<S, ONE | TWO | THREE | FOUR | FIVE> extends never ? StringConcatinateFive<ONE, TWO, THREE, FOUR, FIVE, SEPARATOR> : PopUnion<Exclude<S, ONE | TWO | THREE | FOUR | FIVE>> extends infer SIX ? SIX extends string ? Exclude<S, ONE | TWO | THREE | FOUR | FIVE | SIX> extends never ? StringConcatinateSix<ONE, TWO, THREE, FOUR, FIVE, SIX, SEPARATOR> : PopUnion<Exclude<S, ONE | TWO | THREE | FOUR | FIVE | SIX>> extends infer SEVEN ? SEVEN extends string ? Exclude<S, ONE | TWO | THREE | FOUR | FIVE | SIX | SEVEN> extends never ? StringConcatinateSeven<ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, SEPARATOR> : PopUnion<Exclude<S, ONE | TWO | THREE | FOUR | FIVE | SIX | SEVEN>> extends infer EIGHT ? EIGHT extends string ? StringConcatenationApproximation<S, SEPARATOR> : never : StringConcatinateSeven<ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, SEPARATOR> : never : StringConcatinateSix<ONE, TWO, THREE, FOUR, FIVE, SIX, SEPARATOR> : never : StringConcatinateFive<ONE, TWO, THREE, FOUR, FIVE, SEPARATOR> : never : StringConcatinateFour<ONE, TWO, THREE, FOUR, SEPARATOR> : never : StringConcatinateThree<ONE, TWO, THREE, SEPARATOR> : StringConcatinateTwo<ONE, TWO, SEPARATOR> : StringConcatinateTwo<ONE, TWO, SEPARATOR> : never : ONE : never : never;
|
|
196
|
+
export type StringConcatinateTwo<LEFT extends string, SELF extends string, SEPARATOR extends string> = `${LEFT}${SEPARATOR}${SELF}` | `${SELF}${SEPARATOR}${LEFT}`;
|
|
197
|
+
export type StringConcatinateThree<LEFT extends string, RIGHT extends string, SELF extends string, SEPARATOR extends string> = `${LEFT}${SEPARATOR}${SELF}${SEPARATOR}${RIGHT}` | `${LEFT}${SEPARATOR}${RIGHT}${SEPARATOR}${SELF}` | `${SELF}${SEPARATOR}${RIGHT}${SEPARATOR}${LEFT}` | `${SELF}${SEPARATOR}${LEFT}${SEPARATOR}${RIGHT}` | `${RIGHT}${SEPARATOR}${LEFT}${SEPARATOR}${SELF}` | `${RIGHT}${SEPARATOR}${SELF}${SEPARATOR}${LEFT}`;
|
|
198
|
+
export type StringConcatinateFour<ONE extends string, TWO extends string, THREE extends string, FOUR extends string, SEPARATOR extends string> = `${StringConcatinateThree<ONE, TWO, THREE, SEPARATOR>}${SEPARATOR}${FOUR}` | `${StringConcatinateThree<TWO, THREE, FOUR, SEPARATOR>}${SEPARATOR}${ONE}` | `${StringConcatinateThree<THREE, FOUR, ONE, SEPARATOR>}${SEPARATOR}${TWO}` | `${StringConcatinateThree<FOUR, ONE, TWO, SEPARATOR>}${SEPARATOR}${THREE}`;
|
|
199
|
+
export type StringConcatinateFive<ONE extends string, TWO extends string, THREE extends string, FOUR extends string, FIVE extends string, SEPARATOR extends string> = `${StringConcatinateFour<ONE, TWO, THREE, FOUR, SEPARATOR>}${SEPARATOR}${FIVE}` | `${StringConcatinateFour<TWO, THREE, FOUR, FIVE, SEPARATOR>}${SEPARATOR}${ONE}` | `${StringConcatinateFour<THREE, FOUR, FIVE, ONE, SEPARATOR>}${SEPARATOR}${TWO}` | `${StringConcatinateFour<FOUR, FIVE, ONE, TWO, SEPARATOR>}${SEPARATOR}${THREE}` | `${StringConcatinateFour<FIVE, ONE, TWO, THREE, SEPARATOR>}${SEPARATOR}${FOUR}`;
|
|
200
|
+
export type StringConcatinateSix<ONE extends string, TWO extends string, THREE extends string, FOUR extends string, FIVE extends string, SIX extends string, SEPARATOR extends string> = `${StringConcatinateFive<ONE, TWO, THREE, FOUR, FIVE, SEPARATOR>}${SEPARATOR}${SIX}` | `${StringConcatinateFive<TWO, THREE, FOUR, FIVE, SIX, SEPARATOR>}${SEPARATOR}${ONE}` | `${StringConcatinateFive<THREE, FOUR, FIVE, SIX, ONE, SEPARATOR>}${SEPARATOR}${TWO}` | `${StringConcatinateFive<FOUR, FIVE, SIX, ONE, TWO, SEPARATOR>}${SEPARATOR}${THREE}` | `${StringConcatinateFive<FIVE, SIX, ONE, TWO, THREE, SEPARATOR>}${SEPARATOR}${FOUR}` | `${StringConcatinateFive<SIX, ONE, TWO, THREE, FOUR, SEPARATOR>}${SEPARATOR}${FIVE}`;
|
|
201
|
+
export type StringConcatinateSeven<ONE extends string, TWO extends string, THREE extends string, FOUR extends string, FIVE extends string, SIX extends string, SEVEN extends string, SEPARATOR extends string> = `${StringConcatinateSix<SEVEN, ONE, TWO, THREE, FOUR, FIVE, SEPARATOR>}${SEPARATOR}${SIX}` | `${StringConcatinateSix<TWO, THREE, FOUR, FIVE, SIX, SEVEN, SEPARATOR>}${SEPARATOR}${ONE}` | `${StringConcatinateSix<THREE, FOUR, FIVE, SIX, SEVEN, ONE, SEPARATOR>}${SEPARATOR}${TWO}` | `${StringConcatinateSix<FOUR, FIVE, SIX, SEVEN, ONE, TWO, SEPARATOR>}${SEPARATOR}${THREE}` | `${StringConcatinateSix<FIVE, SIX, SEVEN, ONE, TWO, THREE, SEPARATOR>}${SEPARATOR}${FOUR}` | `${StringConcatinateSix<SIX, SEVEN, ONE, TWO, THREE, FOUR, SEPARATOR>}${SEPARATOR}${FIVE}`;
|
|
202
|
+
export type IsSingleCharacter<S extends string> = PopUnion<S> extends infer SELF ? (Exclude<S, SELF> extends never ? S : never) : never;
|
|
203
|
+
export type HasTwoOrMoreCharacters<S extends string> = PopUnion<S> extends infer FIRST ? FIRST extends string ? PopUnion<Exclude<S, FIRST>> extends infer SECOND ? SECOND extends string ? S : never : never : never : never;
|
|
204
|
+
export type HasThreeCharacters<S extends string> = PopUnion<S> extends infer FIRST ? FIRST extends string ? PopUnion<Exclude<S, FIRST>> extends infer SECOND ? SECOND extends string ? PopUnion<Exclude<S, FIRST | SECOND>> extends infer THIRD ? THIRD extends string ? Exclude<S, FIRST | SECOND | THIRD> extends never ? S : never : never : never : never : never : never : never;
|
|
205
|
+
export type HasThreeOrMoreCharacters<S extends string> = PopUnion<S> extends infer FIRST ? FIRST extends string ? PopUnion<Exclude<S, FIRST>> extends infer SECOND ? SECOND extends string ? PopUnion<Exclude<S, FIRST | SECOND>> extends infer THIRD ? THIRD extends string ? S : never : never : never : never : never : never;
|
|
@@ -2,25 +2,25 @@ import { Maybe } from './maybe.type';
|
|
|
2
2
|
/**
|
|
3
3
|
* City name
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type CityString = string;
|
|
6
6
|
/**
|
|
7
7
|
* Full state name
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type StateString = string;
|
|
10
10
|
/**
|
|
11
11
|
* State code
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type StateCodeString = string;
|
|
14
14
|
/**
|
|
15
15
|
* Full country name
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type CountryString = string;
|
|
18
18
|
/**
|
|
19
19
|
* Country code
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
21
|
+
export type CountryCodeString = string;
|
|
22
|
+
export type AddressLineString = string;
|
|
23
|
+
export type ZipCodeString = string;
|
|
24
24
|
/**
|
|
25
25
|
* Basic US Address that has 2 lines, a city, state, and zip code.
|
|
26
26
|
*/
|
package/src/lib/value/bound.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ import { Rectangle } from './vector';
|
|
|
3
3
|
import { LatLngPoint, LatLngPointInput, LatLngPrecision, LatLngPointFunction } from './point';
|
|
4
4
|
import { DecisionFunction } from './decision';
|
|
5
5
|
import { ArrayOrValue } from '../array';
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type LatLngBoundSouthWestPoint = LatLngPoint;
|
|
7
|
+
export type LatLngBoundNothEastPoint = LatLngPoint;
|
|
8
8
|
export interface LatLngBound {
|
|
9
9
|
sw: LatLngBoundSouthWestPoint;
|
|
10
10
|
ne: LatLngBoundNothEastPoint;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export type LatLngBoundOrPoint = LatLngBound | LatLngPoint;
|
|
13
13
|
export declare function isLatLngBound(input: LatLngBound | unknown): input is LatLngBound;
|
|
14
14
|
export declare function copyLatLngBound(input: LatLngBound): LatLngBound;
|
|
15
15
|
export declare function isSameLatLngBound(a: LatLngBound, b: LatLngBound): boolean;
|
|
@@ -46,15 +46,15 @@ export declare function latLngBoundWestBound(bound: LatLngBound): number;
|
|
|
46
46
|
/**
|
|
47
47
|
* Tuple of the sw corner and the north east point.
|
|
48
48
|
*/
|
|
49
|
-
export
|
|
50
|
-
export
|
|
51
|
-
export
|
|
49
|
+
export type LatLngBoundTuple = [LatLngBoundSouthWestPoint | LatLngPointInput, LatLngBoundNothEastPoint | LatLngPointInput];
|
|
50
|
+
export type LatLngBoundTuplePoints = [LatLngPointInput, LatLngPointInput, LatLngPointInput, LatLngPointInput];
|
|
51
|
+
export type LatLngBoundInput = LatLngBound | LatLngBoundTuple | LatLngBoundTuplePoints;
|
|
52
52
|
export declare function latLngBoundTuple(input: LatLngBoundSouthWestPoint | LatLngBoundInput, inputNe?: LatLngBoundNothEastPoint): LatLngBoundTuple;
|
|
53
53
|
/**
|
|
54
54
|
* Converts the input to a LatLngString
|
|
55
55
|
*/
|
|
56
|
-
export
|
|
57
|
-
export
|
|
56
|
+
export type LatLngBoundTupleFunction = ((input: LatLngBoundSouthWestPoint | LatLngBoundInput, inputNe?: LatLngBoundNothEastPoint) => LatLngBoundTuple) & ((sw: LatLngBoundSouthWestPoint, ne: LatLngBoundNothEastPoint) => LatLngBoundTuple) & ((bound: LatLngBoundInput) => LatLngBoundTuple);
|
|
57
|
+
export type LatLngBoundTupleFunctionConfig = LatLngBoundFunctionConfig;
|
|
58
58
|
/**
|
|
59
59
|
* Creates a LatLngBoundTupleFunction
|
|
60
60
|
*
|
|
@@ -66,7 +66,7 @@ export declare function latLngBound(input: LatLngBoundSouthWestPoint | LatLngBou
|
|
|
66
66
|
/**
|
|
67
67
|
* Converts the input to a LatLngBound
|
|
68
68
|
*/
|
|
69
|
-
export
|
|
69
|
+
export type LatLngBoundFunction = ((input: LatLngBoundSouthWestPoint | LatLngBoundInput, inputNe?: LatLngBoundNothEastPoint) => LatLngBound) & ((sw: LatLngBoundSouthWestPoint, ne: LatLngBoundNothEastPoint) => LatLngBound) & ((bound: LatLngBoundInput) => LatLngBound);
|
|
70
70
|
export interface LatLngBoundFunctionConfig {
|
|
71
71
|
/**
|
|
72
72
|
* Point function to use for calculations.
|
|
@@ -78,14 +78,14 @@ export interface LatLngBoundFunctionConfig {
|
|
|
78
78
|
precision?: LatLngPrecision;
|
|
79
79
|
}
|
|
80
80
|
export declare function latLngBoundFunction(config?: LatLngBoundFunctionConfig): LatLngBoundFunction;
|
|
81
|
-
export
|
|
81
|
+
export type ExtendLatLngBoundInput = ArrayOrValue<LatLngBoundOrPoint>;
|
|
82
82
|
export declare function latLngBoundFromInput(input: ExtendLatLngBoundInput): Maybe<LatLngBound>;
|
|
83
83
|
export declare function extendLatLngBound(bound: LatLngBound, extendWith: ExtendLatLngBoundInput): LatLngBound;
|
|
84
|
-
export
|
|
84
|
+
export type LatLngBoundCheckFunction = DecisionFunction<LatLngBoundOrPoint>;
|
|
85
85
|
/**
|
|
86
86
|
* Function that returns true if the input is entirely within the context's bound.
|
|
87
87
|
*/
|
|
88
|
-
export
|
|
88
|
+
export type IsWithinLatLngBoundFunction = LatLngBoundCheckFunction & {
|
|
89
89
|
readonly _bound: LatLngBound;
|
|
90
90
|
};
|
|
91
91
|
export declare function isWithinLatLngBoundFunction(bound: LatLngBound): IsWithinLatLngBoundFunction;
|
|
@@ -94,7 +94,7 @@ export declare function isLatLngPointWithinLatLngBound(point: LatLngPoint, withi
|
|
|
94
94
|
/**
|
|
95
95
|
* Function that returns true if the input overlaps the context's bound.
|
|
96
96
|
*/
|
|
97
|
-
export
|
|
97
|
+
export type OverlapsLatLngBoundFunction = LatLngBoundCheckFunction & {
|
|
98
98
|
readonly _bound: LatLngBound;
|
|
99
99
|
};
|
|
100
100
|
export declare function latLngBoundOverlapsLatLngBound(a: LatLngBound, b: LatLngBound): boolean;
|
package/src/lib/value/build.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { Configurable } from '../type';
|
|
|
2
2
|
/**
|
|
3
3
|
* Denotes a typically read-only like model is being built/configured.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type Building<T> = Partial<Configurable<T>>;
|
|
6
|
+
export type BuildFunction<T> = (base: Building<T>) => void;
|
|
7
7
|
export interface BuildConfig<T extends object> {
|
|
8
8
|
base?: Building<T>;
|
|
9
9
|
build: BuildFunction<T>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { ReadValueFunction } from './map';
|
|
1
2
|
import { Maybe } from './maybe.type';
|
|
2
3
|
/**
|
|
3
4
|
* A comparator that returns true if the two input values are considered equivalent.
|
|
4
5
|
*/
|
|
5
|
-
export
|
|
6
|
+
export type EqualityComparatorFunction<T> = (a: T, b: T) => boolean;
|
|
6
7
|
/**
|
|
7
8
|
* Wraps a EqualityComparatorFunction that handles Maybe values and only uses the comparator when the input values are not null/undefined.
|
|
8
9
|
*
|
|
@@ -19,3 +20,48 @@ export declare function safeEqualityComparatorFunction<T>(compare: EqualityCompa
|
|
|
19
20
|
* @returns
|
|
20
21
|
*/
|
|
21
22
|
export declare function safeCompareEquality<T>(a: Maybe<T>, b: Maybe<T>, compare: EqualityComparatorFunction<T>): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Function used to compare the values from the input items. Items might not be defined.
|
|
25
|
+
*
|
|
26
|
+
* - If the items are both null or both undefined, the function will return true.
|
|
27
|
+
* - If one is defined and one is undefined, it will return false.
|
|
28
|
+
* - If one is undefined and one is null the function will return false.
|
|
29
|
+
*/
|
|
30
|
+
export type CompareEqualityWithValueFromItemsFunction<I, V> = ((a: Maybe<I>, b: Maybe<I>) => boolean) & {
|
|
31
|
+
/**
|
|
32
|
+
* Used to read the values from the input, if the input is defined.
|
|
33
|
+
*
|
|
34
|
+
* @param a
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
readonly _readValues: ReadValueFunction<I, V>;
|
|
38
|
+
/**
|
|
39
|
+
* Decision function.
|
|
40
|
+
*
|
|
41
|
+
* @param a
|
|
42
|
+
* @param b
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
readonly _equalityComparator: EqualityComparatorFunction<V>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Creates a new CompareEqualityWithValueFromItemsFunction.
|
|
49
|
+
*
|
|
50
|
+
* Convenience function for calling compareEqualityWithValueFromItemsFunctionFactory() and passing the read values and values decision functions.
|
|
51
|
+
*
|
|
52
|
+
* @param readValues
|
|
53
|
+
* @param equalityComparator
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
export declare function compareEqualityWithValueFromItemsFunction<I, V>(readValues: ReadValueFunction<I, V>, equalityComparator: EqualityComparatorFunction<V>): CompareEqualityWithValueFromItemsFunction<I, V>;
|
|
57
|
+
/**
|
|
58
|
+
* Function used to compare the values from the input items. Items might not be defined.
|
|
59
|
+
*/
|
|
60
|
+
export type CompareEqualityWithValueFromItemsFunctionFactory<I, V> = ((equalityComparator: EqualityComparatorFunction<V>) => CompareEqualityWithValueFromItemsFunction<I, V>) & Pick<CompareEqualityWithValueFromItemsFunction<I, V>, '_readValues'>;
|
|
61
|
+
/**
|
|
62
|
+
* Creates a new CompareEqualityWithValueFromItemsFunctionFactory.
|
|
63
|
+
*
|
|
64
|
+
* @param readValues
|
|
65
|
+
* @returns
|
|
66
|
+
*/
|
|
67
|
+
export declare function compareEqualityWithValueFromItemsFunctionFactory<I, V>(readValues: ReadValueFunction<I, V>): CompareEqualityWithValueFromItemsFunctionFactory<I, V>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.safeCompareEquality = exports.safeEqualityComparatorFunction = void 0;
|
|
3
|
+
exports.compareEqualityWithValueFromItemsFunctionFactory = exports.compareEqualityWithValueFromItemsFunction = exports.safeCompareEquality = exports.safeEqualityComparatorFunction = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Wraps a EqualityComparatorFunction that handles Maybe values and only uses the comparator when the input values are not null/undefined.
|
|
6
6
|
*
|
|
@@ -23,4 +23,38 @@ function safeCompareEquality(a, b, compare) {
|
|
|
23
23
|
return safeEqualityComparatorFunction(compare)(a, b);
|
|
24
24
|
}
|
|
25
25
|
exports.safeCompareEquality = safeCompareEquality;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new CompareEqualityWithValueFromItemsFunction.
|
|
28
|
+
*
|
|
29
|
+
* Convenience function for calling compareEqualityWithValueFromItemsFunctionFactory() and passing the read values and values decision functions.
|
|
30
|
+
*
|
|
31
|
+
* @param readValues
|
|
32
|
+
* @param equalityComparator
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
function compareEqualityWithValueFromItemsFunction(readValues, equalityComparator) {
|
|
36
|
+
return compareEqualityWithValueFromItemsFunctionFactory(readValues)(equalityComparator);
|
|
37
|
+
}
|
|
38
|
+
exports.compareEqualityWithValueFromItemsFunction = compareEqualityWithValueFromItemsFunction;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new CompareEqualityWithValueFromItemsFunctionFactory.
|
|
41
|
+
*
|
|
42
|
+
* @param readValues
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
function compareEqualityWithValueFromItemsFunctionFactory(readValues) {
|
|
46
|
+
const fn = ((equalityComparator) => {
|
|
47
|
+
const fn = safeEqualityComparatorFunction((a, b) => {
|
|
48
|
+
const vA = readValues(a);
|
|
49
|
+
const vB = readValues(b);
|
|
50
|
+
return equalityComparator(vA, vB);
|
|
51
|
+
});
|
|
52
|
+
fn._readValues = readValues;
|
|
53
|
+
fn._equalityComparator = equalityComparator;
|
|
54
|
+
return fn;
|
|
55
|
+
});
|
|
56
|
+
fn._readValues = readValues;
|
|
57
|
+
return fn;
|
|
58
|
+
}
|
|
59
|
+
exports.compareEqualityWithValueFromItemsFunctionFactory = compareEqualityWithValueFromItemsFunctionFactory;
|
|
26
60
|
//# sourceMappingURL=comparator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparator.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/value/comparator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"comparator.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/value/comparator.ts"],"names":[],"mappings":";;;AASA;;;;;GAKG;AACH,SAAgB,8BAA8B,CAAI,OAAsC;IACtF,OAAO,CAAC,CAAW,EAAE,CAAW,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1F,CAAC;AAFD,wEAEC;AAED;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAI,CAAW,EAAE,CAAW,EAAE,OAAsC;IACrG,OAAO,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AAFD,kDAEC;AA4BD;;;;;;;;GAQG;AACH,SAAgB,yCAAyC,CAAO,UAAmC,EAAE,kBAAiD;IACpJ,OAAO,gDAAgD,CAAC,UAAU,CAAC,CAAC,kBAAkB,CAAC,CAAC;AAC1F,CAAC;AAFD,8FAEC;AAOD;;;;;GAKG;AACH,SAAgB,gDAAgD,CAAO,UAAmC;IACxG,MAAM,EAAE,GAAG,CAAC,CAAC,kBAA2C,EAAE,EAAE;QAC1D,MAAM,EAAE,GAAG,8BAA8B,CAAC,CAAC,CAAI,EAAE,CAAI,EAAE,EAAE;YACvD,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YACzB,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YACzB,OAAO,kBAAkB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACpC,CAAC,CAA8D,CAAC;QAEhE,EAAE,CAAC,WAAW,GAAG,UAAU,CAAC;QAC5B,EAAE,CAAC,mBAAmB,GAAG,kBAAkB,CAAC;QAE5C,OAAO,EAAE,CAAC;IACZ,CAAC,CAAqE,CAAC;IAEvE,EAAE,CAAC,WAAW,GAAG,UAAU,CAAC;IAC5B,OAAO,EAA4D,CAAC;AACtE,CAAC;AAhBD,4GAgBC"}
|
package/src/lib/value/cron.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { Maybe } from './maybe.type';
|
|
|
4
4
|
/**
|
|
5
5
|
* A map function that derives a boolean from the input.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
7
|
+
export type DecisionFunction<I> = MapFunction<I, boolean>;
|
|
8
|
+
export type AsyncDecisionFunction<I> = AsyncMapFunction<DecisionFunction<I>>;
|
|
9
|
+
export type DecisionFunctionFactory<C, I> = FactoryWithRequiredInput<DecisionFunction<I>, C>;
|
|
10
10
|
export declare function decisionFunction<I>(decision: boolean): DecisionFunction<I>;
|
|
11
11
|
/**
|
|
12
12
|
* Used to invert a decision function by returning the opposite of what it returns.
|
package/src/lib/value/equal.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ import { EqualityComparatorFunction } from './comparator';
|
|
|
3
3
|
/**
|
|
4
4
|
* Used to check if the input object is considered equal to the current context.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type IsEqualContext<T = unknown> = (x: T) => boolean;
|
|
7
7
|
/**
|
|
8
8
|
* Similar to IsEqualContext, but supports an array of objects.
|
|
9
9
|
*
|
|
10
10
|
* Used to check if the input object or array of objects are considered equal to the current context.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type AreEqualContext<T = unknown> = (x: IterableOrValue<T>) => boolean;
|
|
13
13
|
/**
|
|
14
14
|
* Creates an IsEqualContext
|
|
15
15
|
*
|
|
@@ -36,9 +36,3 @@ export declare function areEqualContext<T>(contextValue: T, fn: EqualityComparat
|
|
|
36
36
|
* @returns
|
|
37
37
|
*/
|
|
38
38
|
export declare function allObjectsAreEqual<T>(values: IterableOrValue<T>, fn: EqualityComparatorFunction<T>): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Function used for equivalence comparisons on an object.
|
|
41
|
-
*
|
|
42
|
-
* @deprecated use EqualityComparatorFunction instead.
|
|
43
|
-
*/
|
|
44
|
-
export declare type IsEqualFunction<T = unknown> = EqualityComparatorFunction<T>;
|