@dereekb/util 9.25.15 → 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.
Files changed (176) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/fetch/CHANGELOG.md +12 -0
  3. package/fetch/package.json +2 -14
  4. package/fetch/src/lib/fetch.d.ts +5 -5
  5. package/fetch/src/lib/fetch.type.d.ts +3 -3
  6. package/fetch/src/lib/json.d.ts +8 -8
  7. package/fetch/src/lib/timeout.js +3 -2
  8. package/fetch/src/lib/timeout.js.map +1 -1
  9. package/fetch/src/lib/url.d.ts +10 -10
  10. package/package.json +5 -8
  11. package/src/lib/array/array.boolean.d.ts +3 -3
  12. package/src/lib/array/array.d.ts +25 -6
  13. package/src/lib/array/array.factory.d.ts +4 -4
  14. package/src/lib/array/array.filter.d.ts +1 -1
  15. package/src/lib/array/array.find.d.ts +2 -2
  16. package/src/lib/array/array.index.d.ts +3 -3
  17. package/src/lib/array/array.indexed.d.ts +6 -6
  18. package/src/lib/array/array.js +31 -11
  19. package/src/lib/array/array.js.map +1 -1
  20. package/src/lib/array/array.make.d.ts +1 -1
  21. package/src/lib/array/array.number.d.ts +2 -2
  22. package/src/lib/array/array.random.d.ts +1 -1
  23. package/src/lib/array/array.string.d.ts +8 -5
  24. package/src/lib/array/array.string.js +6 -6
  25. package/src/lib/array/array.string.js.map +1 -1
  26. package/src/lib/array/array.unique.d.ts +3 -11
  27. package/src/lib/array/array.unique.js +1 -10
  28. package/src/lib/array/array.unique.js.map +1 -1
  29. package/src/lib/assertion/assertion.d.ts +2 -2
  30. package/src/lib/auth/auth.role.claims.d.ts +12 -12
  31. package/src/lib/auth/auth.role.d.ts +2 -2
  32. package/src/lib/boolean.d.ts +2 -2
  33. package/src/lib/contact/domain.d.ts +1 -1
  34. package/src/lib/contact/email.d.ts +3 -3
  35. package/src/lib/contact/phone.d.ts +5 -5
  36. package/src/lib/contact/random.d.ts +2 -2
  37. package/src/lib/date/date.d.ts +22 -22
  38. package/src/lib/date/date.time.d.ts +4 -4
  39. package/src/lib/date/date.time.js +1 -1
  40. package/src/lib/date/date.time.js.map +1 -1
  41. package/src/lib/date/hour.d.ts +1 -1
  42. package/src/lib/date/week.d.ts +10 -10
  43. package/src/lib/date/week.js +1 -1
  44. package/src/lib/date/week.js.map +1 -1
  45. package/src/lib/error/error.d.ts +5 -5
  46. package/src/lib/error/error.server.d.ts +1 -1
  47. package/src/lib/file/xml.d.ts +1 -1
  48. package/src/lib/filter/filter.d.ts +2 -2
  49. package/src/lib/function/function.boolean.d.ts +1 -1
  50. package/src/lib/function/function.forward.d.ts +2 -2
  51. package/src/lib/getter/getter.cache.d.ts +2 -2
  52. package/src/lib/getter/getter.d.ts +13 -13
  53. package/src/lib/getter/getter.map.d.ts +1 -1
  54. package/src/lib/getter/getter.util.d.ts +1 -1
  55. package/src/lib/getter/type.d.ts +1 -1
  56. package/src/lib/grouping.d.ts +4 -2
  57. package/src/lib/grouping.js +9 -6
  58. package/src/lib/grouping.js.map +1 -1
  59. package/src/lib/hash.d.ts +2 -2
  60. package/src/lib/iterable/iterable.d.ts +1 -1
  61. package/src/lib/iterate.d.ts +2 -2
  62. package/src/lib/key.d.ts +6 -6
  63. package/src/lib/key.js +1 -1
  64. package/src/lib/key.js.map +1 -1
  65. package/src/lib/lifecycle.d.ts +1 -1
  66. package/src/lib/map/map.intersection.js +1 -1
  67. package/src/lib/map/map.intersection.js.map +1 -1
  68. package/src/lib/map/map.key.d.ts +2 -2
  69. package/src/lib/model/id.batch.d.ts +3 -9
  70. package/src/lib/model/id.batch.js +2 -2
  71. package/src/lib/model/id.batch.js.map +1 -1
  72. package/src/lib/model/model.conversion.d.ts +32 -32
  73. package/src/lib/model/model.copy.d.ts +3 -3
  74. package/src/lib/model/model.d.ts +11 -11
  75. package/src/lib/model/model.modify.d.ts +4 -4
  76. package/src/lib/nodejs/stream.d.ts +1 -1
  77. package/src/lib/number/bitwise.dencoder.d.ts +10 -10
  78. package/src/lib/number/bitwise.dencoder.js +1 -1
  79. package/src/lib/number/bitwise.dencoder.js.map +1 -1
  80. package/src/lib/number/bound.d.ts +3 -3
  81. package/src/lib/number/dollar.d.ts +4 -4
  82. package/src/lib/number/factory.d.ts +1 -1
  83. package/src/lib/number/number.d.ts +5 -5
  84. package/src/lib/number/pay.d.ts +2 -2
  85. package/src/lib/number/random.d.ts +2 -2
  86. package/src/lib/number/round.d.ts +11 -11
  87. package/src/lib/number/sort.d.ts +1 -1
  88. package/src/lib/number/transform.d.ts +2 -2
  89. package/src/lib/object/object.array.delta.d.ts +4 -4
  90. package/src/lib/object/object.d.ts +2 -2
  91. package/src/lib/object/object.equal.d.ts +1 -1
  92. package/src/lib/object/object.filter.pojo.d.ts +16 -16
  93. package/src/lib/object/object.filter.tuple.d.ts +5 -5
  94. package/src/lib/object/object.filter.tuple.js +1 -1
  95. package/src/lib/object/object.filter.tuple.js.map +1 -1
  96. package/src/lib/object/object.map.d.ts +5 -5
  97. package/src/lib/page/page.d.ts +1 -1
  98. package/src/lib/path/path.d.ts +13 -13
  99. package/src/lib/path/path.js +1 -1
  100. package/src/lib/path/path.js.map +1 -1
  101. package/src/lib/promise/callback.d.ts +2 -2
  102. package/src/lib/promise/index.d.ts +1 -0
  103. package/src/lib/promise/index.js +1 -0
  104. package/src/lib/promise/index.js.map +1 -1
  105. package/src/lib/promise/map.d.ts +1 -1
  106. package/src/lib/promise/promise.d.ts +82 -37
  107. package/src/lib/promise/promise.js +173 -106
  108. package/src/lib/promise/promise.js.map +1 -1
  109. package/src/lib/promise/promise.loop.d.ts +2 -2
  110. package/src/lib/promise/promise.ref.d.ts +2 -2
  111. package/src/lib/promise/promise.type.d.ts +11 -0
  112. package/src/lib/promise/promise.type.js +14 -0
  113. package/src/lib/promise/promise.type.js.map +1 -0
  114. package/src/lib/promise/use.d.ts +1 -1
  115. package/src/lib/relation/relation.d.ts +8 -8
  116. package/src/lib/relation/relation.js +1 -1
  117. package/src/lib/relation/relation.js.map +1 -1
  118. package/src/lib/service/handler.config.d.ts +6 -6
  119. package/src/lib/service/handler.d.ts +7 -7
  120. package/src/lib/set/set.d.ts +6 -18
  121. package/src/lib/set/set.decision.d.ts +1 -1
  122. package/src/lib/set/set.delta.d.ts +2 -2
  123. package/src/lib/set/set.delta.js +1 -1
  124. package/src/lib/set/set.delta.js.map +1 -1
  125. package/src/lib/set/set.js +5 -18
  126. package/src/lib/set/set.js.map +1 -1
  127. package/src/lib/set/set.mode.d.ts +1 -1
  128. package/src/lib/set/set.selection.d.ts +1 -1
  129. package/src/lib/sort.d.ts +9 -9
  130. package/src/lib/sort.js.map +1 -1
  131. package/src/lib/storage/storage.d.ts +2 -2
  132. package/src/lib/string/char.d.ts +1 -1
  133. package/src/lib/string/dencoder.d.ts +7 -7
  134. package/src/lib/string/html.d.ts +2 -2
  135. package/src/lib/string/password.d.ts +1 -1
  136. package/src/lib/string/replace.d.ts +5 -5
  137. package/src/lib/string/search.d.ts +3 -3
  138. package/src/lib/string/sort.d.ts +1 -1
  139. package/src/lib/string/string.d.ts +4 -4
  140. package/src/lib/string/transform.d.ts +4 -4
  141. package/src/lib/string/url.d.ts +14 -14
  142. package/src/lib/string/url.js.map +1 -1
  143. package/src/lib/tree/tree.array.d.ts +1 -1
  144. package/src/lib/tree/tree.d.ts +1 -1
  145. package/src/lib/tree/tree.expand.d.ts +1 -1
  146. package/src/lib/tree/tree.flatten.d.ts +1 -1
  147. package/src/lib/type.d.ts +51 -51
  148. package/src/lib/value/address.d.ts +7 -7
  149. package/src/lib/value/bound.d.ts +13 -13
  150. package/src/lib/value/build.d.ts +2 -2
  151. package/src/lib/value/comparator.d.ts +47 -1
  152. package/src/lib/value/comparator.js +35 -1
  153. package/src/lib/value/comparator.js.map +1 -1
  154. package/src/lib/value/cron.d.ts +1 -1
  155. package/src/lib/value/decision.d.ts +3 -3
  156. package/src/lib/value/equal.d.ts +2 -8
  157. package/src/lib/value/indexed.d.ts +21 -21
  158. package/src/lib/value/indexed.js.map +1 -1
  159. package/src/lib/value/map.d.ts +15 -9
  160. package/src/lib/value/map.js.map +1 -1
  161. package/src/lib/value/maybe.type.d.ts +4 -4
  162. package/src/lib/value/modifier.d.ts +3 -3
  163. package/src/lib/value/pixel.d.ts +2 -2
  164. package/src/lib/value/point.d.ts +22 -26
  165. package/src/lib/value/sync.d.ts +2 -2
  166. package/src/lib/value/sync.js +1 -1
  167. package/src/lib/value/sync.js.map +1 -1
  168. package/src/lib/value/use.d.ts +8 -8
  169. package/src/lib/value/vector.d.ts +5 -5
  170. package/src/lib/value/zoom.d.ts +1 -1
  171. package/test/CHANGELOG.md +12 -0
  172. package/test/package.json +2 -14
  173. package/test/src/lib/jest.d.ts +5 -5
  174. package/test/src/lib/jest.fail.d.ts +5 -5
  175. package/test/src/lib/jest.function.d.ts +7 -7
  176. 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 declare type PrimativeValue = boolean | string | number;
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 declare type ClassType<T = unknown> = {
10
+ export type ClassType<T = unknown> = {
11
11
  new (...args: unknown[]): T;
12
12
  };
13
- export declare type ObjectWithConstructor = {
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 declare type FunctionType = 'function' | 'class' | 'arrow';
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 declare type ClassLikeType<T = unknown> = abstract new (...args: unknown[]) => T;
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 declare type KeyValueTransformMap<T, V, X extends keyof T = keyof T> = {
52
+ export type KeyValueTransformMap<T, V, X extends keyof T = keyof T> = {
53
53
  [K in X]: V;
54
54
  };
55
- export declare type StringKeyValueTransformMap<T, V> = {
55
+ export type StringKeyValueTransformMap<T, V> = {
56
56
  [K in keyof T as string]: V;
57
57
  };
58
- export declare type KeysAsStrings<T> = {
58
+ export type KeysAsStrings<T> = {
59
59
  [K in keyof T as string]: T[K];
60
60
  };
61
- export declare type ValuesTypesAsArray<T> = T[keyof T][];
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 declare type KeyAsString<K> = `${KeyCanBeString<K>}`;
66
- export declare type KeyCanBeString<K> = K extends number | boolean | string | null | undefined ? K : never;
67
- export declare type BooleanKeyValueTransformMap<T> = KeyValueTransformMap<T, boolean>;
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 declare type MergeReplace<T, R> = Merge<T, R>;
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 declare type Replace<T, R> = StrictOmit<MergeReplace<T, R>, Exclude<keyof R, keyof T>>;
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 declare type ReplaceType<I extends object, O extends object, X = unknown> = {
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 declare type OnlyStringKeys<T> = PickProperties<T, 'string'>;
83
- export declare type RemoveIndex<T> = {
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 declare type KnownKeys<T> = keyof RemoveIndex<T>;
91
+ export type KnownKeys<T> = keyof RemoveIndex<T>;
92
92
  /**
93
93
  * Makes the input key(s) required.
94
94
  */
95
- export declare type RequiredOnKeys<T, K> = K extends keyof T ? Omit<T, K> & Required<Pick<T, K>> : T;
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 declare type PartialOnKeys<T, K> = K extends keyof T ? Omit<T, K> & Partial<Pick<T, K>> : T;
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 declare type StringKeyProperties<T> = NonNever<{
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 declare type StringKeyPropertyKeys<T> = keyof StringKeyProperties<T>;
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 declare type Configurable<T> = Writable<T>;
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 declare type CommaSeparatedKeyOrderOfObject<T extends object> = CommaSeparatedKeyOrder<`${KeyCanBeString<keyof T>}`>;
120
- export declare type CommaSeparatedKeyOrder<T extends string> = StringOrder<T, ','>;
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 declare type CommaSeparatedKeyCombinationsOfObject<T extends object> = CommaSeparatedKeyCombinations<`${KeyCanBeString<keyof T>}`>;
125
- export declare type CommaSeparatedKeyCombinations<T extends string> = StringCombination<T, ','>;
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 declare type CommaSeparatedKeysOfObject<T extends object> = CommaSeparatedKeys<`${KeyCanBeString<keyof T>}`>;
130
- export declare type CommaSeparatedKeys<T extends string> = StringConcatenationApproximation<T, ','>;
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 declare type AllCommaSeparatedKeysOfObject<T extends object> = AllCommaSeparatedKeys<`${KeyCanBeString<keyof T>}`>;
137
- export declare type AllCommaSeparatedKeys<T extends string> = StringConcatenation<T, ','>;
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 declare type OrderedCommaSeparatedKeysOfObject<T extends object> = OrderedCommaSeparatedKeys<`${KeyCanBeString<keyof T>}`>;
144
- export declare type OrderedCommaSeparatedKeys<T extends string> = StringConcatenationOrder<T, ','>;
145
- export declare type UnionToOvlds<U> = UnionToIntersection<U extends any ? (f: U) => void : never>;
146
- export declare type PopUnion<U> = UnionToOvlds<U> extends (a: infer A) => void ? A : never;
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 declare 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
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 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;
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 declare 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;
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 declare type StringConcatenation<S extends string, SEPARATOR extends string> = StringConcatenationMany<S, SEPARATOR>;
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 declare 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;
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 declare 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 declare type StringConcatinateTwo<LEFT extends string, SELF extends string, SEPARATOR extends string> = `${LEFT}${SEPARATOR}${SELF}` | `${SELF}${SEPARATOR}${LEFT}`;
197
- export declare 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 declare 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 declare 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 declare 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 declare 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 declare type IsSingleCharacter<S extends string> = PopUnion<S> extends infer SELF ? (Exclude<S, SELF> extends never ? S : never) : never;
203
- export declare 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 declare 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 declare 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;
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 declare type CityString = string;
5
+ export type CityString = string;
6
6
  /**
7
7
  * Full state name
8
8
  */
9
- export declare type StateString = string;
9
+ export type StateString = string;
10
10
  /**
11
11
  * State code
12
12
  */
13
- export declare type StateCodeString = string;
13
+ export type StateCodeString = string;
14
14
  /**
15
15
  * Full country name
16
16
  */
17
- export declare type CountryString = string;
17
+ export type CountryString = string;
18
18
  /**
19
19
  * Country code
20
20
  */
21
- export declare type CountryCodeString = string;
22
- export declare type AddressLineString = string;
23
- export declare type ZipCodeString = string;
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
  */
@@ -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 declare type LatLngBoundSouthWestPoint = LatLngPoint;
7
- export declare type LatLngBoundNothEastPoint = LatLngPoint;
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 declare type LatLngBoundOrPoint = LatLngBound | LatLngPoint;
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 declare type LatLngBoundTuple = [LatLngBoundSouthWestPoint | LatLngPointInput, LatLngBoundNothEastPoint | LatLngPointInput];
50
- export declare type LatLngBoundTuplePoints = [LatLngPointInput, LatLngPointInput, LatLngPointInput, LatLngPointInput];
51
- export declare type LatLngBoundInput = LatLngBound | LatLngBoundTuple | LatLngBoundTuplePoints;
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 declare type LatLngBoundTupleFunction = ((input: LatLngBoundSouthWestPoint | LatLngBoundInput, inputNe?: LatLngBoundNothEastPoint) => LatLngBoundTuple) & ((sw: LatLngBoundSouthWestPoint, ne: LatLngBoundNothEastPoint) => LatLngBoundTuple) & ((bound: LatLngBoundInput) => LatLngBoundTuple);
57
- export declare type LatLngBoundTupleFunctionConfig = LatLngBoundFunctionConfig;
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 declare type LatLngBoundFunction = ((input: LatLngBoundSouthWestPoint | LatLngBoundInput, inputNe?: LatLngBoundNothEastPoint) => LatLngBound) & ((sw: LatLngBoundSouthWestPoint, ne: LatLngBoundNothEastPoint) => LatLngBound) & ((bound: LatLngBoundInput) => LatLngBound);
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 declare type ExtendLatLngBoundInput = ArrayOrValue<LatLngBoundOrPoint>;
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 declare type LatLngBoundCheckFunction = DecisionFunction<LatLngBoundOrPoint>;
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 declare type IsWithinLatLngBoundFunction = LatLngBoundCheckFunction & {
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 declare type OverlapsLatLngBoundFunction = LatLngBoundCheckFunction & {
97
+ export type OverlapsLatLngBoundFunction = LatLngBoundCheckFunction & {
98
98
  readonly _bound: LatLngBound;
99
99
  };
100
100
  export declare function latLngBoundOverlapsLatLngBound(a: LatLngBound, b: LatLngBound): boolean;
@@ -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 declare type Building<T> = Partial<Configurable<T>>;
6
- export declare type BuildFunction<T> = (base: Building<T>) => void;
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 declare type EqualityComparatorFunction<T> = (a: T, b: T) => boolean;
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":";;;AAOA;;;;;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"}
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"}
@@ -2,7 +2,7 @@ import { Minutes } from '../date/date';
2
2
  /**
3
3
  * A cron schedule expression string
4
4
  */
5
- export declare type CronExpression = string;
5
+ export type CronExpression = string;
6
6
  /**
7
7
  * Creates a CronExpression for the input number of minutes.
8
8
  *
@@ -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 declare type DecisionFunction<I> = MapFunction<I, boolean>;
8
- export declare type AsyncDecisionFunction<I> = AsyncMapFunction<DecisionFunction<I>>;
9
- export declare type DecisionFunctionFactory<C, I> = FactoryWithRequiredInput<DecisionFunction<I>, C>;
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.
@@ -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 declare type IsEqualContext<T = unknown> = (x: T) => boolean;
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 declare type AreEqualContext<T = unknown> = (x: IterableOrValue<T>) => boolean;
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>;