@oscarpalmer/atoms 0.192.0 → 0.193.1

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 (130) hide show
  1. package/dist/index.d.mts +25 -23
  2. package/dist/index.mjs +30 -31
  3. package/dist/queue.d.mts +25 -23
  4. package/dist/queue.mjs +27 -28
  5. package/package.json +3 -4
  6. package/src/array/difference.ts +0 -73
  7. package/src/array/exists.ts +0 -93
  8. package/src/array/filter.ts +0 -182
  9. package/src/array/find.ts +0 -183
  10. package/src/array/first.ts +0 -196
  11. package/src/array/flatten.ts +0 -20
  12. package/src/array/from.ts +0 -129
  13. package/src/array/get.ts +0 -131
  14. package/src/array/group-by.ts +0 -369
  15. package/src/array/index.ts +0 -26
  16. package/src/array/insert.ts +0 -52
  17. package/src/array/intersection.ts +0 -72
  18. package/src/array/last.ts +0 -194
  19. package/src/array/match.ts +0 -436
  20. package/src/array/move.ts +0 -315
  21. package/src/array/partition.ts +0 -91
  22. package/src/array/push.ts +0 -23
  23. package/src/array/reverse.ts +0 -33
  24. package/src/array/select.ts +0 -260
  25. package/src/array/single.ts +0 -93
  26. package/src/array/slice.ts +0 -335
  27. package/src/array/sort.ts +0 -607
  28. package/src/array/splice.ts +0 -106
  29. package/src/array/swap.ts +0 -322
  30. package/src/array/to-map.ts +0 -371
  31. package/src/array/to-record.ts +0 -351
  32. package/src/array/to-set.ts +0 -80
  33. package/src/array/toggle.ts +0 -79
  34. package/src/array/union.ts +0 -72
  35. package/src/array/unique.ts +0 -67
  36. package/src/array/update.ts +0 -75
  37. package/src/beacon.ts +0 -378
  38. package/src/color/constants.ts +0 -137
  39. package/src/color/index.ts +0 -83
  40. package/src/color/instance.ts +0 -162
  41. package/src/color/misc/alpha.ts +0 -56
  42. package/src/color/misc/format.ts +0 -29
  43. package/src/color/misc/get.ts +0 -210
  44. package/src/color/misc/is.ts +0 -221
  45. package/src/color/misc/state.ts +0 -243
  46. package/src/color/models.ts +0 -389
  47. package/src/color/space/hex.ts +0 -184
  48. package/src/color/space/hsl.ts +0 -174
  49. package/src/color/space/hwb.ts +0 -153
  50. package/src/color/space/rgb.ts +0 -240
  51. package/src/function/assert.ts +0 -174
  52. package/src/function/index.ts +0 -2
  53. package/src/function/limit.ts +0 -83
  54. package/src/function/memoize.ts +0 -202
  55. package/src/function/once.ts +0 -200
  56. package/src/function/retry.ts +0 -175
  57. package/src/function/work.ts +0 -1007
  58. package/src/herald.ts +0 -216
  59. package/src/index.ts +0 -68
  60. package/src/internal/array/callbacks.ts +0 -46
  61. package/src/internal/array/chunk.ts +0 -51
  62. package/src/internal/array/compact.ts +0 -56
  63. package/src/internal/array/find.ts +0 -200
  64. package/src/internal/array/group.ts +0 -42
  65. package/src/internal/array/index-of.ts +0 -182
  66. package/src/internal/array/insert.ts +0 -80
  67. package/src/internal/array/overlap.ts +0 -35
  68. package/src/internal/array/sets.ts +0 -74
  69. package/src/internal/array/shuffle.ts +0 -33
  70. package/src/internal/array/update.ts +0 -52
  71. package/src/internal/function/misc.ts +0 -8
  72. package/src/internal/function/timer.ts +0 -168
  73. package/src/internal/is.ts +0 -244
  74. package/src/internal/math/aggregate.ts +0 -164
  75. package/src/internal/math/misc.ts +0 -28
  76. package/src/internal/number.ts +0 -129
  77. package/src/internal/random.ts +0 -49
  78. package/src/internal/result.ts +0 -92
  79. package/src/internal/sized.ts +0 -25
  80. package/src/internal/string.ts +0 -128
  81. package/src/internal/subscription.ts +0 -264
  82. package/src/internal/value/compare.ts +0 -170
  83. package/src/internal/value/equal.ts +0 -465
  84. package/src/internal/value/get.ts +0 -57
  85. package/src/internal/value/handlers.ts +0 -95
  86. package/src/internal/value/has.ts +0 -118
  87. package/src/internal/value/misc.ts +0 -125
  88. package/src/internal/value/partial.ts +0 -46
  89. package/src/internal/value/set.ts +0 -132
  90. package/src/is.ts +0 -182
  91. package/src/logger.ts +0 -230
  92. package/src/math.ts +0 -281
  93. package/src/models.ts +0 -286
  94. package/src/number.ts +0 -1
  95. package/src/promise/delay.ts +0 -62
  96. package/src/promise/helpers.ts +0 -96
  97. package/src/promise/index.ts +0 -300
  98. package/src/promise/misc.ts +0 -96
  99. package/src/promise/models.ts +0 -195
  100. package/src/promise/timed.ts +0 -91
  101. package/src/query.ts +0 -147
  102. package/src/queue.ts +0 -814
  103. package/src/random.ts +0 -125
  104. package/src/result/index.ts +0 -105
  105. package/src/result/match.ts +0 -124
  106. package/src/result/misc.ts +0 -129
  107. package/src/result/models.ts +0 -83
  108. package/src/result/work/flow.ts +0 -488
  109. package/src/result/work/pipe.ts +0 -496
  110. package/src/sized/map.ts +0 -110
  111. package/src/sized/set.ts +0 -107
  112. package/src/string/case.ts +0 -236
  113. package/src/string/fuzzy.ts +0 -444
  114. package/src/string/index.ts +0 -199
  115. package/src/string/match.ts +0 -80
  116. package/src/string/normalize.ts +0 -205
  117. package/src/string/template.ts +0 -161
  118. package/src/value/clone.ts +0 -319
  119. package/src/value/collection.ts +0 -63
  120. package/src/value/diff.ts +0 -232
  121. package/src/value/freeze.ts +0 -322
  122. package/src/value/handle.ts +0 -3
  123. package/src/value/index.ts +0 -5
  124. package/src/value/merge.ts +0 -278
  125. package/src/value/omit.ts +0 -20
  126. package/src/value/pick.ts +0 -20
  127. package/src/value/shake.ts +0 -45
  128. package/src/value/smush.ts +0 -89
  129. package/src/value/transform.ts +0 -153
  130. package/src/value/unsmush.ts +0 -84
