@ -26,7 +26,7 @@ export class NodeFilesystem implements Filesystem {
|
||||
return entries.filter((entry: any) => entry.stats.isDirectory())
|
||||
.map((entry: any) => path.posix.join(_path, entry.entry))
|
||||
.reduce(
|
||||
async(list: Promise<string[]>, subdir: string) =>
|
||||
async (list: Promise<string[]>, subdir: string) =>
|
||||
(await list).concat(await this.list(subdir)),
|
||||
Promise.resolve(files));
|
||||
}
|
||||
@ -47,5 +47,7 @@ export class NodeFilesystem implements Filesystem {
|
||||
fs.writeFileSync(file, contents);
|
||||
}
|
||||
|
||||
private canonical(_path: string): string { return path.posix.join(this.base, _path); }
|
||||
private canonical(_path: string): string {
|
||||
return path.posix.join(this.base, _path);
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ const configParsed = JSON.parse(fs.readFileSync(config).toString());
|
||||
const filesystem = new NodeFilesystem(distDir);
|
||||
const gen = new Generator(filesystem, baseHref);
|
||||
|
||||
(async() => {
|
||||
(async () => {
|
||||
const control = await gen.process(configParsed);
|
||||
await filesystem.write('/ngsw.json', JSON.stringify(control, null, 2));
|
||||
})();
|
@ -133,7 +133,7 @@ function arrayBufferToWords32(buffer: ArrayBuffer, endian: Endian): number[] {
|
||||
return words32;
|
||||
}
|
||||
|
||||
function byteAt(str: string | Uint8Array, index: number): number {
|
||||
function byteAt(str: string|Uint8Array, index: number): number {
|
||||
if (typeof str === 'string') {
|
||||
return index >= str.length ? 0 : str.charCodeAt(index) & 0xff;
|
||||
} else {
|
||||
@ -141,7 +141,7 @@ function byteAt(str: string | Uint8Array, index: number): number {
|
||||
}
|
||||
}
|
||||
|
||||
function wordAt(str: string | Uint8Array, index: number, endian: Endian): number {
|
||||
function wordAt(str: string|Uint8Array, index: number, endian: Endian): number {
|
||||
let word = 0;
|
||||
if (endian === Endian.Big) {
|
||||
for (let i = 0; i < 4; i++) {
|
||||
|
Reference in New Issue
Block a user