Skip to content

Commit a9eec3d

Browse files
chore(lint): Clean up schematics
1 parent 6a5d400 commit a9eec3d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/schematics/ng-add-ssr.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function generateFirebaseJson(
7070
} else if (Array.isArray(firebaseJson.hosting)) {
7171
firebaseJson.hosting.push(newConfig);
7272
} else {
73-
firebaseJson.hosting = [firebaseJson.hosting!, newConfig];
73+
firebaseJson.hosting = [firebaseJson.hosting, newConfig];
7474
}
7575

7676
firebaseJson.functions = generateFunctionsConfig(dist);

src/schematics/utils.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ export function getFirebaseProjectName(
7171
workspaceRoot: string,
7272
target: string
7373
): string | undefined {
74-
const { targets }: FirebaseRc = JSON.parse(
74+
const rc: FirebaseRc = JSON.parse(
7575
readFileSync(join(workspaceRoot, '.firebaserc'), 'UTF-8')
7676
);
77-
const projects = Object.keys(targets!);
77+
const targets = rc.targets || {};
78+
const projects = Object.keys(targets || {});
7879
return projects.find(
79-
project => !!Object.keys(targets![project].hosting).find(t => t === target)
80+
project => !!Object.keys(targets[project].hosting).find(t => t === target)
8081
);
8182
}

0 commit comments

Comments
 (0)