@forklaunch/core 0.7.3 → 0.8.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/lib/__test__/index.d.mts +7 -1
- package/lib/__test__/index.d.ts +7 -1
- package/lib/__test__/index.js +3 -5
- package/lib/__test__/index.js.map +1 -1
- package/lib/__test__/index.mjs +4 -6
- package/lib/__test__/index.mjs.map +1 -1
- package/lib/src/cache/index.js +30 -20
- package/lib/src/cache/index.js.map +1 -1
- package/lib/src/cache/index.mjs +37 -20
- package/lib/src/cache/index.mjs.map +1 -1
- package/lib/src/http/index.d.mts +201 -43
- package/lib/src/http/index.d.ts +201 -43
- package/lib/src/http/index.js +321 -37
- package/lib/src/http/index.js.map +1 -1
- package/lib/src/http/index.mjs +326 -37
- package/lib/src/http/index.mjs.map +1 -1
- package/lib/src/services/index.js +7 -1
- package/lib/src/services/index.js.map +1 -1
- package/lib/src/services/index.mjs +7 -1
- package/lib/src/services/index.mjs.map +1 -1
- package/package.json +31 -31
package/lib/__test__/index.d.mts
CHANGED
@@ -2,7 +2,13 @@ import { IdiomaticSchema, Schema } from '@forklaunch/validator';
|
|
2
2
|
import { TypeboxSchemaValidator } from '@forklaunch/validator/typebox';
|
3
3
|
import { ZodSchemaValidator } from '@forklaunch/validator/zod';
|
4
4
|
|
5
|
-
declare function testSchemaEquality<Z extends IdiomaticSchema<ZodSchemaValidator>, T extends IdiomaticSchema<TypeboxSchemaValidator>>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>):
|
5
|
+
declare function testSchemaEquality<Z extends IdiomaticSchema<ZodSchemaValidator>, T extends IdiomaticSchema<TypeboxSchemaValidator>>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>): EqualityWithoutFunction<T, Z>;
|
6
|
+
type InjectiveWithoutFunction<O, T> = {
|
7
|
+
[K in keyof O]: K extends keyof T ? O[K] extends object ? T[K] extends object ? InjectiveWithoutFunction<O[K], T[K]> : false : O[K] extends (...args: never[]) => unknown ? T[K] extends (...args: never[]) => unknown ? true : false : O[K] extends T[K] ? T[K] extends O[K] ? true : false : false : false;
|
8
|
+
} extends infer R ? R extends {
|
9
|
+
[K in keyof R]: true;
|
10
|
+
} ? true : false : false;
|
11
|
+
type EqualityWithoutFunction<T extends IdiomaticSchema<TypeboxSchemaValidator>, Z extends IdiomaticSchema<ZodSchemaValidator>> = Schema<T, TypeboxSchemaValidator> extends infer TypeboxSchema ? Schema<Z, ZodSchemaValidator> extends infer ZodSchema ? InjectiveWithoutFunction<TypeboxSchema, ZodSchema> extends InjectiveWithoutFunction<ZodSchema, TypeboxSchema> ? true : false : false : false;
|
6
12
|
declare enum DummyEnum {
|
7
13
|
A = "A",
|
8
14
|
B = "B"
|
package/lib/__test__/index.d.ts
CHANGED
@@ -2,7 +2,13 @@ import { IdiomaticSchema, Schema } from '@forklaunch/validator';
|
|
2
2
|
import { TypeboxSchemaValidator } from '@forklaunch/validator/typebox';
|
3
3
|
import { ZodSchemaValidator } from '@forklaunch/validator/zod';
|
4
4
|
|
5
|
-
declare function testSchemaEquality<Z extends IdiomaticSchema<ZodSchemaValidator>, T extends IdiomaticSchema<TypeboxSchemaValidator>>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>):
|
5
|
+
declare function testSchemaEquality<Z extends IdiomaticSchema<ZodSchemaValidator>, T extends IdiomaticSchema<TypeboxSchemaValidator>>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>): EqualityWithoutFunction<T, Z>;
|
6
|
+
type InjectiveWithoutFunction<O, T> = {
|
7
|
+
[K in keyof O]: K extends keyof T ? O[K] extends object ? T[K] extends object ? InjectiveWithoutFunction<O[K], T[K]> : false : O[K] extends (...args: never[]) => unknown ? T[K] extends (...args: never[]) => unknown ? true : false : O[K] extends T[K] ? T[K] extends O[K] ? true : false : false : false;
|
8
|
+
} extends infer R ? R extends {
|
9
|
+
[K in keyof R]: true;
|
10
|
+
} ? true : false : false;
|
11
|
+
type EqualityWithoutFunction<T extends IdiomaticSchema<TypeboxSchemaValidator>, Z extends IdiomaticSchema<ZodSchemaValidator>> = Schema<T, TypeboxSchemaValidator> extends infer TypeboxSchema ? Schema<Z, ZodSchemaValidator> extends infer ZodSchema ? InjectiveWithoutFunction<TypeboxSchema, ZodSchema> extends InjectiveWithoutFunction<ZodSchema, TypeboxSchema> ? true : false : false : false;
|
6
12
|
declare enum DummyEnum {
|
7
13
|
A = "A",
|
8
14
|
B = "B"
|
package/lib/__test__/index.js
CHANGED
@@ -32,11 +32,9 @@ var import_zod = require("@forklaunch/validator/zod");
|
|
32
32
|
function testSchemaEquality(zodSchema, typeBoxSchema, testData) {
|
33
33
|
const zodParseResult = (0, import_zod.parse)(zodSchema, testData);
|
34
34
|
const typeboxParseResult = (0, import_typebox.parse)(typeBoxSchema, testData);
|
35
|
-
const isEqual =
|
36
|
-
zodParseResult.ok ? (0, import_common.sortObjectKeys)(
|
37
|
-
|
38
|
-
) : "-1"
|
39
|
-
) === JSON.stringify(
|
35
|
+
const isEqual = (0, import_common.safeStringify)(
|
36
|
+
zodParseResult.ok ? (0, import_common.sortObjectKeys)(zodParseResult.value) : "-1"
|
37
|
+
) === (0, import_common.safeStringify)(
|
40
38
|
typeboxParseResult.ok ? (0, import_common.sortObjectKeys)(typeboxParseResult.value) : "1"
|
41
39
|
);
|
42
40
|
return isEqual;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../__test__/index.ts","../../__test__/utils/schemaEquality.ts"],"sourcesContent":["export * from './utils/schemaEquality';\n","import { sortObjectKeys } from '@forklaunch/common';\nimport { IdiomaticSchema } from '@forklaunch/validator';\n\nimport { Schema } from '@forklaunch/validator';\nimport {\n TypeboxSchemaValidator,\n parse as typeboxParse\n} from '@forklaunch/validator/typebox';\nimport {\n ZodSchemaValidator,\n parse as zodParse\n} from '@forklaunch/validator/zod';\n\nexport function testSchemaEquality<\n Z extends IdiomaticSchema<ZodSchemaValidator>,\n T extends IdiomaticSchema<TypeboxSchemaValidator>\n>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>) {\n const zodParseResult = zodParse(zodSchema, testData);\n const typeboxParseResult = typeboxParse(typeBoxSchema, testData);\n\n const isEqual =\n
|
1
|
+
{"version":3,"sources":["../../__test__/index.ts","../../__test__/utils/schemaEquality.ts"],"sourcesContent":["export * from './utils/schemaEquality';\n","import { safeStringify, sortObjectKeys } from '@forklaunch/common';\nimport { IdiomaticSchema } from '@forklaunch/validator';\n\nimport { Schema } from '@forklaunch/validator';\nimport {\n TypeboxSchemaValidator,\n parse as typeboxParse\n} from '@forklaunch/validator/typebox';\nimport {\n ZodSchemaValidator,\n parse as zodParse\n} from '@forklaunch/validator/zod';\n\nexport function testSchemaEquality<\n Z extends IdiomaticSchema<ZodSchemaValidator>,\n T extends IdiomaticSchema<TypeboxSchemaValidator>\n>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>) {\n const zodParseResult = zodParse(zodSchema, testData);\n const typeboxParseResult = typeboxParse(typeBoxSchema, testData);\n\n const isEqual =\n safeStringify(\n zodParseResult.ok ? sortObjectKeys(zodParseResult.value) : '-1'\n ) ===\n safeStringify(\n typeboxParseResult.ok\n ? sortObjectKeys(typeboxParseResult.value as Record<string, unknown>)\n : '1'\n );\n\n return isEqual as EqualityWithoutFunction<T, Z>;\n}\n\ntype InjectiveWithoutFunction<O, T> = {\n [K in keyof O]: K extends keyof T\n ? O[K] extends object\n ? T[K] extends object\n ? InjectiveWithoutFunction<O[K], T[K]>\n : false\n : O[K] extends (...args: never[]) => unknown\n ? T[K] extends (...args: never[]) => unknown\n ? true\n : false\n : O[K] extends T[K]\n ? T[K] extends O[K]\n ? true\n : false\n : false\n : false;\n} extends infer R\n ? R extends {\n [K in keyof R]: true;\n }\n ? true\n : false\n : false;\n\ntype EqualityWithoutFunction<\n T extends IdiomaticSchema<TypeboxSchemaValidator>,\n Z extends IdiomaticSchema<ZodSchemaValidator>\n> =\n Schema<T, TypeboxSchemaValidator> extends infer TypeboxSchema\n ? Schema<Z, ZodSchemaValidator> extends infer ZodSchema\n ? InjectiveWithoutFunction<\n TypeboxSchema,\n ZodSchema\n > extends InjectiveWithoutFunction<ZodSchema, TypeboxSchema>\n ? true\n : false\n : false\n : false;\n\nexport enum DummyEnum {\n A = 'A',\n B = 'B'\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBAA8C;AAI9C,qBAGO;AACP,iBAGO;AAEA,SAAS,mBAGd,WAAc,eAAkB,UAAyC;AACzE,QAAM,qBAAiB,WAAAA,OAAS,WAAW,QAAQ;AACnD,QAAM,yBAAqB,eAAAC,OAAa,eAAe,QAAQ;AAE/D,QAAM,cACJ;AAAA,IACE,eAAe,SAAK,8BAAe,eAAe,KAAK,IAAI;AAAA,EAC7D,UACA;AAAA,IACE,mBAAmB,SACf,8BAAe,mBAAmB,KAAgC,IAClE;AAAA,EACN;AAEF,SAAO;AACT;AAyCO,IAAK,YAAL,kBAAKC,eAAL;AACL,EAAAA,WAAA,OAAI;AACJ,EAAAA,WAAA,OAAI;AAFM,SAAAA;AAAA,GAAA;","names":["zodParse","typeboxParse","DummyEnum"]}
|
package/lib/__test__/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
// __test__/utils/schemaEquality.ts
|
2
|
-
import { sortObjectKeys } from "@forklaunch/common";
|
2
|
+
import { safeStringify, sortObjectKeys } from "@forklaunch/common";
|
3
3
|
import {
|
4
4
|
parse as typeboxParse
|
5
5
|
} from "@forklaunch/validator/typebox";
|
@@ -9,11 +9,9 @@ import {
|
|
9
9
|
function testSchemaEquality(zodSchema, typeBoxSchema, testData) {
|
10
10
|
const zodParseResult = zodParse(zodSchema, testData);
|
11
11
|
const typeboxParseResult = typeboxParse(typeBoxSchema, testData);
|
12
|
-
const isEqual =
|
13
|
-
zodParseResult.ok ? sortObjectKeys(
|
14
|
-
|
15
|
-
) : "-1"
|
16
|
-
) === JSON.stringify(
|
12
|
+
const isEqual = safeStringify(
|
13
|
+
zodParseResult.ok ? sortObjectKeys(zodParseResult.value) : "-1"
|
14
|
+
) === safeStringify(
|
17
15
|
typeboxParseResult.ok ? sortObjectKeys(typeboxParseResult.value) : "1"
|
18
16
|
);
|
19
17
|
return isEqual;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../__test__/utils/schemaEquality.ts"],"sourcesContent":["import { sortObjectKeys } from '@forklaunch/common';\nimport { IdiomaticSchema } from '@forklaunch/validator';\n\nimport { Schema } from '@forklaunch/validator';\nimport {\n TypeboxSchemaValidator,\n parse as typeboxParse\n} from '@forklaunch/validator/typebox';\nimport {\n ZodSchemaValidator,\n parse as zodParse\n} from '@forklaunch/validator/zod';\n\nexport function testSchemaEquality<\n Z extends IdiomaticSchema<ZodSchemaValidator>,\n T extends IdiomaticSchema<TypeboxSchemaValidator>\n>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>) {\n const zodParseResult = zodParse(zodSchema, testData);\n const typeboxParseResult = typeboxParse(typeBoxSchema, testData);\n\n const isEqual =\n
|
1
|
+
{"version":3,"sources":["../../__test__/utils/schemaEquality.ts"],"sourcesContent":["import { safeStringify, sortObjectKeys } from '@forklaunch/common';\nimport { IdiomaticSchema } from '@forklaunch/validator';\n\nimport { Schema } from '@forklaunch/validator';\nimport {\n TypeboxSchemaValidator,\n parse as typeboxParse\n} from '@forklaunch/validator/typebox';\nimport {\n ZodSchemaValidator,\n parse as zodParse\n} from '@forklaunch/validator/zod';\n\nexport function testSchemaEquality<\n Z extends IdiomaticSchema<ZodSchemaValidator>,\n T extends IdiomaticSchema<TypeboxSchemaValidator>\n>(zodSchema: Z, typeBoxSchema: T, testData: Schema<Z, ZodSchemaValidator>) {\n const zodParseResult = zodParse(zodSchema, testData);\n const typeboxParseResult = typeboxParse(typeBoxSchema, testData);\n\n const isEqual =\n safeStringify(\n zodParseResult.ok ? sortObjectKeys(zodParseResult.value) : '-1'\n ) ===\n safeStringify(\n typeboxParseResult.ok\n ? sortObjectKeys(typeboxParseResult.value as Record<string, unknown>)\n : '1'\n );\n\n return isEqual as EqualityWithoutFunction<T, Z>;\n}\n\ntype InjectiveWithoutFunction<O, T> = {\n [K in keyof O]: K extends keyof T\n ? O[K] extends object\n ? T[K] extends object\n ? InjectiveWithoutFunction<O[K], T[K]>\n : false\n : O[K] extends (...args: never[]) => unknown\n ? T[K] extends (...args: never[]) => unknown\n ? true\n : false\n : O[K] extends T[K]\n ? T[K] extends O[K]\n ? true\n : false\n : false\n : false;\n} extends infer R\n ? R extends {\n [K in keyof R]: true;\n }\n ? true\n : false\n : false;\n\ntype EqualityWithoutFunction<\n T extends IdiomaticSchema<TypeboxSchemaValidator>,\n Z extends IdiomaticSchema<ZodSchemaValidator>\n> =\n Schema<T, TypeboxSchemaValidator> extends infer TypeboxSchema\n ? Schema<Z, ZodSchemaValidator> extends infer ZodSchema\n ? InjectiveWithoutFunction<\n TypeboxSchema,\n ZodSchema\n > extends InjectiveWithoutFunction<ZodSchema, TypeboxSchema>\n ? true\n : false\n : false\n : false;\n\nexport enum DummyEnum {\n A = 'A',\n B = 'B'\n}\n"],"mappings":";AAAA,SAAS,eAAe,sBAAsB;AAI9C;AAAA,EAEE,SAAS;AAAA,OACJ;AACP;AAAA,EAEE,SAAS;AAAA,OACJ;AAEA,SAAS,mBAGd,WAAc,eAAkB,UAAyC;AACzE,QAAM,iBAAiB,SAAS,WAAW,QAAQ;AACnD,QAAM,qBAAqB,aAAa,eAAe,QAAQ;AAE/D,QAAM,UACJ;AAAA,IACE,eAAe,KAAK,eAAe,eAAe,KAAK,IAAI;AAAA,EAC7D,MACA;AAAA,IACE,mBAAmB,KACf,eAAe,mBAAmB,KAAgC,IAClE;AAAA,EACN;AAEF,SAAO;AACT;AAyCO,IAAK,YAAL,kBAAKA,eAAL;AACL,EAAAA,WAAA,OAAI;AACJ,EAAAA,WAAA,OAAI;AAFM,SAAAA;AAAA,GAAA;","names":["DummyEnum"]}
|
package/lib/src/cache/index.js
CHANGED
@@ -41,6 +41,7 @@ var createCacheKey = (cacheKeyPrefix) => (id) => {
|
|
41
41
|
};
|
42
42
|
|
43
43
|
// src/cache/redisTtlCache.ts
|
44
|
+
var import_common5 = require("@forklaunch/common");
|
44
45
|
var import_redis = require("redis");
|
45
46
|
|
46
47
|
// src/http/middleware/request/cors.middleware.ts
|
@@ -145,6 +146,9 @@ var import_validator = require("@forklaunch/validator");
|
|
145
146
|
// src/http/middleware/response/parse.middleware.ts
|
146
147
|
var import_validator2 = require("@forklaunch/validator");
|
147
148
|
|
149
|
+
// src/http/middleware/response/enrichExpressLikeSend.middleware.ts
|
150
|
+
var import_common4 = require("@forklaunch/common");
|
151
|
+
|
148
152
|
// src/http/telemetry/recordMetric.ts
|
149
153
|
var import_semantic_conventions3 = require("@opentelemetry/semantic-conventions");
|
150
154
|
|
@@ -211,7 +215,7 @@ var RedisTtlCache = class {
|
|
211
215
|
switch (typeof value) {
|
212
216
|
case "object":
|
213
217
|
case "string":
|
214
|
-
return
|
218
|
+
return (0, import_common5.safeParse)(value);
|
215
219
|
case "number":
|
216
220
|
return value;
|
217
221
|
}
|
@@ -234,7 +238,7 @@ var RedisTtlCache = class {
|
|
234
238
|
if (this.telemetryOptions.enabled.logging) {
|
235
239
|
this.openTelemetryCollector.info(`Putting record into cache: ${key}`);
|
236
240
|
}
|
237
|
-
await this.client.set(key,
|
241
|
+
await this.client.set(key, (0, import_common5.safeStringify)(value), {
|
238
242
|
PX: ttlMilliseconds
|
239
243
|
});
|
240
244
|
}
|
@@ -246,9 +250,9 @@ var RedisTtlCache = class {
|
|
246
250
|
* @returns {Promise<void>} A promise that resolves when all values are cached
|
247
251
|
*/
|
248
252
|
async putBatchRecords(cacheRecords) {
|
249
|
-
|
253
|
+
const multiCommand = this.client.multi();
|
250
254
|
for (const { key, value, ttlMilliseconds } of cacheRecords) {
|
251
|
-
multiCommand
|
255
|
+
multiCommand.set(key, (0, import_common5.safeStringify)(value), {
|
252
256
|
PX: ttlMilliseconds || this.ttlMilliseconds
|
253
257
|
});
|
254
258
|
}
|
@@ -263,7 +267,7 @@ var RedisTtlCache = class {
|
|
263
267
|
* @returns {Promise<void>} A promise that resolves when the value is enqueued
|
264
268
|
*/
|
265
269
|
async enqueueRecord(queueName, value) {
|
266
|
-
await this.client.lPush(queueName,
|
270
|
+
await this.client.lPush(queueName, (0, import_common5.safeStringify)(value));
|
267
271
|
}
|
268
272
|
/**
|
269
273
|
* Adds multiple values to the left end of a Redis list in a single transaction.
|
@@ -274,9 +278,9 @@ var RedisTtlCache = class {
|
|
274
278
|
* @returns {Promise<void>} A promise that resolves when all values are enqueued
|
275
279
|
*/
|
276
280
|
async enqueueBatchRecords(queueName, values) {
|
277
|
-
|
281
|
+
const multiCommand = this.client.multi();
|
278
282
|
for (const value of values) {
|
279
|
-
multiCommand
|
283
|
+
multiCommand.lPush(queueName, (0, import_common5.safeStringify)(value));
|
280
284
|
}
|
281
285
|
await multiCommand.exec();
|
282
286
|
}
|
@@ -296,9 +300,9 @@ var RedisTtlCache = class {
|
|
296
300
|
* @returns {Promise<void>} A promise that resolves when all records are deleted
|
297
301
|
*/
|
298
302
|
async deleteBatchRecords(cacheRecordKeys) {
|
299
|
-
|
303
|
+
const multiCommand = this.client.multi();
|
300
304
|
for (const key of cacheRecordKeys) {
|
301
|
-
multiCommand
|
305
|
+
multiCommand.del(key);
|
302
306
|
}
|
303
307
|
await multiCommand.exec();
|
304
308
|
}
|
@@ -315,7 +319,7 @@ var RedisTtlCache = class {
|
|
315
319
|
if (value === null) {
|
316
320
|
throw new Error(`Queue is empty: ${queueName}`);
|
317
321
|
}
|
318
|
-
return
|
322
|
+
return (0, import_common5.safeParse)(value);
|
319
323
|
}
|
320
324
|
/**
|
321
325
|
* Removes and returns multiple elements from the right end of a Redis list.
|
@@ -326,12 +330,14 @@ var RedisTtlCache = class {
|
|
326
330
|
* @returns {Promise<T[]>} A promise that resolves with an array of dequeued values
|
327
331
|
*/
|
328
332
|
async dequeueBatchRecords(queueName, pageSize) {
|
329
|
-
|
333
|
+
const multiCommand = this.client.multi();
|
330
334
|
for (let i = 0; i < pageSize; i++) {
|
331
|
-
multiCommand
|
335
|
+
multiCommand.rPop(queueName);
|
332
336
|
}
|
333
337
|
const values = await multiCommand.exec();
|
334
|
-
return values.map(
|
338
|
+
return values.map(
|
339
|
+
(value) => this.parseValue(value)
|
340
|
+
).filter(Boolean);
|
335
341
|
}
|
336
342
|
/**
|
337
343
|
* Reads a record from the Redis cache.
|
@@ -361,16 +367,20 @@ var RedisTtlCache = class {
|
|
361
367
|
*/
|
362
368
|
async readBatchRecords(cacheRecordKeysOrPrefix) {
|
363
369
|
const keys = Array.isArray(cacheRecordKeysOrPrefix) ? cacheRecordKeysOrPrefix : await this.client.keys(cacheRecordKeysOrPrefix + "*");
|
364
|
-
|
370
|
+
const multiCommand = this.client.multi();
|
365
371
|
for (const key of keys) {
|
366
|
-
multiCommand
|
367
|
-
multiCommand
|
372
|
+
multiCommand.get(key);
|
373
|
+
multiCommand.ttl(key);
|
368
374
|
}
|
369
375
|
const values = await multiCommand.exec();
|
370
376
|
return values.reduce((acc, value, index) => {
|
371
377
|
if (index % 2 === 0) {
|
372
|
-
const maybeValue = this.parseValue(
|
373
|
-
|
378
|
+
const maybeValue = this.parseValue(
|
379
|
+
value
|
380
|
+
);
|
381
|
+
const ttl = this.parseValue(
|
382
|
+
values[index + 1]
|
383
|
+
);
|
374
384
|
if (maybeValue && ttl) {
|
375
385
|
acc.push({
|
376
386
|
key: keys[index / 2],
|
@@ -410,9 +420,9 @@ var RedisTtlCache = class {
|
|
410
420
|
*/
|
411
421
|
async peekBatchRecords(cacheRecordKeysOrPrefix) {
|
412
422
|
const keys = Array.isArray(cacheRecordKeysOrPrefix) ? cacheRecordKeysOrPrefix : await this.client.keys(cacheRecordKeysOrPrefix + "*");
|
413
|
-
|
423
|
+
const multiCommand = this.client.multi();
|
414
424
|
for (const key of keys) {
|
415
|
-
multiCommand
|
425
|
+
multiCommand.exists(key);
|
416
426
|
}
|
417
427
|
const results = await multiCommand.exec();
|
418
428
|
return results.map((result) => result === 1);
|