Skip to content

Commit 6429be1

Browse files
committed
fix(router): Remove usage of Object.entries to avoid the need for a polyfill (#40340)
`Object.entries` is not supported in IE11 without a polyfill. The quickest, most straightfoward fix for this is to simply use `Object.keys` instead. We may want to consider including the polyfill in the CLI in the future or just wait until IE11 support is dropped before using `Object.entries`. PR Close #40340
1 parent 48526cc commit 6429be1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/router/src/apply_redirects.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,8 @@ function mergeTrivialChildren(s: UrlSegmentGroup): UrlSegmentGroup {
502502
*/
503503
function squashSegmentGroup(segmentGroup: UrlSegmentGroup): UrlSegmentGroup {
504504
const newChildren = {} as any;
505-
for (const [childOutlet, child] of Object.entries(segmentGroup.children)) {
505+
for (const childOutlet of Object.keys(segmentGroup.children)) {
506+
const child = segmentGroup.children[childOutlet];
506507
const childCandidate = squashSegmentGroup(child);
507508
// don't add empty children
508509
if (childCandidate.segments.length > 0 || childCandidate.hasChildren()) {

0 commit comments

Comments
 (0)