Skip to content

Commit 459cbed

Browse files
Zuckjetdylhunn
authored andcommitted
refactor(dev-infra): convert nullish coalescing operator to plain javascript (angular#44968)
low version nodejs doesn't support nullish coalescing operator very well PR Close angular#44968
1 parent 8dd3f82 commit 459cbed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/postinstall-patches.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ const captureNgDevPatches = (files, patches) =>
6868
patches.forEach(p => _captureNgDevPatch(p[0], p[1], files));
6969
const _captureNgDevPatch = (search, replace, files) => {
7070
for (const fileName of files) {
71-
const currentPatches = ngDevPatches.get(fileName) ?? [];
71+
const patches = ngDevPatches.get(fileName);
72+
const currentPatches = (patches !== null && patches !== undefined) ? patches : [];
7273
ngDevPatches.set(fileName, [...currentPatches, [search, replace]]);
7374
}
7475
};

0 commit comments

Comments
 (0)