mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
@@ -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]]);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user