refactor(dev-infra): convert nullish coalescing operator to plain javascript (#44968)

low version nodejs doesn't support nullish coalescing operator very well

PR Close #44968
This commit is contained in:
zuckjet 2022-02-04 12:02:58 +08:00 committed by Dylan Hunn
parent 8dd3f82f94
commit 459cbed33b

View file

@ -68,7 +68,8 @@ const captureNgDevPatches = (files, patches) =>
patches.forEach(p => _captureNgDevPatch(p[0], p[1], files));
const _captureNgDevPatch = (search, replace, files) => {
for (const fileName of files) {
const currentPatches = ngDevPatches.get(fileName) ?? [];
const patches = ngDevPatches.get(fileName);
const currentPatches = (patches !== null && patches !== undefined) ? patches : [];
ngDevPatches.set(fileName, [...currentPatches, [search, replace]]);
}
};