mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 17:46:28 +08:00
Hello yarn berry
This commit is contained in:
1 parent
04a4306895
commit
782f334a27
62 files changed
+448
-239
No files matched your search
@@ -15,22 +15,22 @@ export function get(key: string): any {
|
||||
|
||||
export function getMany<
|
||||
A extends keyof SystemKeys, B extends keyof SystemKeys,
|
||||
>(keys: [A, B]): [SystemKeys[A], SystemKeys[B]];
|
||||
>(keys: [A, B]): [SystemKeys[A], SystemKeys[B]];
|
||||
export function getMany<
|
||||
A extends keyof SystemKeys, B extends keyof SystemKeys, C extends keyof SystemKeys,
|
||||
>(keys: [A, B, C]): [SystemKeys[A], SystemKeys[B], SystemKeys[C]];
|
||||
>(keys: [A, B, C]): [SystemKeys[A], SystemKeys[B], SystemKeys[C]];
|
||||
export function getMany<
|
||||
A extends keyof SystemKeys, B extends keyof SystemKeys, C extends keyof SystemKeys,
|
||||
D extends keyof SystemKeys,
|
||||
>(keys: [A, B, C, D]): [SystemKeys[A], SystemKeys[B], SystemKeys[C], SystemKeys[D]];
|
||||
>(keys: [A, B, C, D]): [SystemKeys[A], SystemKeys[B], SystemKeys[C], SystemKeys[D]];
|
||||
export function getMany<
|
||||
A extends keyof SystemKeys, B extends keyof SystemKeys, C extends keyof SystemKeys,
|
||||
D extends keyof SystemKeys, E extends keyof SystemKeys,
|
||||
>(keys: [A, B, C, D, E]): [SystemKeys[A], SystemKeys[B], SystemKeys[C], SystemKeys[D], SystemKeys[E]];
|
||||
>(keys: [A, B, C, D, E]): [SystemKeys[A], SystemKeys[B], SystemKeys[C], SystemKeys[D], SystemKeys[E]];
|
||||
export function getMany<
|
||||
A extends keyof SystemKeys, B extends keyof SystemKeys, C extends keyof SystemKeys,
|
||||
D extends keyof SystemKeys, E extends keyof SystemKeys, F extends keyof SystemKeys,
|
||||
>(keys: [A, B, C, D, E, F]): [SystemKeys[A], SystemKeys[B], SystemKeys[C], SystemKeys[D], SystemKeys[E], SystemKeys[F]];
|
||||
>(keys: [A, B, C, D, E, F]): [SystemKeys[A], SystemKeys[B], SystemKeys[C], SystemKeys[D], SystemKeys[E], SystemKeys[F]];
|
||||
export function getMany(keys: (keyof SystemKeys)[]): any[];
|
||||
export function getMany(keys: string[]): any[] {
|
||||
return keys.map((key) => cache[key]);
|
||||
@@ -43,7 +43,7 @@ export async function set(_id: string, value: any, boardcast = true) {
|
||||
const res = await coll.findOneAndUpdate(
|
||||
{ _id },
|
||||
{ $set: { value } },
|
||||
{ upsert: true, returnOriginal: false },
|
||||
{ upsert: true, returnDocument: 'after' },
|
||||
);
|
||||
cache[_id] = res.value.value;
|
||||
return res.value.value;
|
||||
@@ -55,7 +55,7 @@ export async function inc<K extends NumberKeys<SystemKeys>>(_id: K) {
|
||||
// FIXME NumberKeys<>
|
||||
// @ts-ignore
|
||||
{ $inc: { value: 1 } },
|
||||
{ upsert: true, returnOriginal: false },
|
||||
{ upsert: true, returnDocument: 'after' },
|
||||
);
|
||||
cache[_id] = res.value.value;
|
||||
return res.value.value;
|
||||
|
||||
Reference in new issue
Block a user