@naturalcycles/js-lib 15.15.2 → 15.16.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/dist/array/range.d.ts +1 -2
- package/dist/bot.model.d.ts +12 -0
- package/dist/bot.model.js +15 -0
- package/dist/browser/adminService.d.ts +1 -1
- package/dist/{bot.d.ts → browser/bot.d.ts} +1 -12
- package/dist/{bot.js → browser/bot.js} +2 -16
- package/dist/browser/index.d.ts +8 -0
- package/dist/browser/index.js +8 -0
- package/dist/datetime/index.d.ts +6 -0
- package/dist/datetime/index.js +6 -0
- package/dist/datetime/localTime.js +1 -1
- package/dist/decorators/decorator.util.d.ts +1 -1
- package/dist/decorators/index.d.ts +12 -0
- package/dist/decorators/index.js +12 -0
- package/dist/decorators/logMethod.decorator.d.ts +1 -1
- package/dist/decorators/logMethod.decorator.js +4 -2
- package/dist/decorators/retry.decorator.d.ts +1 -1
- package/dist/decorators/retry.decorator.js +1 -1
- package/dist/error/assert.d.ts +1 -2
- package/dist/error/error.util.d.ts +2 -1
- package/dist/error/index.d.ts +6 -0
- package/dist/error/index.js +6 -0
- package/dist/error/try.d.ts +1 -2
- package/dist/error/tryCatch.d.ts +1 -1
- package/dist/error/tryCatch.js +2 -1
- package/dist/http/fetcher.js +1 -1
- package/dist/http/fetcher.model.d.ts +1 -2
- package/dist/http/index.d.ts +3 -0
- package/dist/http/index.js +2 -0
- package/dist/index.d.ts +0 -80
- package/dist/index.js +0 -80
- package/dist/is.util.d.ts +1 -2
- package/dist/iter/asyncIterable2.d.ts +1 -2
- package/dist/json-schema/from-data/generateJsonSchemaFromData.d.ts +2 -1
- package/dist/json-schema/from-data/generateJsonSchemaFromData.js +2 -1
- package/dist/json-schema/index.d.ts +5 -0
- package/dist/json-schema/index.js +5 -0
- package/dist/json-schema/jsonSchema.util.d.ts +1 -1
- package/dist/json-schema/jsonSchemaBuilder.d.ts +2 -1
- package/dist/json-schema/jsonSchemaBuilder.js +2 -1
- package/dist/log/index.d.ts +1 -0
- package/dist/log/index.js +1 -0
- package/dist/math/index.d.ts +4 -0
- package/dist/math/index.js +4 -0
- package/dist/math/stack.util.js +2 -1
- package/dist/object/index.d.ts +6 -0
- package/dist/object/index.js +6 -0
- package/dist/object/sortObject.d.ts +1 -1
- package/dist/promise/index.d.ts +11 -0
- package/dist/promise/index.js +11 -0
- package/dist/promise/pMap.d.ts +3 -2
- package/dist/promise/pMap.js +2 -1
- package/dist/promise/pRetry.d.ts +3 -1
- package/dist/promise/pRetry.js +4 -1
- package/dist/string/index.d.ts +13 -0
- package/dist/string/index.js +13 -0
- package/dist/typeFest.d.ts +1 -36
- package/dist/types.d.ts +6 -1
- package/package.json +16 -1
- package/src/array/range.ts +1 -2
- package/src/bot.model.ts +14 -0
- package/src/browser/adminService.ts +1 -1
- package/src/{bot.ts → browser/bot.ts} +2 -16
- package/src/browser/index.ts +8 -0
- package/src/datetime/index.ts +6 -0
- package/src/datetime/localTime.ts +1 -1
- package/src/decorators/decorator.util.ts +1 -1
- package/src/decorators/index.ts +12 -0
- package/src/decorators/logMethod.decorator.ts +5 -3
- package/src/decorators/retry.decorator.ts +2 -2
- package/src/error/assert.ts +1 -2
- package/src/error/error.util.ts +5 -5
- package/src/error/index.ts +6 -0
- package/src/error/try.ts +1 -2
- package/src/error/tryCatch.ts +4 -3
- package/src/http/fetcher.model.ts +7 -2
- package/src/http/fetcher.ts +1 -1
- package/src/http/index.ts +3 -0
- package/src/index.ts +0 -80
- package/src/is.util.ts +1 -2
- package/src/iter/asyncIterable2.ts +1 -2
- package/src/json-schema/from-data/generateJsonSchemaFromData.ts +3 -4
- package/src/json-schema/index.ts +5 -0
- package/src/json-schema/jsonSchema.util.ts +1 -1
- package/src/json-schema/jsonSchemaBuilder.ts +9 -9
- package/src/log/index.ts +1 -0
- package/src/math/index.ts +4 -0
- package/src/math/stack.util.ts +2 -1
- package/src/object/index.ts +6 -0
- package/src/object/sortObject.ts +1 -1
- package/src/promise/index.ts +11 -0
- package/src/promise/pMap.ts +3 -2
- package/src/promise/pRetry.ts +6 -2
- package/src/string/index.ts +13 -0
- package/src/typeFest.ts +1 -38
- package/src/types.ts +9 -1
- /package/dist/{time → datetime}/time.util.d.ts +0 -0
- /package/dist/{time → datetime}/time.util.js +0 -0
- /package/src/{time → datetime}/time.util.ts +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './abortable.js'
|
|
2
|
+
export * from './pDefer.js'
|
|
3
|
+
export * from './pDelay.js'
|
|
4
|
+
export * from './pFilter.js'
|
|
5
|
+
export * from './pHang.js'
|
|
6
|
+
export * from './pMap.js'
|
|
7
|
+
export * from './pProps.js'
|
|
8
|
+
export * from './pQueue.js'
|
|
9
|
+
export * from './pRetry.js'
|
|
10
|
+
export * from './pState.js'
|
|
11
|
+
export * from './pTimeout.js'
|
package/src/promise/pMap.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { ErrorMode } from '../error/index.js'
|
|
2
|
+
import type { CommonLogger } from '../log/index.js'
|
|
3
|
+
import { type AbortableAsyncMapper, END, SKIP } from '../types.js'
|
|
3
4
|
|
|
4
5
|
export interface PMapOptions {
|
|
5
6
|
/**
|
package/src/promise/pRetry.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { _errorDataAppend,
|
|
1
|
+
import { _since } from '../datetime/index.js'
|
|
2
|
+
import { _errorDataAppend, type ErrorData } from '../error/index.js'
|
|
3
|
+
import type { CommonLogger } from '../log/index.js'
|
|
4
|
+
import type { AnyFunction, UnixTimestampMillis } from '../types.js'
|
|
5
|
+
import { pDelay } from './pDelay.js'
|
|
6
|
+
import { pTimeout } from './pTimeout.js'
|
|
3
7
|
|
|
4
8
|
export interface PRetryOptions {
|
|
5
9
|
/**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './case.js'
|
|
2
|
+
export * from './escape.js'
|
|
3
|
+
export * from './hash.util.js'
|
|
4
|
+
export * from './json.util.js'
|
|
5
|
+
export * from './leven.js'
|
|
6
|
+
export * from './pupa.js'
|
|
7
|
+
export * from './readingTime.js'
|
|
8
|
+
export * from './regex.js'
|
|
9
|
+
export * from './safeJsonStringify.js'
|
|
10
|
+
export * from './slugify.js'
|
|
11
|
+
export * from './string.util.js'
|
|
12
|
+
export * from './stringify.js'
|
|
13
|
+
export * from './url.util.js'
|
package/src/typeFest.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
5
|
-
|
|
6
|
-
@category Basic
|
|
7
|
-
*/
|
|
8
|
-
export type Primitive = null | undefined | string | number | boolean | symbol | bigint
|
|
3
|
+
import type { Primitive } from './types.js'
|
|
9
4
|
|
|
10
5
|
/**
|
|
11
6
|
Flatten the type output to improve type hints shown in editors.
|
|
@@ -171,32 +166,6 @@ export type Merge<Destination, Source> = {
|
|
|
171
166
|
: never
|
|
172
167
|
} & PickIndexSignature<Destination & Source>
|
|
173
168
|
|
|
174
|
-
/**
|
|
175
|
-
Create a type that represents either the value or the value wrapped in `PromiseLike`.
|
|
176
|
-
|
|
177
|
-
Use-cases:
|
|
178
|
-
- A function accepts a callback that may either return a value synchronously or may return a promised value.
|
|
179
|
-
- This type could be the return type of `Promise#then()`, `Promise#catch()`, and `Promise#finally()` callbacks.
|
|
180
|
-
|
|
181
|
-
Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394) if you want to have this type as a built-in in TypeScript.
|
|
182
|
-
|
|
183
|
-
@example
|
|
184
|
-
```
|
|
185
|
-
import {Promisable} from 'type-fest';
|
|
186
|
-
|
|
187
|
-
async function logger(getLogEntry: () => Promisable<string>): Promise<void> {
|
|
188
|
-
const entry = await getLogEntry();
|
|
189
|
-
console.log(entry);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
logger(() => 'foo');
|
|
193
|
-
logger(() => Promise.resolve('bar'));
|
|
194
|
-
|
|
195
|
-
@category Utilities
|
|
196
|
-
```
|
|
197
|
-
*/
|
|
198
|
-
export type Promisable<T> = T | PromiseLike<T>
|
|
199
|
-
|
|
200
169
|
/**
|
|
201
170
|
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
202
171
|
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
@@ -296,12 +265,6 @@ export type ConditionalExcept<Base, Condition> = Except<Base, ConditionalKeys<Ba
|
|
|
296
265
|
*/
|
|
297
266
|
export type ConditionalPick<Base, Condition> = Pick<Base, ConditionalKeys<Base, Condition>>
|
|
298
267
|
|
|
299
|
-
/**
|
|
300
|
-
Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
|
|
301
|
-
@category Basic
|
|
302
|
-
*/
|
|
303
|
-
export type Class<T = any> = new (...args: any[]) => T
|
|
304
|
-
|
|
305
268
|
/**
|
|
306
269
|
Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
|
|
307
270
|
*/
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { _sortBy } from './array/array.util.js'
|
|
2
|
-
import type { Promisable } from './typeFest.js'
|
|
3
2
|
|
|
4
3
|
declare const __brand: unique symbol
|
|
5
4
|
|
|
@@ -435,3 +434,12 @@ export interface CommonClient extends AsyncDisposable {
|
|
|
435
434
|
disconnect: () => Promise<void>
|
|
436
435
|
ping: () => Promise<void>
|
|
437
436
|
}
|
|
437
|
+
|
|
438
|
+
export type Primitive = null | undefined | string | number | boolean | symbol | bigint
|
|
439
|
+
|
|
440
|
+
export type Promisable<T> = T | PromiseLike<T>
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
|
|
444
|
+
*/
|
|
445
|
+
export type Class<T = any> = new (...args: any[]) => T
|
|
File without changes
|
|
File without changes
|
|
File without changes
|