Skip to content

Commit 241a83c

Browse files
committed
format
1 parent d2ee6f5 commit 241a83c

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

src/build.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async function emitDom() {
150150
target.comment = descObject.__comment;
151151
}
152152
}
153-
idl = merge(idl, descriptions, {optional:true});
153+
idl = merge(idl, descriptions, { optional: true });
154154

155155
return idl;
156156
}
@@ -179,7 +179,7 @@ async function emitDom() {
179179
};
180180

181181
for (const w of widlStandardTypes) {
182-
webidl = merge(webidl, w.browser, {shallow: true});
182+
webidl = merge(webidl, w.browser, { shallow: true });
183183
}
184184
for (const w of widlStandardTypes) {
185185
for (const partial of w.partialInterfaces) {
@@ -189,32 +189,32 @@ async function emitDom() {
189189
webidl.mixins!.mixin[partial.name];
190190
if (base) {
191191
if (base.exposed) resolveExposure(partial, base.exposed);
192-
merge(base.constants, partial.constants, {shallow: true});
193-
merge(base.methods, partial.methods, {shallow: true});
194-
merge(base.properties, partial.properties, {shallow: true});
192+
merge(base.constants, partial.constants, { shallow: true });
193+
merge(base.methods, partial.methods, { shallow: true });
194+
merge(base.properties, partial.properties, { shallow: true });
195195
}
196196
}
197197
for (const partial of w.partialMixins) {
198198
const base = webidl.mixins!.mixin[partial.name];
199199
if (base) {
200200
if (base.exposed) resolveExposure(partial, base.exposed);
201-
merge(base.constants, partial.constants, {shallow: true});
202-
merge(base.methods, partial.methods, {shallow: true});
203-
merge(base.properties, partial.properties, {shallow: true});
201+
merge(base.constants, partial.constants, { shallow: true });
202+
merge(base.methods, partial.methods, { shallow: true });
203+
merge(base.properties, partial.properties, { shallow: true });
204204
}
205205
}
206206
for (const partial of w.partialDictionaries) {
207207
const base = webidl.dictionaries!.dictionary[partial.name];
208208
if (base) {
209-
merge(base.members, partial.members, {shallow: true});
209+
merge(base.members, partial.members, { shallow: true });
210210
}
211211
}
212212
for (const partial of w.partialNamespaces) {
213213
const base = webidl.namespaces?.find((n) => n.name === partial.name);
214214
if (base) {
215215
if (base.exposed) resolveExposure(partial, base.exposed);
216-
merge(base.methods, partial.methods, {shallow: true});
217-
merge(base.properties, partial.properties, {shallow: true});
216+
merge(base.methods, partial.methods, { shallow: true });
217+
merge(base.properties, partial.properties, { shallow: true });
218218
}
219219
}
220220
for (const include of w.includes) {

src/build/helpers.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ export function exposesTo(o: { exposed?: string }, target: string[]): boolean {
118118
return o.exposed.split(" ").some((e) => target.includes(e));
119119
}
120120

121-
export function merge<T>(target: T, src: T, { shallow = false, optional = false }: { shallow?: boolean, optional?: boolean } = { }): T {
121+
export function merge<T>(
122+
target: T,
123+
src: T,
124+
{
125+
shallow = false,
126+
optional = false,
127+
}: { shallow?: boolean; optional?: boolean } = {},
128+
): T {
122129
if (typeof target !== "object" || typeof src !== "object") {
123130
return src;
124131
}

0 commit comments

Comments
 (0)