diff options
| author | Kagami Sascha Rosylight <saschanaz@outlook.com> | 2022-12-22 16:01:59 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-22 16:01:59 +0900 |
| commit | f1fd1d2585bd5230caea4c7b8814c2cf007e57cc (patch) | |
| tree | 212dd8f70312b9237484057deba6bc9611ec44d0 /packages/client/src/scripts/hpml | |
| parent | Improve Dockerfile (#9105) (diff) | |
| download | sharkey-f1fd1d2585bd5230caea4c7b8814c2cf007e57cc.tar.gz sharkey-f1fd1d2585bd5230caea4c7b8814c2cf007e57cc.tar.bz2 sharkey-f1fd1d2585bd5230caea4c7b8814c2cf007e57cc.zip | |
style: add missing trailing commas (#9387)
Diffstat (limited to 'packages/client/src/scripts/hpml')
| -rw-r--r-- | packages/client/src/scripts/hpml/evaluator.ts | 6 | ||||
| -rw-r--r-- | packages/client/src/scripts/hpml/index.ts | 22 |
2 files changed, 14 insertions, 14 deletions
diff --git a/packages/client/src/scripts/hpml/evaluator.ts b/packages/client/src/scripts/hpml/evaluator.ts index 10023edffb..196b3142a1 100644 --- a/packages/client/src/scripts/hpml/evaluator.ts +++ b/packages/client/src/scripts/hpml/evaluator.ts @@ -35,7 +35,7 @@ export class Hpml { if (this.opts.enableAiScript) { this.aiscript = markRaw(new AiScript({ ...createAiScriptEnv({ - storageKey: 'pages:' + this.page.id + storageKey: 'pages:' + this.page.id, }), ...initAiLib(this) }, { in: (q) => { return new Promise(ok => { @@ -75,7 +75,7 @@ export class Hpml { SEED: opts.randomSeed ? opts.randomSeed : '', YMD: `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`, AISCRIPT_DISABLED: !this.opts.enableAiScript, - NULL: null + NULL: null, }; this.eval(); @@ -198,7 +198,7 @@ export class Hpml { slots: expr.value.slots.map(x => x.name), exec: (slotArg: Record<string, any>) => { return this.evaluate(expr.value.expression, scope.createChildScope(slotArg, expr.id)); - } + }, } as Fn; } return; diff --git a/packages/client/src/scripts/hpml/index.ts b/packages/client/src/scripts/hpml/index.ts index 4e5aadfbd3..9a55a5c286 100644 --- a/packages/client/src/scripts/hpml/index.ts +++ b/packages/client/src/scripts/hpml/index.ts @@ -14,22 +14,22 @@ export type Fn = { export type Type = 'string' | 'number' | 'boolean' | 'stringArray' | null; export const literalDefs: Record<string, { out: any; category: string; icon: any; }> = { - text: { out: 'string', category: 'value', icon: 'ti ti-quote', }, - multiLineText: { out: 'string', category: 'value', icon: 'fas fa-align-left', }, - textList: { out: 'stringArray', category: 'value', icon: 'fas fa-list', }, - number: { out: 'number', category: 'value', icon: 'fas fa-sort-numeric-up', }, - ref: { out: null, category: 'value', icon: 'fas fa-magic', }, - aiScriptVar: { out: null, category: 'value', icon: 'fas fa-magic', }, - fn: { out: 'function', category: 'value', icon: 'fas fa-square-root-alt', }, + text: { out: 'string', category: 'value', icon: 'ti ti-quote' }, + multiLineText: { out: 'string', category: 'value', icon: 'fas fa-align-left' }, + textList: { out: 'stringArray', category: 'value', icon: 'fas fa-list' }, + number: { out: 'number', category: 'value', icon: 'fas fa-sort-numeric-up' }, + ref: { out: null, category: 'value', icon: 'fas fa-magic' }, + aiScriptVar: { out: null, category: 'value', icon: 'fas fa-magic' }, + fn: { out: 'function', category: 'value', icon: 'fas fa-square-root-alt' }, }; export const blockDefs = [ ...Object.entries(literalDefs).map(([k, v]) => ({ - type: k, out: v.out, category: v.category, icon: v.icon + type: k, out: v.out, category: v.category, icon: v.icon, })), ...Object.entries(funcDefs).map(([k, v]) => ({ - type: k, out: v.out, category: v.category, icon: v.icon - })) + type: k, out: v.out, category: v.category, icon: v.icon, + })), ]; export type PageVar = { name: string; value: any; type: Type; }; @@ -82,7 +82,7 @@ export class HpmlScope { throw new HpmlError( `No such variable '${name}' in scope '${this.name}'`, { - scope: this.layerdStates + scope: this.layerdStates, }); } } |