@naturalcycles/js-lib 15.58.0 → 15.59.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/dist/datetime/wallTime.js +1 -0
- package/dist/error/error.util.js +1 -0
- package/dist/string/json.util.js +1 -0
- package/dist/string/stringify.js +1 -0
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
- package/src/datetime/localDate.ts +1 -0
- package/src/datetime/localTime.ts +1 -0
- package/src/datetime/wallTime.ts +1 -0
- package/src/error/error.util.ts +1 -0
- package/src/object/object.util.ts +1 -1
- package/src/string/json.util.ts +1 -0
- package/src/string/stringify.ts +1 -0
- package/src/types.ts +6 -4
package/dist/error/error.util.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isServerSide } from '../env.js';
|
|
2
|
+
// oxlint-disable-next-line import/no-cycle -- intentional cycle
|
|
2
3
|
import { _jsonParseIfPossible } from '../string/json.util.js';
|
|
3
4
|
import { _truncate, _truncateMiddle } from '../string/string.util.js';
|
|
4
5
|
import { _stringify } from '../string/stringify.js';
|
package/dist/string/json.util.js
CHANGED
package/dist/string/stringify.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// oxlint-disable-next-line import/no-cycle -- intentional cycle
|
|
1
2
|
import { _isBackendErrorResponseObject, _isErrorLike, _isErrorObject } from '../error/error.util.js';
|
|
2
3
|
import { _jsonParseIfPossible } from './json.util.js';
|
|
3
4
|
import { _safeJsonStringify } from './safeJsonStringify.js';
|
package/dist/types.d.ts
CHANGED
|
@@ -291,14 +291,14 @@ export declare const _stringMapEntries: <T>(map: StringMap<T>) => [k: string, v:
|
|
|
291
291
|
* Alias of `Object.keys`, but returns keys typed as `keyof T`, not as just `string`.
|
|
292
292
|
* This is how TypeScript should work, actually.
|
|
293
293
|
*/
|
|
294
|
-
export declare const _objectKeys: <
|
|
294
|
+
export declare const _objectKeys: <K extends PropertyKey>(obj: Partial<Record<K, any>>) => K[];
|
|
295
295
|
/**
|
|
296
296
|
* Alias of `Object.entries`, but returns better-typed output.
|
|
297
297
|
*
|
|
298
298
|
* So e.g you can use _objectEntries(obj).map([k, v] => {})
|
|
299
299
|
* and `k` will be `keyof obj` instead of generic `string`.
|
|
300
300
|
*/
|
|
301
|
-
export declare const _objectEntries: <
|
|
301
|
+
export declare const _objectEntries: <K extends PropertyKey, V>(obj: Partial<Record<K, V>>) => [k: K, v: V][];
|
|
302
302
|
export type NullishValue = null | undefined;
|
|
303
303
|
export type FalsyValue = false | '' | 0 | null | undefined;
|
|
304
304
|
/**
|
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ import type {
|
|
|
10
10
|
UnixTimestamp,
|
|
11
11
|
UnixTimestampMillis,
|
|
12
12
|
} from '../types.js'
|
|
13
|
+
// oxlint-disable-next-line import/no-cycle -- intentional cycle
|
|
13
14
|
import type { DateObject, ISODayOfWeek, LocalTime } from './localTime.js'
|
|
14
15
|
import { localTime, VALID_DAYS_OF_WEEK } from './localTime.js'
|
|
15
16
|
|
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
UnixTimestamp,
|
|
13
13
|
UnixTimestampMillis,
|
|
14
14
|
} from '../types.js'
|
|
15
|
+
// oxlint-disable-next-line import/no-cycle -- intentional cycle
|
|
15
16
|
import type { LocalDate } from './localDate.js'
|
|
16
17
|
import { localDate } from './localDate.js'
|
|
17
18
|
import { _ms } from './time.util.js'
|
package/src/datetime/wallTime.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IsoDate, IsoDateTime } from '../types.js'
|
|
2
|
+
// oxlint-disable-next-line import/no-cycle -- intentional cycle
|
|
2
3
|
import { LocalDate } from './localDate.js'
|
|
3
4
|
import type { DateTimeObject, LocalTime } from './localTime.js'
|
|
4
5
|
import { localTime } from './localTime.js'
|
package/src/error/error.util.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isServerSide } from '../env.js'
|
|
2
|
+
// oxlint-disable-next-line import/no-cycle -- intentional cycle
|
|
2
3
|
import { _jsonParseIfPossible } from '../string/json.util.js'
|
|
3
4
|
import { _truncate, _truncateMiddle } from '../string/string.util.js'
|
|
4
5
|
import { _stringify } from '../string/stringify.js'
|
package/src/string/json.util.ts
CHANGED
package/src/string/stringify.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -364,7 +364,9 @@ export const _stringMapEntries = Object.entries as <T>(map: StringMap<T>) => [k:
|
|
|
364
364
|
* Alias of `Object.keys`, but returns keys typed as `keyof T`, not as just `string`.
|
|
365
365
|
* This is how TypeScript should work, actually.
|
|
366
366
|
*/
|
|
367
|
-
export const _objectKeys = Object.keys as <
|
|
367
|
+
export const _objectKeys = Object.keys as <K extends PropertyKey>(
|
|
368
|
+
obj: Partial<Record<K, any>>,
|
|
369
|
+
) => K[]
|
|
368
370
|
|
|
369
371
|
/**
|
|
370
372
|
* Alias of `Object.entries`, but returns better-typed output.
|
|
@@ -372,9 +374,9 @@ export const _objectKeys = Object.keys as <T extends AnyObject>(obj: T) => (keyo
|
|
|
372
374
|
* So e.g you can use _objectEntries(obj).map([k, v] => {})
|
|
373
375
|
* and `k` will be `keyof obj` instead of generic `string`.
|
|
374
376
|
*/
|
|
375
|
-
export const _objectEntries = Object.entries as <
|
|
376
|
-
obj:
|
|
377
|
-
) => [k:
|
|
377
|
+
export const _objectEntries = Object.entries as <K extends PropertyKey, V>(
|
|
378
|
+
obj: Partial<Record<K, V>>,
|
|
379
|
+
) => [k: K, v: V][]
|
|
378
380
|
|
|
379
381
|
export type NullishValue = null | undefined
|
|
380
382
|
export type FalsyValue = false | '' | 0 | null | undefined
|