Skip to content

Commit abc2417

Browse files
committed
Apply prettier.
1 parent 4f6b3e5 commit abc2417

File tree

92 files changed

+780
-766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+780
-766
lines changed

src/BaseContentHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class BaseContentHandler<IUVData>
2323
constructor(
2424
public options: IUVOptions,
2525
public adapter?: UVAdapter,
26-
eventListeners?: EventListener[]
26+
eventListeners?: EventListener[],
2727
) {
2828
this._el = this.options.target;
2929

src/Init.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const init = (el: string | HTMLDivElement, data) => {
5555
function (_obj) {
5656
resize();
5757
},
58-
false
58+
false,
5959
);
6060

6161
uv.on(
@@ -65,7 +65,7 @@ export const init = (el: string | HTMLDivElement, data) => {
6565
resize();
6666
}, 100);
6767
},
68-
false
68+
false,
6969
);
7070

7171
uv.on(
@@ -97,15 +97,15 @@ export const init = (el: string | HTMLDivElement, data) => {
9797
resize();
9898
}, 100);
9999
},
100-
false
100+
false,
101101
);
102102

103103
uv.on(
104104
Events.ERROR,
105105
function (message) {
106106
console.error(message);
107107
},
108-
false
108+
false,
109109
);
110110

111111
function fullScreenChange(e) {

src/UniversalViewer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class UniversalViewer extends BaseContentHandler<IUVData<any>> {
8585
data: data,
8686
},
8787
this.adapter,
88-
this._externalEventListeners
88+
this._externalEventListeners,
8989
); // create content handler
9090
}
9191

src/Utils.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe("Utils", () => {
55
const propChanged: boolean = propertiesChanged(
66
{ manifestIndex: 0 },
77
{ manifestIndex: 1 },
8-
["manifestIndex"]
8+
["manifestIndex"],
99
);
1010
expect(propChanged).toEqual(true);
1111
});

src/Utils.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const debounce = (callback: (args: any) => void, wait: number) => {
3939
export const propertiesChanged = (
4040
newData: IUVData<any>,
4141
currentData: IUVData<any>,
42-
properties: string[]
42+
properties: string[],
4343
): boolean => {
4444
let propChanged: boolean = false;
4545

@@ -56,7 +56,7 @@ export const propertiesChanged = (
5656
export const propertyChanged = (
5757
newData: IUVData<any>,
5858
currentData: IUVData<any>,
59-
propertyName: string
59+
propertyName: string,
6060
): boolean => {
6161
return currentData[propertyName] !== newData[propertyName];
6262
};
@@ -84,15 +84,15 @@ export const loadScripts = async (sources: string[]) => {
8484
await Promise.all(
8585
sources.map(async (src: string) => {
8686
await appendScript(src);
87-
})
87+
}),
8888
);
8989
};
9090

9191
export const loadCSS = async (sources: string[]) => {
9292
await Promise.all(
9393
sources.map(async (src: string) => {
9494
await appendCSS(src);
95-
})
95+
}),
9696
);
9797
};
9898

@@ -127,7 +127,7 @@ export class Storage {
127127
}
128128

