style: add missing trailing commas (#9387)
This commit is contained in:
parent
9314ceae36
commit
f1fd1d2585
79 changed files with 320 additions and 320 deletions
|
|
@ -7,15 +7,15 @@ export function byteify(string: string, encoding: 'ascii' | 'base64' | 'hex') {
|
|||
atob(
|
||||
string
|
||||
.replace(/-/g, '+')
|
||||
.replace(/_/g, '/')
|
||||
.replace(/_/g, '/'),
|
||||
),
|
||||
c => c.charCodeAt(0)
|
||||
c => c.charCodeAt(0),
|
||||
);
|
||||
case 'hex':
|
||||
return new Uint8Array(
|
||||
string
|
||||
.match(/.{1,2}/g)
|
||||
.map(byte => parseInt(byte, 16))
|
||||
.map(byte => parseInt(byte, 16)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ export function hexify(buffer: ArrayBuffer) {
|
|||
return Array.from(new Uint8Array(buffer))
|
||||
.reduce(
|
||||
(str, byte) => str + byte.toString(16).padStart(2, '0'),
|
||||
''
|
||||
'',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ export class Autocomplete {
|
|||
}, {
|
||||
done: (res) => {
|
||||
this.complete(res);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
this.suggestion = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export function focusPrev(el: Element | null, self = false, scroll = true) {
|
|||
if (el) {
|
||||
if (el.hasAttribute('tabindex')) {
|
||||
(el as HTMLElement).focus({
|
||||
preventScroll: !scroll
|
||||
preventScroll: !scroll,
|
||||
});
|
||||
} else {
|
||||
focusPrev(el.previousElementSibling, true);
|
||||
|
|
@ -18,7 +18,7 @@ export function focusNext(el: Element | null, self = false, scroll = true) {
|
|||
if (el) {
|
||||
if (el.hasAttribute('tabindex')) {
|
||||
(el as HTMLElement).focus({
|
||||
preventScroll: !scroll
|
||||
preventScroll: !scroll,
|
||||
});
|
||||
} else {
|
||||
focusPrev(el.nextElementSibling, true);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const defaultLocaleStringFormats: {[index: string]: string} = {
|
|||
'hour': 'numeric',
|
||||
'minute': 'numeric',
|
||||
'second': 'numeric',
|
||||
'timeZoneName': 'short'
|
||||
'timeZoneName': 'short',
|
||||
};
|
||||
|
||||
function formatLocaleString(date: Date, format: string): string {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ export async function genSearchQuery(v: any, q: string) {
|
|||
return {
|
||||
query: q.split(' ').filter(x => !x.startsWith('/') && !x.startsWith('@')).join(' '),
|
||||
host: host,
|
||||
userId: userId
|
||||
userId: userId,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@ export function getStaticImageUrl(baseUrl: string): string {
|
|||
const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので
|
||||
return `${instanceUrl}/proxy/${dummy}?${url.query({
|
||||
url: u.href,
|
||||
static: '1'
|
||||
static: '1',
|
||||
})}`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, c
|
|||
const result = {
|
||||
patterns: [],
|
||||
callback,
|
||||
allowRepeat: true
|
||||
allowRepeat: true,
|
||||
} as Action;
|
||||
|
||||
if (patterns.match(/^\(.*\)$/) !== null) {
|
||||
|
|
@ -34,7 +34,7 @@ const parseKeymap = (keymap: Keymap) => Object.entries(keymap).map(([patterns, c
|
|||
which: [],
|
||||
ctrl: false,
|
||||
alt: false,
|
||||
shift: false
|
||||
shift: false,
|
||||
} as Pattern;
|
||||
|
||||
const keys = part.trim().split('+').map(x => x.trim().toLowerCase());
|
||||
|
|
@ -61,7 +61,7 @@ function match(ev: KeyboardEvent, patterns: Action['patterns']): boolean {
|
|||
pattern.ctrl === ev.ctrlKey &&
|
||||
pattern.shift === ev.shiftKey &&
|
||||
pattern.alt === ev.altKey &&
|
||||
!ev.metaKey
|
||||
!ev.metaKey,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export async function lookupUser() {
|
|||
if (_notFound) {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
text: i18n.ts.noSuchUser
|
||||
text: i18n.ts.noSuchUser,
|
||||
});
|
||||
} else {
|
||||
_notFound = true;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export function physics(container: HTMLElement) {
|
|||
height: containerHeight,
|
||||
background: 'transparent', // transparent to hide
|
||||
wireframeBackground: 'transparent', // transparent to hide
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// Disable to hide debug
|
||||
|
|
@ -43,7 +43,7 @@ export function physics(container: HTMLElement) {
|
|||
const ground = Matter.Bodies.rectangle(containerCenterX, containerHeight + (groundThickness / 2), containerWidth, groundThickness, {
|
||||
isStatic: true,
|
||||
restitution: 0.1,
|
||||
friction: 2
|
||||
friction: 2,
|
||||
});
|
||||
|
||||
//const wallRight = Matter.Bodies.rectangle(window.innerWidth+50, window.innerHeight/2, 100, window.innerHeight, wallopts);
|
||||
|
|
@ -68,8 +68,8 @@ export function physics(container: HTMLElement) {
|
|||
top + (objEl.offsetHeight / 2),
|
||||
Math.max(objEl.offsetWidth, objEl.offsetHeight) / 2,
|
||||
{
|
||||
restitution: 0.5
|
||||
}
|
||||
restitution: 0.5,
|
||||
},
|
||||
);
|
||||
} else {
|
||||
const style = window.getComputedStyle(objEl);
|
||||
|
|
@ -80,8 +80,8 @@ export function physics(container: HTMLElement) {
|
|||
objEl.offsetHeight,
|
||||
{
|
||||
chamfer: { radius: parseInt(style.borderRadius || '0', 10) },
|
||||
restitution: 0.5
|
||||
}
|
||||
restitution: 0.5,
|
||||
},
|
||||
);
|
||||
}
|
||||
objEl.id = obj.id.toString();
|
||||
|
|
@ -98,9 +98,9 @@ export function physics(container: HTMLElement) {
|
|||
constraint: {
|
||||
stiffness: 0.1,
|
||||
render: {
|
||||
visible: false
|
||||
}
|
||||
}
|
||||
visible: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Matter.World.add(engine.world, mouseConstraint);
|
||||
|
|
@ -147,6 +147,6 @@ export function physics(container: HTMLElement) {
|
|||
stop = true;
|
||||
Matter.Runner.stop(runner);
|
||||
window.clearInterval(intervalId);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export function pleaseLogin(path?: string) {
|
|||
|
||||
popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {
|
||||
autoSet: true,
|
||||
message: i18n.ts.signinRequired
|
||||
message: i18n.ts.signinRequired,
|
||||
}, {
|
||||
cancelled: () => {
|
||||
if (path) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class ReactionPicker {
|
|||
await popup(defineAsyncComponent(() => import('@/components/MkEmojiPickerDialog.vue')), {
|
||||
src: this.src,
|
||||
asReactionPicker: true,
|
||||
manualShowing: this.manualShowing
|
||||
manualShowing: this.manualShowing,
|
||||
}, {
|
||||
done: reaction => {
|
||||
this.onChosen!(reaction);
|
||||
|
|
@ -26,7 +26,7 @@ class ReactionPicker {
|
|||
closed: () => {
|
||||
this.src.value = null;
|
||||
this.onClosed!();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@ export function showSuspendedDialog() {
|
|||
return os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.yourAccountSuspendedTitle,
|
||||
text: i18n.ts.yourAccountSuspendedDescription
|
||||
text: i18n.ts.yourAccountSuspendedDescription,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ export const convertToMisskeyTheme = (vm: ThemeViewModel, name: string, desc: st
|
|||
|
||||
return {
|
||||
id: uuid(),
|
||||
name, desc, author, props, base
|
||||
name, desc, author, props, base,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ export function useNoteCapture(props: {
|
|||
...choices[choice],
|
||||
votes: choices[choice].votes + 1,
|
||||
...($i && (body.userId === $i.id) ? {
|
||||
isVoted: true
|
||||
} : {})
|
||||
isVoted: true,
|
||||
} : {}),
|
||||
};
|
||||
|
||||
note.value.poll.choices = choices;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue