Skip to content

Commit

Permalink
refactor(plugin-history-sync): for -> for of (#340)
Browse files Browse the repository at this point in the history
Co-authored-by: JH.Lee <contact@jins.dev>
  • Loading branch information
tooooo1 and orionmiz authored Jun 8, 2023
1 parent a70df1c commit e143f9a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions extensions/plugin-history-sync/src/historySyncPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,14 @@ export function historySyncPlugin<
const activityNames = Object.keys(options.routes);

if (path) {
for (let i = 0; i < activityNames.length; i += 1) {
const activityName = activityNames[i] as K;
const routes = normalizeRoute(options.routes[activityName]);

for (let j = 0; j < routes.length; j += 1) {
const route = routes[j];
for (const activityName of activityNames) {
const routes = normalizeRoute(options.routes[activityName as K]);

for (const route of routes) {
const template = makeTemplate(route, options.urlPatternOptions);
const activityParams = template.parse(path);
const matched = !!activityParams;

if (matched) {
if (activityParams) {
const activityId = id();

return [
Expand Down

1 comment on commit e143f9a

@vercel
Copy link

@vercel vercel bot commented on e143f9a Jun 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.