修改ensureArray的引入位置

This commit is contained in:
unanmed 2023-06-17 18:02:48 +08:00
parent 6eacff68d3
commit a835e6d4ac
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,6 @@
import axios, { AxiosResponse } from 'axios';
import { Disposable } from '../common/disposable';
import { ensureArray } from '../../plugin/game/utils';
import { ensureArray } from '../../plugin/utils';
import { has } from '../../plugin/utils';
import JSZip from 'jszip';
import { EmitableEvent, EventEmitter } from '../common/eventEmitter';

View File

@ -253,3 +253,8 @@ export async function swapChapter(chapter: number, hard: number) {
core.drawTip('读档成功');
});
}
export function ensureArray<T>(arr: T): T extends any[] ? T : T[] {
// @ts-ignore
return arr instanceof Array ? arr : [arr];
}