なんかもうめっちゃ変えた
This commit is contained in:
parent
d9ab03f086
commit
b75184ec8e
946 changed files with 41219 additions and 28839 deletions
|
@ -21,6 +21,9 @@ module.exports = {
|
|||
'allowSingleExtends': true,
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/prefer-nullish-coalescing': [
|
||||
'error',
|
||||
],
|
||||
// window の禁止理由: グローバルスコープと衝突し、予期せぬ結果を招くため
|
||||
// e の禁止理由: error や event など、複数のキーワードの頭文字であり分かりにくいため
|
||||
'id-denylist': ['error', 'window', 'e'],
|
||||
|
|
|
@ -27,7 +27,7 @@ export function createAiScriptEnv(opts) {
|
|||
if (token) utils.assertString(token);
|
||||
apiRequests++;
|
||||
if (apiRequests > 16) return values.NULL;
|
||||
const res = await os.api(ep.value, utils.valToJs(param), token ? token.value : (opts.token || null));
|
||||
const res = await os.api(ep.value, utils.valToJs(param), token ? token.value : (opts.token ?? null));
|
||||
return utils.jsToVal(res);
|
||||
}),
|
||||
'Mk:save': values.FN_NATIVE(([key, value]) => {
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import autobind from 'autobind-decorator';
|
||||
import { Type, envVarsDef, PageVar } from '.';
|
||||
import { Expr, isLiteralValue, Variable } from './expr';
|
||||
import { isLiteralValue } from './expr';
|
||||
import { funcDefs } from './lib';
|
||||
import { envVarsDef } from '.';
|
||||
import type { Type, PageVar } from '.';
|
||||
import type { Expr, Variable } from './expr';
|
||||
|
||||
type TypeError = {
|
||||
arg: number;
|
||||
|
@ -44,14 +46,14 @@ export class HpmlTypeChecker {
|
|||
return {
|
||||
arg: i,
|
||||
expect: generic[arg],
|
||||
actual: type
|
||||
actual: type,
|
||||
};
|
||||
}
|
||||
} else if (type !== arg) {
|
||||
return {
|
||||
arg: i,
|
||||
expect: arg,
|
||||
actual: type
|
||||
actual: type,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +83,7 @@ export class HpmlTypeChecker {
|
|||
}
|
||||
|
||||
if (typeof def.in[slot] === 'number') {
|
||||
return generic[def.in[slot]] || null;
|
||||
return generic[def.in[slot]] ?? null;
|
||||
} else {
|
||||
return def.in[slot];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue