@wener/common 2.0.3 → 2.0.6
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/lib/ai/qwen3vl/index.js +1 -1
- package/lib/ai/qwen3vl/utils.js +15 -15
- package/lib/ai/qwen3vl/utils.js.map +1 -1
- package/lib/ai/vision/DocLayoutElementTypeSchema.js +22 -22
- package/lib/ai/vision/ImageAnnotationSchema.js +63 -47
- package/lib/ai/vision/index.js +2 -2
- package/lib/ai/vision/resolveImageAnnotation.js +81 -95
- package/lib/cn/ChineseResidentIdNo.js +55 -41
- package/lib/cn/ChineseResidentIdNo.js.map +1 -1
- package/lib/cn/ChineseResidentIdNo.mod.js +6 -1
- package/lib/cn/ChineseResidentIdNo.test.js +22 -21
- package/lib/cn/DivisionCode.js +220 -235
- package/lib/cn/DivisionCode.mod.js +6 -1
- package/lib/cn/DivisionCode.test.js +92 -121
- package/lib/cn/Mod11.js +18 -37
- package/lib/cn/Mod11.js.map +1 -1
- package/lib/cn/Mod31.js +23 -41
- package/lib/cn/UnifiedSocialCreditCode.js +143 -137
- package/lib/cn/UnifiedSocialCreditCode.mod.js +6 -1
- package/lib/cn/UnifiedSocialCreditCode.test.js +21 -15
- package/lib/cn/formatChineseAmount.js +46 -71
- package/lib/cn/index.js +6 -6
- package/lib/cn/mod.js +5 -3
- package/lib/cn/parseChineseNumber.js +81 -85
- package/lib/cn/parseChineseNumber.test.js +183 -261
- package/lib/cn/pinyin/cartesianProduct.js +19 -19
- package/lib/cn/pinyin/cartesianProduct.test.js +78 -178
- package/lib/cn/pinyin/loader.js +13 -11
- package/lib/cn/pinyin/preload.js +2 -1
- package/lib/cn/pinyin/toPinyin.test.js +149 -161
- package/lib/cn/pinyin/toPinyinPure.js +28 -23
- package/lib/cn/pinyin/transform.js +11 -11
- package/lib/cn/types.d.js +2 -2
- package/lib/consola/createStandardConsolaReporter.js +14 -15
- package/lib/consola/formatLogObject.js +149 -133
- package/lib/consola/formatLogObject.js.map +1 -1
- package/lib/consola/formatLogObject.test.js +167 -178
- package/lib/consola/index.js +2 -2
- package/lib/data/formatSort.js +14 -12
- package/lib/data/formatSort.test.js +33 -33
- package/lib/data/index.js +3 -3
- package/lib/data/maybeNumber.js +23 -23
- package/lib/data/maybeNumber.js.map +1 -1
- package/lib/data/parseSort.js +75 -68
- package/lib/data/parseSort.test.js +196 -187
- package/lib/data/resolvePagination.js +38 -39
- package/lib/data/resolvePagination.test.js +228 -218
- package/lib/data/types.d.js +2 -2
- package/lib/data/types.d.js.map +1 -1
- package/lib/dayjs/dayjs.js +20 -20
- package/lib/dayjs/formatDuration.js +56 -56
- package/lib/dayjs/formatDuration.js.map +1 -1
- package/lib/dayjs/formatDuration.test.js +63 -77
- package/lib/dayjs/index.js +4 -4
- package/lib/dayjs/parseDuration.js +21 -26
- package/lib/dayjs/parseRelativeTime.js +65 -66
- package/lib/dayjs/parseRelativeTime.test.js +227 -243
- package/lib/dayjs/resolveRelativeTime.js +74 -144
- package/lib/dayjs/resolveRelativeTime.js.map +1 -1
- package/lib/dayjs/resolveRelativeTime.test.js +296 -307
- package/lib/decimal/index.js +1 -1
- package/lib/decimal/parseDecimal.js +12 -12
- package/lib/drain3/Drain.js +321 -0
- package/lib/drain3/Drain.js.map +1 -0
- package/lib/drain3/LogCluster.js +38 -0
- package/lib/drain3/LogCluster.js.map +1 -0
- package/lib/drain3/Node.js +39 -0
- package/lib/drain3/Node.js.map +1 -0
- package/lib/drain3/TemplateMiner.js +205 -0
- package/lib/drain3/TemplateMiner.js.map +1 -0
- package/lib/drain3/index.js +31 -0
- package/lib/drain3/index.js.map +1 -0
- package/lib/drain3/persistence/FilePersistence.js +24 -0
- package/lib/drain3/persistence/FilePersistence.js.map +1 -0
- package/lib/drain3/persistence/MemoryPersistence.js +18 -0
- package/lib/drain3/persistence/MemoryPersistence.js.map +1 -0
- package/lib/drain3/persistence/PersistenceHandler.js +5 -0
- package/lib/drain3/persistence/PersistenceHandler.js.map +1 -0
- package/lib/drain3/types.js +7 -0
- package/lib/drain3/types.js.map +1 -0
- package/lib/emittery/emitter.js +7 -7
- package/lib/emittery/index.js +1 -1
- package/lib/foundation/schema/SexType.js +15 -12
- package/lib/foundation/schema/index.js +1 -1
- package/lib/foundation/schema/parseSexType.js +15 -16
- package/lib/foundation/schema/types.js +8 -6
- package/lib/fs/FileSystemError.js +18 -18
- package/lib/fs/IFileSystem.d.js +2 -2
- package/lib/fs/IFileSystem.d.js.map +1 -1
- package/lib/fs/MemoryFileSystem.test.js +172 -181
- package/lib/fs/createBrowserFileSystem.js +222 -233
- package/lib/fs/createBrowserFileSystem.js.map +1 -1
- package/lib/fs/createMemoryFileSystem.js +473 -510
- package/lib/fs/createMemoryFileSystem.js.map +1 -1
- package/lib/fs/createSandboxFileSystem.js +102 -101
- package/lib/fs/createSandboxFileSystem.js.map +1 -1
- package/lib/fs/createWebDavFileSystem.js +162 -132
- package/lib/fs/createWebDavFileSystem.js.map +1 -1
- package/lib/fs/createWebFileSystem.js +202 -0
- package/lib/fs/createWebFileSystem.js.map +1 -0
- package/lib/fs/findMimeType.js +14 -14
- package/lib/fs/findMimeType.js.map +1 -1
- package/lib/fs/index.js +7 -7
- package/lib/fs/index.js.map +1 -1
- package/lib/fs/minio/createMinioFileSystem.js +977 -0
- package/lib/fs/minio/createMinioFileSystem.js.map +1 -0
- package/lib/fs/minio/index.js +2 -0
- package/lib/fs/minio/index.js.map +1 -0
- package/lib/fs/orpc/FileSystemContract.js +57 -57
- package/lib/fs/orpc/createContractClientFileSystem.js +88 -88
- package/lib/fs/orpc/createContractClientFileSystem.js.map +1 -1
- package/lib/fs/orpc/index.js +2 -2
- package/lib/fs/orpc/server/createFileSystemContractImpl.js +62 -60
- package/lib/fs/orpc/server/createFileSystemContractImpl.js.map +1 -1
- package/lib/fs/orpc/server/index.js +1 -1
- package/lib/fs/s3/createS3MiniFileSystem.js +756 -689
- package/lib/fs/s3/createS3MiniFileSystem.js.map +1 -1
- package/lib/fs/s3/index.js +1 -1
- package/lib/fs/s3/s3mini.test.js +524 -553
- package/lib/fs/scandir.js +56 -56
- package/lib/fs/server/createDatabaseFileSystem.js +834 -741
- package/lib/fs/server/createDatabaseFileSystem.js.map +1 -1
- package/lib/fs/server/createNodeFileSystem.js +407 -380
- package/lib/fs/server/createNodeFileSystem.js.map +1 -1
- package/lib/fs/server/dbfs.test.js +201 -214
- package/lib/fs/server/index.js +1 -1
- package/lib/fs/server/loadTestDatabase.js +40 -43
- package/lib/fs/tests/runFileSystemTest.js +352 -315
- package/lib/fs/tests/runFileSystemTest.js.map +1 -1
- package/lib/fs/types.js +17 -20
- package/lib/fs/utils/getFileUrl.js +24 -30
- package/lib/fs/utils.js +17 -17
- package/lib/fs/utils.js.map +1 -1
- package/lib/fs/webdav/index.js +2 -0
- package/lib/fs/webdav/index.js.map +1 -0
- package/lib/index.js +2 -2
- package/lib/jsonschema/JsonSchema.js +216 -155
- package/lib/jsonschema/JsonSchema.js.map +1 -1
- package/lib/jsonschema/JsonSchema.test.js +123 -124
- package/lib/jsonschema/forEachJsonSchema.js +41 -41
- package/lib/jsonschema/forEachJsonSchema.js.map +1 -1
- package/lib/jsonschema/index.js +2 -2
- package/lib/jsonschema/types.d.js +2 -2
- package/lib/jsonschema/types.d.js.map +1 -1
- package/lib/meta/defineFileType.js +32 -38
- package/lib/meta/defineInit.js +39 -35
- package/lib/meta/defineMetadata.js +37 -34
- package/lib/meta/defineMetadata.js.map +1 -1
- package/lib/meta/defineMetadata.test.js +13 -12
- package/lib/meta/index.js +3 -3
- package/lib/orpc/createOpenApiContractClient.js +26 -24
- package/lib/orpc/createOpenApiContractClient.js.map +1 -1
- package/lib/orpc/createRpcContractClient.js +37 -31
- package/lib/orpc/index.js +2 -2
- package/lib/orpc/resolveLinkPlugins.js +25 -25
- package/lib/password/PHC.js +187 -189
- package/lib/password/PHC.js.map +1 -1
- package/lib/password/PHC.test.js +517 -535
- package/lib/password/Password.js +85 -80
- package/lib/password/Password.test.js +330 -364
- package/lib/password/createArgon2PasswordAlgorithm.js +50 -51
- package/lib/password/createArgon2PasswordAlgorithm.js.map +1 -1
- package/lib/password/createBase64PasswordAlgorithm.js +11 -11
- package/lib/password/createBase64PasswordAlgorithm.js.map +1 -1
- package/lib/password/createBcryptPasswordAlgorithm.js +20 -18
- package/lib/password/createBcryptPasswordAlgorithm.js.map +1 -1
- package/lib/password/createPBKDF2PasswordAlgorithm.js +65 -52
- package/lib/password/createPBKDF2PasswordAlgorithm.js.map +1 -1
- package/lib/password/createScryptPasswordAlgorithm.js +74 -63
- package/lib/password/createScryptPasswordAlgorithm.js.map +1 -1
- package/lib/password/index.js +5 -5
- package/lib/password/server/index.js +1 -1
- package/lib/resource/Identifiable.js +2 -2
- package/lib/resource/ListQuery.js +42 -42
- package/lib/resource/ListQuery.js.map +1 -1
- package/lib/resource/getTitleOfResource.js +5 -5
- package/lib/resource/index.js +2 -2
- package/lib/resource/index.js.map +1 -1
- package/lib/resource/schema/AnyResourceSchema.js +91 -89
- package/lib/resource/schema/BaseResourceSchema.js +26 -26
- package/lib/resource/schema/ResourceActionType.js +117 -115
- package/lib/resource/schema/ResourceStatus.js +94 -92
- package/lib/resource/schema/ResourceType.js +25 -23
- package/lib/resource/schema/index.js +5 -5
- package/lib/resource/schema/types.js +86 -55
- package/lib/resource/schema/types.test.js +16 -13
- package/lib/s3/formatS3Url.js +60 -60
- package/lib/s3/formatS3Url.js.map +1 -1
- package/lib/s3/formatS3Url.test.js +238 -261
- package/lib/s3/index.js +2 -2
- package/lib/s3/parseS3Url.js +61 -60
- package/lib/s3/parseS3Url.js.map +1 -1
- package/lib/s3/parseS3Url.test.js +270 -269
- package/lib/schema/SchemaRegistry.js +41 -42
- package/lib/schema/SchemaRegistry.js.map +1 -1
- package/lib/schema/SchemaRegistry.mod.js +1 -1
- package/lib/schema/TypeSchema.d.js +2 -2
- package/lib/schema/TypeSchema.d.js.map +1 -1
- package/lib/schema/createSchemaData.js +113 -67
- package/lib/schema/createSchemaData.js.map +1 -1
- package/lib/schema/findJsonSchemaByPath.js +28 -23
- package/lib/schema/findJsonSchemaByPath.js.map +1 -1
- package/lib/schema/formatZodError.js +113 -134
- package/lib/schema/formatZodError.js.map +1 -1
- package/lib/schema/formatZodError.test.js +192 -195
- package/lib/schema/getSchemaCache.js +7 -7
- package/lib/schema/getSchemaOptions.js +17 -16
- package/lib/schema/index.js +6 -6
- package/lib/schema/toJsonSchema.js +196 -190
- package/lib/schema/toJsonSchema.js.map +1 -1
- package/lib/schema/toJsonSchema.test.js +34 -26
- package/lib/schema/validate.js +106 -97
- package/lib/schema/validate.js.map +1 -1
- package/lib/tools/generateSchema.js +40 -40
- package/lib/tools/renderJsonSchemaToMarkdownDoc.js +74 -74
- package/lib/utils/buildBaseUrl.js +8 -8
- package/lib/utils/buildRedactorFormSchema.js +55 -54
- package/lib/utils/buildRedactorFormSchema.js.map +1 -1
- package/lib/utils/getEstimateProcessTime.js +24 -19
- package/lib/utils/index.js +3 -3
- package/lib/utils/resolveFeatureOptions.js +9 -9
- package/package.json +37 -18
- package/src/ai/qwen3vl/utils.ts +1 -1
- package/src/ai/vision/index.ts +2 -2
- package/src/cn/ChineseResidentIdNo.ts +1 -1
- package/src/cn/Mod11.ts +1 -1
- package/src/cn/__snapshots__/ChineseResidentIdNo.test.ts.snap +1 -1
- package/src/cn/__snapshots__/UnifiedSocialCreditCode.test.ts.snap +0 -23
- package/src/cn/index.ts +1 -2
- package/src/cn/parseChineseNumber.test.ts +4 -4
- package/src/consola/formatLogObject.ts +6 -6
- package/src/consola/index.ts +1 -1
- package/src/data/index.ts +3 -4
- package/src/data/maybeNumber.ts +1 -1
- package/src/data/parseSort.test.ts +0 -1
- package/src/data/resolvePagination.ts +2 -2
- package/src/data/types.d.ts +2 -2
- package/src/dayjs/formatDuration.ts +10 -11
- package/src/dayjs/index.ts +1 -1
- package/src/dayjs/parseRelativeTime.ts +1 -1
- package/src/dayjs/resolveRelativeTime.ts +11 -14
- package/src/drain3/Drain.test.ts +378 -0
- package/src/drain3/Drain.ts +394 -0
- package/src/drain3/LogCluster.ts +46 -0
- package/src/drain3/Node.ts +53 -0
- package/src/drain3/TemplateMiner.ts +246 -0
- package/src/drain3/index.ts +34 -0
- package/src/drain3/persistence/FilePersistence.ts +24 -0
- package/src/drain3/persistence/MemoryPersistence.ts +23 -0
- package/src/drain3/persistence/PersistenceHandler.ts +19 -0
- package/src/drain3/types.ts +75 -0
- package/src/fs/IFileSystem.d.ts +1 -2
- package/src/fs/createBrowserFileSystem.ts +7 -5
- package/src/fs/createMemoryFileSystem.ts +9 -13
- package/src/fs/createSandboxFileSystem.ts +1 -1
- package/src/fs/createWebDavFileSystem.ts +30 -17
- package/src/fs/createWebFileSystem.ts +242 -0
- package/src/fs/findMimeType.ts +1 -4
- package/src/fs/index.ts +5 -5
- package/src/fs/minio/createMinioFileSystem.ts +1148 -0
- package/src/fs/minio/index.ts +1 -0
- package/src/fs/orpc/createContractClientFileSystem.ts +5 -5
- package/src/fs/orpc/server/createFileSystemContractImpl.ts +1 -1
- package/src/fs/s3/createS3MiniFileSystem.ts +120 -79
- package/src/fs/s3/s3fs.test.ts +441 -0
- package/src/fs/s3/s3mini.test.ts +2 -2
- package/src/fs/server/createDatabaseFileSystem.ts +78 -114
- package/src/fs/server/createNodeFileSystem.ts +32 -13
- package/src/fs/server/dbfs.test.ts +13 -8
- package/src/fs/server/index.ts +1 -0
- package/src/fs/server/loadTestDatabase.ts +8 -119
- package/src/fs/tests/runFileSystemTest.ts +29 -28
- package/src/fs/utils.ts +1 -1
- package/src/fs/webdav/index.ts +1 -0
- package/src/jsonschema/JsonSchema.ts +5 -5
- package/src/jsonschema/forEachJsonSchema.ts +1 -1
- package/src/jsonschema/index.ts +1 -1
- package/src/jsonschema/types.d.ts +1 -1
- package/src/meta/defineMetadata.ts +1 -1
- package/src/meta/index.ts +2 -3
- package/src/orm/createSqliteDialect.ts +17 -0
- package/src/orm/index.ts +1 -0
- package/src/orpc/createOpenApiContractClient.ts +3 -3
- package/src/orpc/index.ts +1 -1
- package/src/password/PHC.ts +3 -3
- package/src/password/createArgon2PasswordAlgorithm.ts +2 -2
- package/src/password/createBase64PasswordAlgorithm.ts +2 -2
- package/src/password/createBcryptPasswordAlgorithm.ts +4 -2
- package/src/password/createPBKDF2PasswordAlgorithm.ts +2 -2
- package/src/password/createScryptPasswordAlgorithm.ts +4 -4
- package/src/password/index.ts +2 -2
- package/src/resource/ListQuery.ts +4 -1
- package/src/resource/index.ts +3 -3
- package/src/resource/schema/index.ts +4 -4
- package/src/s3/formatS3Url.test.ts +1 -1
- package/src/s3/formatS3Url.ts +2 -2
- package/src/s3/index.ts +1 -1
- package/src/s3/parseS3Url.ts +1 -1
- package/src/schema/SchemaRegistry.ts +2 -2
- package/src/schema/TypeSchema.d.ts +6 -6
- package/src/schema/createSchemaData.ts +5 -5
- package/src/schema/findJsonSchemaByPath.ts +5 -5
- package/src/schema/formatZodError.test.ts +2 -1
- package/src/schema/formatZodError.ts +50 -62
- package/src/schema/index.ts +5 -5
- package/src/schema/toJsonSchema.ts +6 -6
- package/src/schema/validate.ts +2 -2
- package/src/utils/buildRedactorFormSchema.ts +4 -4
- package/src/utils/formatNumber.ts +18 -0
- package/src/utils/formatPercent.ts +17 -0
- package/src/utils/index.ts +3 -3
- package/src/utils/resolveFeatureOptions.ts +1 -1
|
@@ -1,184 +1,173 @@
|
|
|
1
1
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Promise.resolve(value).then(_next, _throw);
|
|
15
|
-
}
|
|
2
|
+
try {
|
|
3
|
+
var info = gen[key](arg);
|
|
4
|
+
var value = info.value;
|
|
5
|
+
} catch (error) {
|
|
6
|
+
reject(error);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (info.done) {
|
|
10
|
+
resolve(value);
|
|
11
|
+
} else {
|
|
12
|
+
Promise.resolve(value).then(_next, _throw);
|
|
13
|
+
}
|
|
16
14
|
}
|
|
17
15
|
function _async_to_generator(fn) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
return function () {
|
|
17
|
+
var args = arguments;
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
var gen = fn.apply(this, args);
|
|
20
|
+
function _next(value) {
|
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
|
|
22
|
+
}
|
|
23
|
+
function _throw(err) {
|
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
|
|
25
|
+
}
|
|
26
|
+
_next(undefined);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
31
29
|
}
|
|
32
30
|
function _ts_generator(thisArg, body) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
done: true
|
|
137
|
-
};
|
|
138
|
-
}
|
|
31
|
+
var f,
|
|
32
|
+
y,
|
|
33
|
+
t,
|
|
34
|
+
_ = {
|
|
35
|
+
label: 0,
|
|
36
|
+
sent: () => {
|
|
37
|
+
if (t[0] & 1) throw t[1];
|
|
38
|
+
return t[1];
|
|
39
|
+
},
|
|
40
|
+
trys: [],
|
|
41
|
+
ops: [],
|
|
42
|
+
},
|
|
43
|
+
g = Object.create((typeof Iterator === 'function' ? Iterator : Object).prototype),
|
|
44
|
+
d = Object.defineProperty;
|
|
45
|
+
return (
|
|
46
|
+
d(g, 'next', {
|
|
47
|
+
value: verb(0),
|
|
48
|
+
}),
|
|
49
|
+
d(g, 'throw', {
|
|
50
|
+
value: verb(1),
|
|
51
|
+
}),
|
|
52
|
+
d(g, 'return', {
|
|
53
|
+
value: verb(2),
|
|
54
|
+
}),
|
|
55
|
+
typeof Symbol === 'function' &&
|
|
56
|
+
d(g, Symbol.iterator, {
|
|
57
|
+
value: function () {
|
|
58
|
+
return this;
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
g
|
|
62
|
+
);
|
|
63
|
+
function verb(n) {
|
|
64
|
+
return (v) => step([n, v]);
|
|
65
|
+
}
|
|
66
|
+
function step(op) {
|
|
67
|
+
if (f) throw new TypeError('Generator is already executing.');
|
|
68
|
+
while ((g && ((g = 0), op[0] && (_ = 0)), _))
|
|
69
|
+
try {
|
|
70
|
+
if (
|
|
71
|
+
((f = 1),
|
|
72
|
+
y &&
|
|
73
|
+
(t = op[0] & 2 ? y['return'] : op[0] ? y['throw'] || ((t = y['return']) && t.call(y), 0) : y.next) &&
|
|
74
|
+
!(t = t.call(y, op[1])).done)
|
|
75
|
+
)
|
|
76
|
+
return t;
|
|
77
|
+
if (((y = 0), t)) op = [op[0] & 2, t.value];
|
|
78
|
+
switch (op[0]) {
|
|
79
|
+
case 0:
|
|
80
|
+
case 1:
|
|
81
|
+
t = op;
|
|
82
|
+
break;
|
|
83
|
+
case 4:
|
|
84
|
+
_.label++;
|
|
85
|
+
return {
|
|
86
|
+
value: op[1],
|
|
87
|
+
done: false,
|
|
88
|
+
};
|
|
89
|
+
case 5:
|
|
90
|
+
_.label++;
|
|
91
|
+
y = op[1];
|
|
92
|
+
op = [0];
|
|
93
|
+
continue;
|
|
94
|
+
case 7:
|
|
95
|
+
op = _.ops.pop();
|
|
96
|
+
_.trys.pop();
|
|
97
|
+
continue;
|
|
98
|
+
default:
|
|
99
|
+
if (!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && (op[0] === 6 || op[0] === 2)) {
|
|
100
|
+
_ = 0;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
104
|
+
_.label = op[1];
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
108
|
+
_.label = t[1];
|
|
109
|
+
t = op;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
if (t && _.label < t[2]) {
|
|
113
|
+
_.label = t[2];
|
|
114
|
+
_.ops.push(op);
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
if (t[2]) _.ops.pop();
|
|
118
|
+
_.trys.pop();
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
op = body.call(thisArg, _);
|
|
122
|
+
} catch (e) {
|
|
123
|
+
op = [6, e];
|
|
124
|
+
y = 0;
|
|
125
|
+
} finally {
|
|
126
|
+
f = t = 0;
|
|
127
|
+
}
|
|
128
|
+
if (op[0] & 5) throw op[1];
|
|
129
|
+
return {
|
|
130
|
+
value: op[0] ? op[1] : void 0,
|
|
131
|
+
done: true,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
139
134
|
}
|
|
140
|
-
|
|
141
|
-
import
|
|
142
|
-
import {
|
|
143
|
-
import {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
return [
|
|
180
|
-
2
|
|
181
|
-
];
|
|
182
|
-
});
|
|
183
|
-
})();
|
|
184
|
-
});
|
|
135
|
+
|
|
136
|
+
import consola from 'consola';
|
|
137
|
+
import { Consola } from 'consola/core';
|
|
138
|
+
import { test } from 'vitest';
|
|
139
|
+
import { createStandardConsolaReporter } from './createStandardConsolaReporter.js';
|
|
140
|
+
|
|
141
|
+
test('formatLogObject', () =>
|
|
142
|
+
_async_to_generator(function () {
|
|
143
|
+
var log;
|
|
144
|
+
return _ts_generator(this, (_state) => {
|
|
145
|
+
log = new Consola({
|
|
146
|
+
reporters: [createStandardConsolaReporter({})],
|
|
147
|
+
}).create({
|
|
148
|
+
formatOptions: {
|
|
149
|
+
colors: true,
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
consola.warn({
|
|
153
|
+
name: 'wener',
|
|
154
|
+
});
|
|
155
|
+
log.info({
|
|
156
|
+
name: 'wener',
|
|
157
|
+
});
|
|
158
|
+
log.info('message', {
|
|
159
|
+
name: 'wener',
|
|
160
|
+
});
|
|
161
|
+
log.info('complex object', {
|
|
162
|
+
name: 'wener',
|
|
163
|
+
age: 30,
|
|
164
|
+
active: true,
|
|
165
|
+
tags: ['developer', 'typescript'],
|
|
166
|
+
meta: {
|
|
167
|
+
level: 'senior',
|
|
168
|
+
remote: true,
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
return [2];
|
|
172
|
+
});
|
|
173
|
+
})());
|
package/lib/consola/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { createStandardConsolaReporter } from './createStandardConsolaReporter.js';
|
|
2
|
+
export { formatLogObject } from './formatLogObject.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/lib/data/formatSort.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
export function formatSort(s) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
return s
|
|
3
|
+
.map(({ field, order, nulls }) => {
|
|
4
|
+
if (!field) return '';
|
|
5
|
+
let r = field;
|
|
6
|
+
if (order) {
|
|
7
|
+
r += ` ${order}`;
|
|
8
|
+
}
|
|
9
|
+
if (nulls) {
|
|
10
|
+
r += ` nulls ${nulls}`;
|
|
11
|
+
}
|
|
12
|
+
return r;
|
|
13
|
+
})
|
|
14
|
+
.filter(Boolean);
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
//# sourceMappingURL=formatSort.js.map
|
|
17
|
+
//# sourceMappingURL=formatSort.js.map
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { expect, test } from
|
|
2
|
-
import { formatSort } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { expect, test } from 'vitest';
|
|
2
|
+
import { formatSort } from './formatSort.js';
|
|
3
|
+
|
|
4
|
+
test('formatSort', () => {
|
|
5
|
+
expect(
|
|
6
|
+
formatSort([
|
|
7
|
+
{
|
|
8
|
+
field: 'name',
|
|
9
|
+
order: 'asc',
|
|
10
|
+
},
|
|
11
|
+
]),
|
|
12
|
+
).toEqual(['name asc']);
|
|
13
|
+
expect(
|
|
14
|
+
formatSort([
|
|
15
|
+
{
|
|
16
|
+
field: 'age',
|
|
17
|
+
order: 'desc',
|
|
18
|
+
nulls: 'last',
|
|
19
|
+
},
|
|
20
|
+
]),
|
|
21
|
+
).toEqual(['age desc nulls last']);
|
|
22
|
+
expect(
|
|
23
|
+
formatSort([
|
|
24
|
+
{
|
|
25
|
+
field: 'name',
|
|
26
|
+
order: 'asc',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
field: 'age',
|
|
30
|
+
order: 'desc',
|
|
31
|
+
},
|
|
32
|
+
]),
|
|
33
|
+
).toEqual(['name asc', 'age desc']);
|
|
34
34
|
});
|
package/lib/data/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { parseSort } from
|
|
3
|
-
export {
|
|
1
|
+
export { formatSort } from './formatSort.js';
|
|
2
|
+
export { parseSort } from './parseSort.js';
|
|
3
|
+
export { resolvePagination } from './resolvePagination.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/lib/data/maybeNumber.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
export function maybeNumber(v) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
if (v === null || v === undefined) {
|
|
3
|
+
return undefined;
|
|
4
|
+
}
|
|
5
|
+
switch (typeof v) {
|
|
6
|
+
case 'number':
|
|
7
|
+
return v;
|
|
8
|
+
case 'bigint':
|
|
9
|
+
if (v > BigInt(Number.MAX_SAFE_INTEGER) || v < BigInt(Number.MIN_SAFE_INTEGER)) {
|
|
10
|
+
throw new Error(`bigint out of range`);
|
|
11
|
+
}
|
|
12
|
+
return Number(v);
|
|
13
|
+
case 'string':
|
|
14
|
+
v = v.trim();
|
|
15
|
+
if (!v) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const n = Number(v);
|
|
20
|
+
if (Number.isNaN(n)) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
return n;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
//# sourceMappingURL=maybeNumber.js.map
|
|
26
|
+
//# sourceMappingURL=maybeNumber.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/data/maybeNumber.ts"],"sourcesContent":["export type MaybeNumber = number | null | string | undefined | bigint;\n\nexport function maybeNumber(v: MaybeNumber) {\n\tif (v === null || v === undefined) {\n\t\treturn undefined;\n\t}\n\n\tswitch (typeof v) {\n\t\tcase 'number':\n\t\t\treturn v;\n\t\tcase 'bigint':\n\t\t\tif (v > BigInt(Number.MAX_SAFE_INTEGER) || v < BigInt(Number.MIN_SAFE_INTEGER)) {\n\t\t\t\tthrow new Error(`bigint out of range`);\n\t\t\t}\n\t\t\treturn Number(v);\n\t\tcase 'string':\n\t\t\tv = v.trim();\n\t\t\tif (!v) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t}\n\tconst n = Number(v);\n\tif (isNaN(n)) {\n\t\treturn undefined;\n\t}\n\treturn n;\n}\n"],"names":["maybeNumber","v","undefined","BigInt","Number","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","Error","trim","n","isNaN"],"mappings":"AAEA,OAAO,SAASA,YAAYC,CAAc;IACzC,IAAIA,MAAM,QAAQA,MAAMC,WAAW;QAClC,OAAOA;IACR;IAEA,OAAQ,OAAOD;QACd,KAAK;YACJ,OAAOA;QACR,KAAK;YACJ,IAAIA,IAAIE,OAAOC,OAAOC,gBAAgB,KAAKJ,IAAIE,OAAOC,OAAOE,gBAAgB,GAAG;gBAC/E,MAAM,IAAIC,MAAM,CAAC,mBAAmB,CAAC;YACtC;YACA,OAAOH,OAAOH;QACf,KAAK;YACJA,IAAIA,EAAEO,IAAI;YACV,IAAI,CAACP,GAAG;gBACP,OAAOC;YACR;IACF;IACA,MAAMO,IAAIL,OAAOH;IACjB,
|
|
1
|
+
{"version":3,"sources":["../../src/data/maybeNumber.ts"],"sourcesContent":["export type MaybeNumber = number | null | string | undefined | bigint;\n\nexport function maybeNumber(v: MaybeNumber) {\n\tif (v === null || v === undefined) {\n\t\treturn undefined;\n\t}\n\n\tswitch (typeof v) {\n\t\tcase 'number':\n\t\t\treturn v;\n\t\tcase 'bigint':\n\t\t\tif (v > BigInt(Number.MAX_SAFE_INTEGER) || v < BigInt(Number.MIN_SAFE_INTEGER)) {\n\t\t\t\tthrow new Error(`bigint out of range`);\n\t\t\t}\n\t\t\treturn Number(v);\n\t\tcase 'string':\n\t\t\tv = v.trim();\n\t\t\tif (!v) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t}\n\tconst n = Number(v);\n\tif (Number.isNaN(n)) {\n\t\treturn undefined;\n\t}\n\treturn n;\n}\n"],"names":["maybeNumber","v","undefined","BigInt","Number","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","Error","trim","n","isNaN"],"mappings":"AAEA,OAAO,SAASA,YAAYC,CAAc;IACzC,IAAIA,MAAM,QAAQA,MAAMC,WAAW;QAClC,OAAOA;IACR;IAEA,OAAQ,OAAOD;QACd,KAAK;YACJ,OAAOA;QACR,KAAK;YACJ,IAAIA,IAAIE,OAAOC,OAAOC,gBAAgB,KAAKJ,IAAIE,OAAOC,OAAOE,gBAAgB,GAAG;gBAC/E,MAAM,IAAIC,MAAM,CAAC,mBAAmB,CAAC;YACtC;YACA,OAAOH,OAAOH;QACf,KAAK;YACJA,IAAIA,EAAEO,IAAI;YACV,IAAI,CAACP,GAAG;gBACP,OAAOC;YACR;IACF;IACA,MAAMO,IAAIL,OAAOH;IACjB,IAAIG,OAAOM,KAAK,CAACD,IAAI;QACpB,OAAOP;IACR;IACA,OAAOO;AACR"}
|