build: reformat repo to new clang@1.4.0 (#36613)

PR Close #36613
This commit is contained in:
Joey Perrott
2020-04-13 16:40:21 -07:00
committed by atscott
parent 5e80e7e216
commit 698b0288be
1160 changed files with 31667 additions and 24000 deletions

View File

@ -34,17 +34,18 @@ export class Generator {
configVersion: 1,
timestamp: Date.now(),
appData: config.appData,
index: joinUrls(this.baseHref, config.index), assetGroups,
index: joinUrls(this.baseHref, config.index),
assetGroups,
dataGroups: this.processDataGroups(config),
hashTable: withOrderedKeys(unorderedHashTable),
navigationUrls: processNavigationUrls(this.baseHref, config.navigationUrls),
};
}
private async processAssetGroups(config: Config, hashTable: {[file: string]: string | undefined}):
private async processAssetGroups(config: Config, hashTable: {[file: string]: string|undefined}):
Promise<Object[]> {
const seenMap = new Set<string>();
return Promise.all((config.assetGroups || []).map(async(group) => {
return Promise.all((config.assetGroups || []).map(async (group) => {
if ((group.resources as any).versionedFiles) {
throw new Error(
`Asset-group '${group.name}' in 'ngsw-config.json' uses the 'versionedFiles' option, ` +
@ -58,7 +59,7 @@ export class Generator {
matchedFiles.forEach(file => seenMap.add(file));
// Add the hashes.
await matchedFiles.reduce(async(previous, file) => {
await matchedFiles.reduce(async (previous, file) => {
await previous;
const hash = await this.fs.hash(file);
hashTable[joinUrls(this.baseHref, file)] = hash;
@ -143,8 +144,8 @@ function joinUrls(a: string, b: string): string {
return a + b;
}
function withOrderedKeys<T extends{[key: string]: any}>(unorderedObj: T): T {
const orderedObj = {} as{[key: string]: any};
function withOrderedKeys<T extends {[key: string]: any}>(unorderedObj: T): T {
const orderedObj = {} as {[key: string]: any};
Object.keys(unorderedObj).sort().forEach(key => orderedObj[key] = unorderedObj[key]);
return orderedObj as T;
}

View File

@ -29,7 +29,7 @@ export function globToRegex(glob: string, literalQuestionMark = false): string {
const segments = glob.split('/').reverse();
let regex: string = '';
while (segments.length > 0) {
const segment = segments.pop() !;
const segment = segments.pop()!;
if (segment === '**') {
if (segments.length > 0) {
regex += WILD_OPEN;

View File

@ -51,6 +51,8 @@ export interface DataGroup {
urls: Glob[];
version?: number;
cacheConfig: {
maxSize: number; maxAge: Duration; timeout?: Duration; strategy?: 'freshness' | 'performance';
maxSize: number; maxAge: Duration;
timeout?: Duration;
strategy?: 'freshness' | 'performance';
};
}