@@ -1,182 +0,0 @@
1
- import {FIND_VALUE_INDEX, findValue} from './find';
2
- import type {PlainObject} from '../../models';
3
-
4
- // #region Functions
5
-
6
- /**
7
- * Get the index of the first matching item by callback
8
- *
9
- * @param array Array to search in
10
- * @param callback Callback to get an item's value
11
- * @param value Value to match against
12
- * @returns Index of the first matching item, or `-1` if no match is found
13
- *
14
- * @example
15
- * ```typescript
16
- * indexOf(
17
- * [{id: 1}, {id: 2}, {id: 3}],
18
- * item => item.id,
19
- * 2,
20
- * ); // => 1
21
- * ```
22
- */
23
- export function indexOf<
24
- Item,
25
- Callback extends (item: Item, index: number, array: Item[]) => unknown,
26
- >(array: Item[], callback: Callback, value: ReturnType<Callback>): number;
27
-
28
- /**
29
- * Get the index of the first matching item by key
30
- *
31
- * @param array Array to search in
32
- * @param key Key to match items by
33
- * @param value Value to match against
34
- * @returns Index of the first matching item, or `-1` if no match is found
35
- *
36
- * @example
37
- * ```typescript
38
- * indexOf(
39
- * [{id: 1}, {id: 2}, {id: 3}],
40
- * 'id',
41
- * 2,
42
- * ); // => 1
43
- * ```
44
- */
45
- export function indexOf<Item extends PlainObject, ItemKey extends keyof Item>(
46
- array: Item[],
47
- key: ItemKey,
48
- value: Item[ItemKey],
49
- ): number;
50
-
51
- /**
52
- * Get the index of the first item matching the filter
53
- *
54
- * @param array Array to search in
55
- * @param filter Filter callback to match items
56
- * @returns Index of the first matching item, or `-1` if no match is found
57
- *
58
- * @example
59
- * ```typescript
60
- * indexOf(
61
- * [{id: 1}, {id: 2}, {id: 3}],
62
- * item => item.id === 2,
63
- * ); // => 1
64
- * ```
65
- */
66
- export function indexOf<Item>(
67
- array: Item[],
68
- filter: (item: Item, index: number, array: Item[]) => boolean,
69
- ): number;
70
-
71
- /**
72
- * Get the index of the first item matching the given item
73
- *
74
- * @param array Array to search in
75
- * @param item Item to match against
76
- * @returns Index of the first matching item, or `-1` if no match is found
77
- *
78
- * @example
79
- * ```typescript
80
- * indexOf([1, 2, 3, 4, 5], 3); // => 2
81
- * ```
82
- */
83
- export function indexOf<Item>(array: Item[], item: Item): number;
84
-
85
- export function indexOf(array: unknown[], ...parameters: unknown[]): number {
86
- return findValue(FIND_VALUE_INDEX, array, parameters, false);
87
- }
88
-
89
- indexOf.last = lastIndexOf;
90
-
91
- /**
92
- * Get the index of the last matching item by callback
93
- *
94
- * _Available as `lastIndexOf` and `indexOf.last`_
95
- *
96
- * @param array Array to search in
97
- * @param callback Callback to get an item's value
98
- * @param value Value to match against
99
- * @returns Index of the last matching item, or `-1` if no match is found
100
- *
101
- * @example
102
- * ```typescript
103
- * lastIndexOf(
104
- * [{id: 1}, {id: 2}, {id: 3}, {id: 2}],
105
- * item => item.id,
106
- * 2,
107
- * ); // => 3
108
- * ```
109
- */
110
- export function lastIndexOf<
111
- Item,
112
- Callback extends (item: Item, index: number, array: Item[]) => unknown,
113
- >(array: Item[], callback: Callback, value: ReturnType<Callback>): number;
114
-
115
- /**
116
- * Get the index of the last matching item by key
117
- *
118
- * _Available as `lastIndexOf` and `indexOf.last`_
119
- *
120
- * @param array Array to search in
121
- * @param key Key to match items by
122
- * @param value Value to match against
123
- * @returns Index of the last matching item, or `-1` if no match is found
124
- *
125
- * @example
126
- * ```typescript
127
- * lastIndexOf(
128
- * [{id: 1}, {id: 2}, {id: 3}, {id: 2}],
129
- * 'id',
130
- * 2,
131
- * ); // => 3
132
- * ```
133
- */
134
- export function lastIndexOf<Item extends PlainObject, ItemKey extends keyof Item>(
135
- array: Item[],
136
- key: ItemKey,
137
- value: Item[ItemKey],
138
- ): number;
139
-
140
- /**
141
- * Get the index of the last item matching the filter
142
- *
143
- * _Available as `lastIndexOf` and `indexOf.last`_
144
- *
145
- * @param array Array to search in
146
- * @param filter Filter callback to match items
147
- * @returns Index of the last matching item, or `-1` if no match is found
148
- *
149
- * @example
150
- * ```typescript
151
- * lastIndexOf(
152
- * [{id: 1}, {id: 2}, {id: 3}, {id: 2}],
153
- * item => item.id === 2,
154
- * ); // => 3
155
- * ```
156
- */
157
- export function lastIndexOf<Item>(
158
- array: Item[],
159
- filter: (item: Item, index: number, array: Item[]) => boolean,
160
- ): number;
161
-
162
- /**
163
- * Get the index of the last item matching the given item
164
- *
165
- * _Available as `lastIndexOf` and `indexOf.last`_
166
- *
167
- * @param array Array to search in
168
- * @param item Item to match against
169
- * @returns Index of the last matching item, or `-1` if no match is found
170
- *
171
- * @example
172
- * ```typescript
173
- * lastIndexOf([1, 2, 3, 2, 1], 2); // => 3
174
- * ```
175
- */
176
- export function lastIndexOf<Item>(array: Item[], item: Item): number;
177
-
178
- export function lastIndexOf(array: unknown[], ...parameters: unknown[]): number {
179
- return findValue(FIND_VALUE_INDEX, array, parameters, true);
180
- }
181
-
182
- // #endregion
@@ -1,80 +0,0 @@
1
- import {chunk} from './chunk';
2
-
3
- // #region Types
4
-
5
- type InsertType = 'insert' | 'push' | 'splice';
6
-
7
- // #endregion
8
-
9
- // #region Functions
10
-
11
- function insertChunkedValues(
12
- type: InsertType,
13
- array: unknown[],
14
- items: unknown[],
15
- start: number,
16
- deleteCount: number,
17
- ): unknown {
18
- const actualDeleteCount = deleteCount < 0 ? 0 : deleteCount;
19
- const actualStart = Math.min(Math.max(0, start), array.length);
20
- const chunked = chunk(items);
21
- const lastIndex = chunked.length - 1;
22
-
23
- let index = chunked.length;
24
- let returned: unknown[] | undefined;
25
-
26
- while (index > 0) {
27
- index -= 1;
28
-
29
- const spliced = array.splice(
30
- actualStart,
31
- index === lastIndex ? actualDeleteCount : 0,
32
- ...chunked[index],
33
- );
34
-
35
- if (returned == null) {
36
- returned = spliced;
37
- } else {
38
- returned.push(...spliced);
39
- }
40
- }
41
-
42
- if (type === INSERT_TYPE_INSERT) {
43
- return array;
44
- }
45
-
46
- return type === INSERT_TYPE_SPLICE ? returned : array.length;
47
- }
48
-
49
- export function insertValues(
50
- type: InsertType,
51
- array: unknown,
52
- items: unknown,
53
- start: unknown,
54
- deleteCount: number,
55
- ): unknown {
56
- const spliceArray = type === INSERT_TYPE_INSERT || type === INSERT_TYPE_SPLICE;
57
-
58
- if (
59
- !Array.isArray(array) ||
60
- typeof start !== 'number' ||
61
- !Array.isArray(items) ||
62
- items.length === 0
63
- ) {
64
- return spliceArray ? [] : 0;
65
- }
66
-
67
- return insertChunkedValues(type, array, items, start, spliceArray ? deleteCount : 0);
68
- }
69
-
70
- // #endregion
71
-
72
- // #region Variables
73
-
74
- export const INSERT_TYPE_INSERT: InsertType = 'insert';
75
-
76
- export const INSERT_TYPE_PUSH: InsertType = 'push';
77
-
78
- export const INSERT_TYPE_SPLICE: InsertType = 'splice';
79
-
80
- // #endregion
@@ -1,35 +0,0 @@
1
- type OverlapItem = {
2
- array: unknown[];
3
- index: number;
4
- };
5
-
6
- type OverlapResult = {
7
- first: OverlapItem;
8
- second: OverlapItem;
9
- overlap: boolean;
10
- };
11
-
12
- export function arraysOverlap(first: OverlapItem, second: OverlapItem): OverlapResult {
13
- const firstArray = first.index < second.index ? first.array : second.array;
14
- const secondArray = first.index < second.index ? second.array : first.array;
15
-
16
- const firstIndex = firstArray === first.array ? first.index : second.index;
17
- const secondIndex = firstArray === first.array ? second.index : first.index;
18
-
19
- const firstEnd = firstIndex + firstArray.length - 1;
20
- const secondEnd = secondIndex + secondArray.length - 1;
21
-
22
- const overlap = firstIndex <= secondEnd && firstEnd >= secondIndex;
23
-
24
- return {
25
- overlap,
26
- first: {
27
- array: firstArray,
28
- index: firstIndex,
29
- },
30
- second: {
31
- array: secondArray,
32
- index: secondIndex,
33
- },
34
- };
35
- }
@@ -1,74 +0,0 @@
1
- import {getArrayCallback} from './callbacks';
2
-
3
- // #region Types
4
-
5
- type CompareSetsType = 'difference' | 'intersection' | 'union';
6
-
7
- // #endregion
8
-
9
- // #region Functions
10
-
11
- export function compareSets(
12
- type: CompareSetsType,
13
- first: unknown[],
14
- second: unknown[],
15
- key?: unknown,
16
- ): unknown[] {
17
- if (!Array.isArray(first)) {
18
- return [];
19
- }
20
-
21
- const isDifference = type === COMPARE_SETS_DIFFERENCE;
22
- const isIntersection = type === COMPARE_SETS_INTERSECTION;
23
- const isUnion = type === COMPARE_SETS_UNION;
24
-
25
- if (first.length === 0) {
26
- return isDifference ? first.slice() : isIntersection ? [] : second.slice();
27
- }
28
-
29
- if (!Array.isArray(second) || second.length === 0) {
30
- return isIntersection ? [] : first.slice();
31
- }
32
-
33
- const callback = getArrayCallback(key);
34
-
35
- const values = isUnion ? first : second;
36
- let {length} = values;
37
-
38
- const set = new Set<unknown>([]);
39
-
40
- for (let index = 0; index < length; index += 1) {
41
- const item = values[index];
42
-
43
- set.add(callback?.(item, index, values) ?? item);
44
- }
45
-
46
- const source = isUnion ? second : first;
47
-
48
- length = source.length;
49
-
50
- const result: unknown[] = isUnion ? first.slice() : [];
51
-
52
- for (let index = 0; index < length; index += 1) {
53
- const item = source[index];
54
- const value = callback?.(item, index, source) ?? item;
55
-
56
- if (isIntersection ? set.has(value) : !set.has(value)) {
57
- result.push(item);
58
- }
59
- }
60
-
61
- return result;
62
- }
63
-
64
- // #endregion
65
-
66
- // #region Variables
67
-
68
- export const COMPARE_SETS_DIFFERENCE: CompareSetsType = 'difference';
69
-
70
- export const COMPARE_SETS_INTERSECTION: CompareSetsType = 'intersection';
71
-
72
- export const COMPARE_SETS_UNION: CompareSetsType = 'union';
73
-
74
- // #endregion
@@ -1,33 +0,0 @@
1
- import {getRandomInteger} from '../random';
2
-
3
- // #region Functions
4
-
5
- /**
6
- * Shuffle items in array
7
- *
8
- * @param array Original array
9
- * @returns Shuffled array
10
- */
11
- export function shuffle<Item>(array: Item[]): Item[] {
12
- if (!Array.isArray(array)) {
13
- return [];
14
- }
15
-
16
- const shuffled = array.slice();
17
-
18
- if (shuffled.length < 2) {
19
- return shuffled;
20
- }
21
-
22
- let index = shuffled.length;
23
-
24
- while (--index >= 0) {
25
- const random = getRandomInteger(0, index);
26
-
27
- [shuffled[index], shuffled[random]] = [shuffled[random], shuffled[index]];
28
- }
29
-
30
- return shuffled;
31
- }
32
-
33
- // #endregion
@@ -1,52 +0,0 @@
1
- import {getArrayCallback} from './callbacks';
2
-
3
- export function updateInArray(
4
- array: unknown[],
5
- items: unknown[],
6
- key: unknown,
7
- replace: boolean,
8
- ): unknown[] {
9
- if (!Array.isArray(array)) {
10
- return [];
11
- }
12
-
13
- const itemsIsArray = Array.isArray(items);
14
-
15
- if (array.length === 0 || !itemsIsArray) {
16
- if (itemsIsArray) {
17
- array.push(...items);
18
- }
19
-
20
- return array;
21
- }
22
-
23
- const {length} = items;
24
-
25
- if (length === 0) {
26
- return array;
27
- }
28
-
29
- const callback = getArrayCallback(key);
30
-
31
- for (let valuesIndex = 0; valuesIndex < length; valuesIndex += 1) {
32
- const item = items[valuesIndex];
33
- const value = callback?.(item) ?? item;
34
-
35
- const arrayIndex =
36
- callback == null
37
- ? array.indexOf(value)
38
- : array.findIndex(
39
- (arrayItem, arrayIndex) => callback(arrayItem, arrayIndex, array) === value,
40
- );
41
-
42
- if (arrayIndex === -1) {
43
- array.push(item);
44
- } else if (replace) {
45
- array[arrayIndex] = item;
46
- } else {
47
- array.splice(arrayIndex, 1);
48
- }
49
- }
50
-
51
- return array;
52
- }
@@ -1,8 +0,0 @@
1
- // #region Functions
2
-
3
- /**
4
- * A function that does nothing, which can be useful, I guess…
5
- */
6
- export function noop(): void {}
7
-
8
- // #endregion
@@ -1,168 +0,0 @@
1
- import type {
2
- AsyncCancelableCallback,
3
- CancelableCallback,
4
- GenericAsyncCallback,
5
- GenericCallback,
6
- } from '../../models';
7
-
8
- // #region Types
9
-
10
- type AsyncItem = {
11
- parameters: unknown[];
12
- promise: Promise<unknown>;
13
- reject: (reason?: unknown) => void;
14
- resolve: (value?: unknown) => void;
15
- running: boolean;
16
- };
17
-
18
- type TimerType = 'debounce' | 'throttle' | 'wait';
19
-
20
- // #endregion
21
-
22
- // #region Functions
23
-
24
- export function getAsyncTimer<Callback extends GenericAsyncCallback | GenericCallback>(
25
- type: TimerType,
26
- callback: Callback,
27
- time?: number,
28
- ): AsyncCancelableCallback<Callback> {
29
- async function run(item: AsyncItem): Promise<void> {
30
- const now = performance.now();
31
-
32
- start ??= now;
33
-
34
- if (interval === 0 || now - start >= interval - OFFSET) {
35
- start = throttle ? now : undefined;
36
-
37
- item.running = true;
38
-
39
- try {
40
- let result = callback(...item.parameters);
41
-
42
- if (result instanceof Promise) {
43
- result = await result;
44
- }
45
-
46
- item.resolve(result);
47
- } catch (error) {
48
- item.reject(error);
49
- } finally {
50
- item.running = false;
51
- }
52
- } else {
53
- id = startTimer(() => run(item));
54
- }
55
- }
56
-
57
- const interval = getInterval(time);
58
- const throttle = type === TIMER_THROTTLE;
59
-
60
- let id: number;
61
- let last: AsyncItem;
62
- let start: number | undefined;
63
-
64
- const timer = (...parameters: Parameters<Callback>): Promise<unknown> => {
65
- timer.cancel();
66
-
67
- const next: AsyncItem = {
68
- parameters,
69
- running: false,
70
- } as never;
71
-
72
- next.promise = new Promise<unknown>((resolve, reject) => {
73
- next.reject = reject;
74
- next.resolve = resolve;
75
- });
76
-
77
- last = next;
78
-
79
- if (throttle) {
80
- void run(next);
81
- } else {
82
- id = startTimer(() => {
83
- void run(next);
84
- });
85
- }
86
-
87
- return next.promise;
88
- };
89
-
90
- timer.cancel = (): void => {
91
- clearTimer(id);
92
-
93
- if (last != null && !last.running) {
94
- last.reject();
95
- }
96
- };
97
-
98
- return timer as AsyncCancelableCallback<Callback>;
99
- }
100
-
101
- function getInterval(value: unknown): number {
102
- return typeof value === 'number' && value > 0 ? value : 0;
103
- }
104
-
105
- export function getTimer<Callback extends GenericCallback>(
106
- type: TimerType,
107
- callback: Callback,
108
- time?: number,
109
- ): CancelableCallback<Callback> {
110
- function run(): void {
111
- const now = performance.now();
112
-
113
- start ??= now;
114
-
115
- if (interval === 0 || now - start >= interval - OFFSET) {
116
- start = throttle ? now : undefined;
117
-
118
- callback(...args);
119
- } else {
120
- id = startTimer(run);
121
- }
122
- }
123
-
124
- const interval = getInterval(time);
125
- const throttle = type === TIMER_THROTTLE;
126
-
127
- let args: Parameters<Callback>;
128
- let id: number;
129
- let start: number | undefined;
130
-
131
- const timer = (...parameters: Parameters<Callback>): void => {
132
- timer.cancel();
133
-
134
- args = parameters;
135
-
136
- if (throttle) {
137
- run();
138
- } else {
139
- id = startTimer(run);
140
- }
141
- };
142
-
143
- timer.cancel = (): void => {
144
- clearTimer(id);
145
- };
146
-
147
- return timer as CancelableCallback<Callback>;
148
- }
149
-
150
- // #endregion
151
-
152
- // #region Variables
153
-
154
- const OFFSET = 5;
155
-
156
- export const TIMER_DEBOUNCE: TimerType = 'debounce';
157
-
158
- export const TIMER_THROTTLE: TimerType = 'throttle';
159
-
160
- export const TIMER_WAIT: TimerType = 'wait';
161
-
162
- // istanbul ignore next
163
- const clearTimer = typeof cancelAnimationFrame === 'function' ? cancelAnimationFrame : clearTimeout;
164
-
165
- // istanbul ignore next
166
- const startTimer = typeof requestAnimationFrame === 'function' ? requestAnimationFrame : setTimeout;
167
-
168
- // #endregion