@guillaume-docquier/tools-ts 8.5.0 → 8.6.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.
- package/README.md +8 -8
- package/dist/indexBy.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,14 +106,14 @@ consistent context, scopes, formatting, and redaction.
|
|
|
106
106
|
Use these small utilities to keep common asynchronous and callback patterns
|
|
107
107
|
consistent.
|
|
108
108
|
|
|
109
|
-
| Export | What it is
|
|
110
|
-
| ----------------- |
|
|
111
|
-
| `setTimeoutAsync` | Promise-based timeout helper.
|
|
112
|
-
| `debounce` | Creates a debounced callback.
|
|
113
|
-
| `noop` | Synchronous no-op function.
|
|
114
|
-
| `asyncNoop` | Asynchronous no-op function.
|
|
115
|
-
| `omit` | Runtime equivalent of `Omit<TType, TKey>`.
|
|
116
|
-
| `indexBy` | Indexes objects by a selected string
|
|
109
|
+
| Export | What it is | Use it when |
|
|
110
|
+
| ----------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
111
|
+
| `setTimeoutAsync` | Promise-based timeout helper. | You want `await`-friendly delays that work in browser and Node environments. |
|
|
112
|
+
| `debounce` | Creates a debounced callback. | A repeated event should trigger work only after calls have settled for a delay. |
|
|
113
|
+
| `noop` | Synchronous no-op function. | You need a safe default callback that intentionally does nothing. |
|
|
114
|
+
| `asyncNoop` | Asynchronous no-op function. | You need a safe default async callback or hook that resolves immediately. |
|
|
115
|
+
| `omit` | Runtime equivalent of `Omit<TType, TKey>`. | You need to remove keys from an object. |
|
|
116
|
+
| `indexBy` | Indexes objects by a selected string or number valued property. | You need to look up objects by a key. |
|
|
117
117
|
|
|
118
118
|
### Profiling
|
|
119
119
|
|
package/dist/indexBy.d.ts
CHANGED
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
* // }
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
export declare function indexBy<TProperty extends string, TElement extends Record<TProperty, string>>(property: TProperty, arrayOfObjects: readonly TElement[]): Record<TElement[TProperty], TElement>;
|
|
14
|
+
export declare function indexBy<TProperty extends string, TElement extends Record<TProperty, string | number>>(property: TProperty, arrayOfObjects: readonly TElement[]): Record<TElement[TProperty], TElement>;
|