@naturalcycles/js-lib 14.244.0 → 14.245.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/dateInterval.d.ts +1 -1
- package/dist/datetime/localDate.d.ts +62 -43
- package/dist/datetime/localDate.js +153 -123
- package/dist/datetime/localTime.d.ts +57 -28
- package/dist/datetime/localTime.js +205 -138
- package/dist/datetime/timeInterval.d.ts +2 -2
- package/dist/datetime/timeInterval.js +2 -2
- package/dist/error/error.util.d.ts +1 -1
- package/dist/index.d.ts +37 -37
- package/dist/index.js +37 -37
- package/dist/json-schema/from-data/generateJsonSchemaFromData.d.ts +1 -1
- package/dist/json-schema/jsonSchemaBuilder.d.ts +1 -1
- package/dist/log/commonLogger.js +10 -9
- package/dist/object/object.util.d.ts +1 -1
- package/dist/time/time.util.js +4 -2
- package/dist/zod/zod.util.d.ts +1 -1
- package/dist-esm/datetime/localDate.js +153 -122
- package/dist-esm/datetime/localTime.js +205 -137
- package/dist-esm/datetime/timeInterval.js +2 -2
- package/dist-esm/decorators/logMethod.decorator.js +1 -1
- package/dist-esm/index.js +37 -37
- package/dist-esm/json-schema/jsonSchemaBuilder.js +1 -1
- package/dist-esm/log/commonLogger.js +2 -1
- package/dist-esm/time/time.util.js +4 -2
- package/package.json +1 -1
- package/src/datetime/dateInterval.ts +1 -1
- package/src/datetime/localDate.ts +157 -133
- package/src/datetime/localTime.ts +204 -149
- package/src/datetime/timeInterval.ts +4 -4
- package/src/decorators/logMethod.decorator.ts +1 -1
- package/src/define.ts +1 -1
- package/src/error/error.util.ts +3 -3
- package/src/http/fetcher.ts +1 -1
- package/src/index.ts +37 -37
- package/src/json-schema/from-data/generateJsonSchemaFromData.ts +1 -1
- package/src/json-schema/jsonSchemaBuilder.ts +2 -2
- package/src/log/commonLogger.ts +2 -1
- package/src/object/object.util.ts +1 -1
- package/src/time/time.util.ts +4 -1
- package/src/zod/zod.util.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
+
export * from './abort';
|
|
1
2
|
export * from './array/array.util';
|
|
2
|
-
export * from './define';
|
|
3
|
-
export * from './string/url.util';
|
|
4
3
|
export * from './array/range';
|
|
4
|
+
export * from './datetime/dateInterval';
|
|
5
|
+
export * from './datetime/localDate';
|
|
6
|
+
export * from './datetime/localTime';
|
|
7
|
+
export * from './datetime/timeInterval';
|
|
8
|
+
export * from './datetime/wallTime';
|
|
9
|
+
export * from './decorators/asyncMemo.decorator';
|
|
5
10
|
export * from './decorators/createPromiseDecorator';
|
|
6
11
|
export * from './decorators/debounce';
|
|
7
12
|
export * from './decorators/debounce.decorator';
|
|
8
13
|
export * from './decorators/decorator.util';
|
|
9
14
|
export * from './decorators/logMethod.decorator';
|
|
10
15
|
export * from './decorators/memo.decorator';
|
|
11
|
-
export * from './decorators/asyncMemo.decorator';
|
|
12
16
|
export * from './decorators/memo.util';
|
|
13
17
|
export * from './decorators/memoFn';
|
|
14
18
|
export * from './decorators/memoFnAsync';
|
|
15
19
|
export * from './decorators/retry.decorator';
|
|
16
20
|
export * from './decorators/timeout.decorator';
|
|
17
|
-
export * from './
|
|
21
|
+
export * from './define';
|
|
18
22
|
export * from './enum.util';
|
|
23
|
+
export * from './env';
|
|
24
|
+
export * from './env/buildInfo';
|
|
25
|
+
export * from './error/assert';
|
|
19
26
|
export * from './error/error.model';
|
|
20
27
|
export * from './error/error.util';
|
|
21
28
|
export * from './error/errorMode';
|
|
22
29
|
export * from './error/try';
|
|
23
30
|
export * from './error/tryCatch';
|
|
31
|
+
export * from './form.util';
|
|
32
|
+
export * from './http/fetcher';
|
|
33
|
+
export * from './http/fetcher.model';
|
|
34
|
+
export * from './http/http.model';
|
|
35
|
+
export * from './is.util';
|
|
36
|
+
export * from './iter/asyncIterable2';
|
|
37
|
+
export * from './iter/iterable2';
|
|
24
38
|
export * from './json-schema/from-data/generateJsonSchemaFromData';
|
|
25
39
|
export * from './json-schema/jsonSchema.cnst';
|
|
26
40
|
export * from './json-schema/jsonSchema.model';
|
|
27
41
|
export * from './json-schema/jsonSchema.util';
|
|
28
42
|
export * from './json-schema/jsonSchemaBuilder';
|
|
43
|
+
export * from './log/commonLogger';
|
|
29
44
|
export * from './math/math.util';
|
|
30
45
|
export * from './math/sma';
|
|
46
|
+
export * from './math/stack.util';
|
|
31
47
|
export * from './number/createDeterministicRandom';
|
|
32
48
|
export * from './number/number.util';
|
|
33
49
|
export * from './object/deepEquals';
|
|
50
|
+
export * from './object/map2';
|
|
34
51
|
export * from './object/object.util';
|
|
52
|
+
export * from './object/set2';
|
|
35
53
|
export * from './object/sortObject';
|
|
36
54
|
export * from './object/sortObjectDeep';
|
|
37
|
-
export * from './
|
|
38
|
-
export * from './
|
|
55
|
+
export * from './polyfill';
|
|
56
|
+
export * from './promise/abortable';
|
|
39
57
|
export * from './promise/pDefer';
|
|
40
58
|
export * from './promise/pDelay';
|
|
41
59
|
export * from './promise/pFilter';
|
|
42
60
|
export * from './promise/pHang';
|
|
43
61
|
export * from './promise/pMap';
|
|
44
62
|
export * from './promise/pProps';
|
|
63
|
+
export * from './promise/pQueue';
|
|
45
64
|
export * from './promise/pRetry';
|
|
46
65
|
export * from './promise/pState';
|
|
47
66
|
export * from './promise/pTimeout';
|
|
67
|
+
export * from './semver';
|
|
48
68
|
export * from './string/case';
|
|
49
|
-
export * from './string/json.util';
|
|
50
|
-
export * from './string/string.util';
|
|
51
|
-
export * from './string/readingTime';
|
|
52
69
|
export * from './string/escape';
|
|
70
|
+
export * from './string/hash.util';
|
|
71
|
+
export * from './string/json.util';
|
|
72
|
+
export * from './string/leven';
|
|
53
73
|
export * from './string/pupa';
|
|
74
|
+
export * from './string/readingTime';
|
|
75
|
+
export * from './string/regex';
|
|
76
|
+
export * from './string/safeJsonStringify';
|
|
77
|
+
export * from './string/string.util';
|
|
54
78
|
export * from './string/stringify';
|
|
79
|
+
export * from './string/url.util';
|
|
55
80
|
export * from './time/time.util';
|
|
56
|
-
export * from './is.util';
|
|
57
81
|
export * from './typeFest';
|
|
58
82
|
export * from './types';
|
|
59
83
|
export * from './unit/size.util';
|
|
60
|
-
export * from './log/commonLogger';
|
|
61
|
-
export * from './string/safeJsonStringify';
|
|
62
|
-
export * from './promise/pQueue';
|
|
63
|
-
export * from './promise/abortable';
|
|
64
|
-
export * from './iter/iterable2';
|
|
65
|
-
export * from './iter/asyncIterable2';
|
|
66
|
-
export * from './math/stack.util';
|
|
67
|
-
export * from './string/leven';
|
|
68
|
-
export * from './datetime/localDate';
|
|
69
|
-
export * from './datetime/localTime';
|
|
70
|
-
export * from './datetime/wallTime';
|
|
71
|
-
export * from './datetime/dateInterval';
|
|
72
|
-
export * from './datetime/timeInterval';
|
|
73
|
-
export * from './env';
|
|
74
|
-
export * from './http/http.model';
|
|
75
|
-
export * from './http/fetcher';
|
|
76
|
-
export * from './http/fetcher.model';
|
|
77
|
-
export * from './string/hash.util';
|
|
78
|
-
export * from './env/buildInfo';
|
|
79
|
-
export * from './form.util';
|
|
80
|
-
export * from './semver';
|
|
81
84
|
export * from './web';
|
|
82
|
-
export * from './abort';
|
|
83
|
-
export * from './polyfill';
|
|
84
|
-
export * from './string/regex';
|
|
85
|
-
export * from './zod/zod.util';
|
|
86
85
|
export * from './zod/zod.shared.schemas';
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
export * from './zod/zod.util';
|
|
87
|
+
import { z, ZodError, ZodIssue, ZodSchema } from 'zod';
|
|
88
|
+
export { z, ZodError, ZodSchema };
|
|
89
89
|
export type { ZodIssue };
|
package/dist/index.js
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ZodSchema = exports.ZodError = exports.z = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./abort"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./array/array.util"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./define"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./string/url.util"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./array/range"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./datetime/dateInterval"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./datetime/localDate"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./datetime/localTime"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./datetime/timeInterval"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./datetime/wallTime"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./decorators/asyncMemo.decorator"), exports);
|
|
9
14
|
tslib_1.__exportStar(require("./decorators/createPromiseDecorator"), exports);
|
|
10
15
|
tslib_1.__exportStar(require("./decorators/debounce"), exports);
|
|
11
16
|
tslib_1.__exportStar(require("./decorators/debounce.decorator"), exports);
|
|
12
17
|
tslib_1.__exportStar(require("./decorators/decorator.util"), exports);
|
|
13
18
|
tslib_1.__exportStar(require("./decorators/logMethod.decorator"), exports);
|
|
14
19
|
tslib_1.__exportStar(require("./decorators/memo.decorator"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./decorators/asyncMemo.decorator"), exports);
|
|
16
20
|
tslib_1.__exportStar(require("./decorators/memo.util"), exports);
|
|
17
21
|
tslib_1.__exportStar(require("./decorators/memoFn"), exports);
|
|
18
22
|
tslib_1.__exportStar(require("./decorators/memoFnAsync"), exports);
|
|
19
23
|
tslib_1.__exportStar(require("./decorators/retry.decorator"), exports);
|
|
20
24
|
tslib_1.__exportStar(require("./decorators/timeout.decorator"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./
|
|
25
|
+
tslib_1.__exportStar(require("./define"), exports);
|
|
22
26
|
tslib_1.__exportStar(require("./enum.util"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./env"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./env/buildInfo"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./error/assert"), exports);
|
|
23
30
|
tslib_1.__exportStar(require("./error/error.model"), exports);
|
|
24
31
|
tslib_1.__exportStar(require("./error/error.util"), exports);
|
|
25
32
|
tslib_1.__exportStar(require("./error/errorMode"), exports);
|
|
26
33
|
tslib_1.__exportStar(require("./error/try"), exports);
|
|
27
34
|
tslib_1.__exportStar(require("./error/tryCatch"), exports);
|
|
35
|
+
tslib_1.__exportStar(require("./form.util"), exports);
|
|
36
|
+
tslib_1.__exportStar(require("./http/fetcher"), exports);
|
|
37
|
+
tslib_1.__exportStar(require("./http/fetcher.model"), exports);
|
|
38
|
+
tslib_1.__exportStar(require("./http/http.model"), exports);
|
|
39
|
+
tslib_1.__exportStar(require("./is.util"), exports);
|
|
40
|
+
tslib_1.__exportStar(require("./iter/asyncIterable2"), exports);
|
|
41
|
+
tslib_1.__exportStar(require("./iter/iterable2"), exports);
|
|
28
42
|
tslib_1.__exportStar(require("./json-schema/from-data/generateJsonSchemaFromData"), exports);
|
|
29
43
|
tslib_1.__exportStar(require("./json-schema/jsonSchema.cnst"), exports);
|
|
30
44
|
tslib_1.__exportStar(require("./json-schema/jsonSchema.model"), exports);
|
|
31
45
|
tslib_1.__exportStar(require("./json-schema/jsonSchema.util"), exports);
|
|
32
46
|
tslib_1.__exportStar(require("./json-schema/jsonSchemaBuilder"), exports);
|
|
47
|
+
tslib_1.__exportStar(require("./log/commonLogger"), exports);
|
|
33
48
|
tslib_1.__exportStar(require("./math/math.util"), exports);
|
|
34
49
|
tslib_1.__exportStar(require("./math/sma"), exports);
|
|
50
|
+
tslib_1.__exportStar(require("./math/stack.util"), exports);
|
|
35
51
|
tslib_1.__exportStar(require("./number/createDeterministicRandom"), exports);
|
|
36
52
|
tslib_1.__exportStar(require("./number/number.util"), exports);
|
|
37
53
|
tslib_1.__exportStar(require("./object/deepEquals"), exports);
|
|
54
|
+
tslib_1.__exportStar(require("./object/map2"), exports);
|
|
38
55
|
tslib_1.__exportStar(require("./object/object.util"), exports);
|
|
56
|
+
tslib_1.__exportStar(require("./object/set2"), exports);
|
|
39
57
|
tslib_1.__exportStar(require("./object/sortObject"), exports);
|
|
40
58
|
tslib_1.__exportStar(require("./object/sortObjectDeep"), exports);
|
|
41
|
-
tslib_1.__exportStar(require("./
|
|
42
|
-
tslib_1.__exportStar(require("./
|
|
59
|
+
tslib_1.__exportStar(require("./polyfill"), exports);
|
|
60
|
+
tslib_1.__exportStar(require("./promise/abortable"), exports);
|
|
43
61
|
tslib_1.__exportStar(require("./promise/pDefer"), exports);
|
|
44
62
|
tslib_1.__exportStar(require("./promise/pDelay"), exports);
|
|
45
63
|
tslib_1.__exportStar(require("./promise/pFilter"), exports);
|
|
46
64
|
tslib_1.__exportStar(require("./promise/pHang"), exports);
|
|
47
65
|
tslib_1.__exportStar(require("./promise/pMap"), exports);
|
|
48
66
|
tslib_1.__exportStar(require("./promise/pProps"), exports);
|
|
67
|
+
tslib_1.__exportStar(require("./promise/pQueue"), exports);
|
|
49
68
|
tslib_1.__exportStar(require("./promise/pRetry"), exports);
|
|
50
69
|
tslib_1.__exportStar(require("./promise/pState"), exports);
|
|
51
70
|
tslib_1.__exportStar(require("./promise/pTimeout"), exports);
|
|
71
|
+
tslib_1.__exportStar(require("./semver"), exports);
|
|
52
72
|
tslib_1.__exportStar(require("./string/case"), exports);
|
|
53
|
-
tslib_1.__exportStar(require("./string/json.util"), exports);
|
|
54
|
-
tslib_1.__exportStar(require("./string/string.util"), exports);
|
|
55
|
-
tslib_1.__exportStar(require("./string/readingTime"), exports);
|
|
56
73
|
tslib_1.__exportStar(require("./string/escape"), exports);
|
|
74
|
+
tslib_1.__exportStar(require("./string/hash.util"), exports);
|
|
75
|
+
tslib_1.__exportStar(require("./string/json.util"), exports);
|
|
76
|
+
tslib_1.__exportStar(require("./string/leven"), exports);
|
|
57
77
|
tslib_1.__exportStar(require("./string/pupa"), exports);
|
|
78
|
+
tslib_1.__exportStar(require("./string/readingTime"), exports);
|
|
79
|
+
tslib_1.__exportStar(require("./string/regex"), exports);
|
|
80
|
+
tslib_1.__exportStar(require("./string/safeJsonStringify"), exports);
|
|
81
|
+
tslib_1.__exportStar(require("./string/string.util"), exports);
|
|
58
82
|
tslib_1.__exportStar(require("./string/stringify"), exports);
|
|
83
|
+
tslib_1.__exportStar(require("./string/url.util"), exports);
|
|
59
84
|
tslib_1.__exportStar(require("./time/time.util"), exports);
|
|
60
|
-
tslib_1.__exportStar(require("./is.util"), exports);
|
|
61
85
|
tslib_1.__exportStar(require("./typeFest"), exports);
|
|
62
86
|
tslib_1.__exportStar(require("./types"), exports);
|
|
63
87
|
tslib_1.__exportStar(require("./unit/size.util"), exports);
|
|
64
|
-
tslib_1.__exportStar(require("./log/commonLogger"), exports);
|
|
65
|
-
tslib_1.__exportStar(require("./string/safeJsonStringify"), exports);
|
|
66
|
-
tslib_1.__exportStar(require("./promise/pQueue"), exports);
|
|
67
|
-
tslib_1.__exportStar(require("./promise/abortable"), exports);
|
|
68
|
-
tslib_1.__exportStar(require("./iter/iterable2"), exports);
|
|
69
|
-
tslib_1.__exportStar(require("./iter/asyncIterable2"), exports);
|
|
70
|
-
tslib_1.__exportStar(require("./math/stack.util"), exports);
|
|
71
|
-
tslib_1.__exportStar(require("./string/leven"), exports);
|
|
72
|
-
tslib_1.__exportStar(require("./datetime/localDate"), exports);
|
|
73
|
-
tslib_1.__exportStar(require("./datetime/localTime"), exports);
|
|
74
|
-
tslib_1.__exportStar(require("./datetime/wallTime"), exports);
|
|
75
|
-
tslib_1.__exportStar(require("./datetime/dateInterval"), exports);
|
|
76
|
-
tslib_1.__exportStar(require("./datetime/timeInterval"), exports);
|
|
77
|
-
tslib_1.__exportStar(require("./env"), exports);
|
|
78
|
-
tslib_1.__exportStar(require("./http/http.model"), exports);
|
|
79
|
-
tslib_1.__exportStar(require("./http/fetcher"), exports);
|
|
80
|
-
tslib_1.__exportStar(require("./http/fetcher.model"), exports);
|
|
81
|
-
tslib_1.__exportStar(require("./string/hash.util"), exports);
|
|
82
|
-
tslib_1.__exportStar(require("./env/buildInfo"), exports);
|
|
83
|
-
tslib_1.__exportStar(require("./form.util"), exports);
|
|
84
|
-
tslib_1.__exportStar(require("./semver"), exports);
|
|
85
88
|
tslib_1.__exportStar(require("./web"), exports);
|
|
86
|
-
tslib_1.__exportStar(require("./abort"), exports);
|
|
87
|
-
tslib_1.__exportStar(require("./polyfill"), exports);
|
|
88
|
-
tslib_1.__exportStar(require("./string/regex"), exports);
|
|
89
|
-
tslib_1.__exportStar(require("./zod/zod.util"), exports);
|
|
90
89
|
tslib_1.__exportStar(require("./zod/zod.shared.schemas"), exports);
|
|
90
|
+
tslib_1.__exportStar(require("./zod/zod.util"), exports);
|
|
91
91
|
const zod_1 = require("zod");
|
|
92
92
|
Object.defineProperty(exports, "z", { enumerable: true, get: function () { return zod_1.z; } });
|
|
93
|
-
Object.defineProperty(exports, "ZodSchema", { enumerable: true, get: function () { return zod_1.ZodSchema; } });
|
|
94
93
|
Object.defineProperty(exports, "ZodError", { enumerable: true, get: function () { return zod_1.ZodError; } });
|
|
94
|
+
Object.defineProperty(exports, "ZodSchema", { enumerable: true, get: function () { return zod_1.ZodSchema; } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseDBEntity, JsonSchemaAllOf, JsonSchemaArray, JsonSchemaOneOf, JsonSchemaTuple
|
|
1
|
+
import type { AnyObject, BaseDBEntity, JsonSchemaAllOf, JsonSchemaArray, JsonSchemaOneOf, JsonSchemaTuple } from '../index';
|
|
2
2
|
import type { JsonSchema, JsonSchemaAny, JsonSchemaBoolean, JsonSchemaConst, JsonSchemaEnum, JsonSchemaNull, JsonSchemaNumber, JsonSchemaObject, JsonSchemaRef, JsonSchemaString } from './jsonSchema.model';
|
|
3
3
|
export interface JsonSchemaBuilder<T = unknown> {
|
|
4
4
|
build: () => JsonSchema<T>;
|
package/dist/log/commonLogger.js
CHANGED
|
@@ -5,7 +5,8 @@ exports.commonLoggerMinLevel = commonLoggerMinLevel;
|
|
|
5
5
|
exports.commonLoggerPipe = commonLoggerPipe;
|
|
6
6
|
exports.commonLoggerPrefix = commonLoggerPrefix;
|
|
7
7
|
exports.commonLoggerCreate = commonLoggerCreate;
|
|
8
|
-
|
|
8
|
+
// copy-pasted to avoid weird circular dependency
|
|
9
|
+
const _noop = (..._args) => undefined;
|
|
9
10
|
exports.commonLogLevelNumber = {
|
|
10
11
|
log: 10,
|
|
11
12
|
warn: 20,
|
|
@@ -17,9 +18,9 @@ exports.commonLogLevelNumber = {
|
|
|
17
18
|
* @experimental
|
|
18
19
|
*/
|
|
19
20
|
exports.commonLoggerNoop = {
|
|
20
|
-
log:
|
|
21
|
-
warn:
|
|
22
|
-
error:
|
|
21
|
+
log: _noop,
|
|
22
|
+
warn: _noop,
|
|
23
|
+
error: _noop,
|
|
23
24
|
};
|
|
24
25
|
/**
|
|
25
26
|
* Creates a "child" logger that is "limited" to the specified CommonLogLevel.
|
|
@@ -28,11 +29,11 @@ function commonLoggerMinLevel(logger, minLevel, mutate = false) {
|
|
|
28
29
|
const level = exports.commonLogLevelNumber[minLevel];
|
|
29
30
|
if (mutate) {
|
|
30
31
|
if (level > exports.commonLogLevelNumber['log']) {
|
|
31
|
-
logger.log =
|
|
32
|
+
logger.log = _noop;
|
|
32
33
|
if (level > exports.commonLogLevelNumber['warn']) {
|
|
33
|
-
logger.warn =
|
|
34
|
+
logger.warn = _noop;
|
|
34
35
|
if (level > exports.commonLogLevelNumber['error']) {
|
|
35
|
-
logger.error =
|
|
36
|
+
logger.error = _noop;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -47,8 +48,8 @@ function commonLoggerMinLevel(logger, minLevel, mutate = false) {
|
|
|
47
48
|
return exports.commonLoggerNoop;
|
|
48
49
|
}
|
|
49
50
|
return {
|
|
50
|
-
log:
|
|
51
|
-
warn: level <= exports.commonLogLevelNumber['warn'] ? logger.warn.bind(logger) :
|
|
51
|
+
log: _noop, // otherwise it is "log everything" logger (same logger as input)
|
|
52
|
+
warn: level <= exports.commonLogLevelNumber['warn'] ? logger.warn.bind(logger) : _noop,
|
|
52
53
|
error: logger.error.bind(logger), // otherwise it's "log nothing" logger (same as noopLogger)
|
|
53
54
|
};
|
|
54
55
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { KeyValueTuple, Reviver, SKIP } from '../types';
|
|
2
1
|
import type { AnyObject, ObjectMapper, ObjectPredicate, ValueOf } from '../types';
|
|
2
|
+
import { KeyValueTuple, Reviver, SKIP } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Returns clone of `obj` with only `props` preserved.
|
|
5
5
|
* Opposite of Omit.
|
package/dist/time/time.util.js
CHANGED
|
@@ -40,8 +40,10 @@ function _ms(millis) {
|
|
|
40
40
|
if (millis < 1000)
|
|
41
41
|
return `${Math.round(millis)} ms`;
|
|
42
42
|
// < 5 sec
|
|
43
|
-
if (millis < 5000)
|
|
44
|
-
|
|
43
|
+
if (millis < 5000) {
|
|
44
|
+
const s = millis / 1000;
|
|
45
|
+
return `${Math.trunc(s) === s ? s : s.toFixed(3)} sec`;
|
|
46
|
+
}
|
|
45
47
|
const sec = Math.floor(millis / 1000) % 60;
|
|
46
48
|
const min = Math.floor(millis / (60 * 1000)) % 60;
|
|
47
49
|
const hrs = Math.floor(millis / (3600 * 1000));
|
package/dist/zod/zod.util.d.ts
CHANGED