129129
public static clearExpired(
130-
storageType: StorageType = StorageType.MEMORY
130+
storageType: StorageType = StorageType.MEMORY,
131131
): void {
132132
const items: StorageItem[] = this.getItems(storageType);
133133

@@ -142,7 +142,7 @@ export class Storage {
142142

143143
public static get(
144144
key: string,
145-
storageType: StorageType = StorageType.MEMORY
145+
storageType: StorageType = StorageType.MEMORY,
146146
): StorageItem | null {
147147
let data: string | null = null;
148148

@@ -187,7 +187,7 @@ export class Storage {
187187
}
188188

189189
public static getItems(
190-
storageType: StorageType = StorageType.MEMORY
190+
storageType: StorageType = StorageType.MEMORY,
191191
): StorageItem[] {
192192
const items: StorageItem[] = [];
193193

@@ -198,7 +198,7 @@ export class Storage {
198198
for (let i = 0; i < keys.length; i++) {
199199
const item: StorageItem | null = this.get(
200200
keys[i],
201-
StorageType.MEMORY
201+
StorageType.MEMORY,
202202
);
203203

204204
if (item) {
@@ -240,7 +240,7 @@ export class Storage {
240240

241241
public static remove(
242242
key: string,
243-
storageType: StorageType = StorageType.MEMORY
243+
storageType: StorageType = StorageType.MEMORY,
244244
) {
245245
switch (storageType) {
246246
case StorageType.MEMORY:
@@ -259,7 +259,7 @@ export class Storage {
259259
key: string,
260260
value: any,
261261
expirationSecs: number,
262-
storageType: StorageType = StorageType.MEMORY
262+
storageType: StorageType = StorageType.MEMORY,
263263
): StorageItem {
264264
const expirationMS: number = expirationSecs * 1000;
265265

src/content-handlers/iiif/BaseConfig.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ export { StorageType } from "@edsilv/utils";
99
export type MetricType = string | "sm" | "md" | "lg" | "xl";
1010

1111
export class Metric {
12-
constructor(public type: MetricType, public minWidth: number) {}
12+
constructor(
13+
public type: MetricType,
14+
public minWidth: number,
15+
) {}
1316
}
1417

1518
export type Options = {

src/content-handlers/iiif/IIIFContentHandler.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default class IIIFContentHandler
111111
constructor(
112112
public options: IUVOptions,
113113
public adapter?: UVAdapter,
114-
eventListeners?: EventListener[]
114+
eventListeners?: EventListener[],
115115
) {
116116
super(options, adapter, eventListeners);
117117
// console.log("create IIIFContentHandler");
@@ -156,7 +156,7 @@ export default class IIIFContentHandler
156156
(_obj) => {
157157
this.hideSpinner();
158158
},
159-
false
159+
false,
160160
);
161161

162162
this.on(
@@ -165,7 +165,7 @@ export default class IIIFContentHandler
165165
data.isReload = true;
166166
this.set(data);
167167
},
168-
false
168+
false,
169169
);
170170

171171
this.extra.initial = true;
@@ -177,7 +177,7 @@ export default class IIIFContentHandler
177177

178178
private async _getExtensionByType(
179179
type: ExtensionLoader,
180-
format?: string
180+
format?: string,
181181
): Promise<any> {
182182
const m = await type.loader();
183183
const extension: IExtension = new m.default();
@@ -211,7 +211,7 @@ export default class IIIFContentHandler
211211
const newData: IUVData<any> = Object.assign(
212212
{},
213213
this.extension.data,
214-
data
214+
data,
215215
);
216216
if (
217217
newData.isReload ||
@@ -269,7 +269,7 @@ export default class IIIFContentHandler
269269
private async _loadAndApplyConfigToExtension(
270270
that: IIIFContentHandler,
271271
data: IUVData<any>,
272-
extension: any
272+
extension: any,
273273
): Promise<void> {
274274
// import the config file
275275
if (!data.locales) {
@@ -278,7 +278,7 @@ export default class IIIFContentHandler
278278
}
279279
let config = await extension.loadConfig(
280280
data.locales[0].name,
281-
extension?.type.name
281+
extension?.type.name,
282282
);
283283

284284
data.config = await that.configure(config);
@@ -391,7 +391,7 @@ export default class IIIFContentHandler
391391
) {
392392
extension = await that._getExtensionByType(
393393
Extension.MEDIAELEMENT,
394-
format
394+
format,
395395
);
396396
await this._loadAndApplyConfigToExtension(that, data, extension);
397397
}
@@ -417,7 +417,7 @@ export default class IIIFContentHandler
417417
private _createExtension(
418418
extension: any,
419419
data: IUVData<any>,
420-
helper: Helper
420+
helper: Helper,
421421
): void {
422422
this.extension = extension;
423423
if (this.extension) {

0 commit comments

Comments
 (0)