Skip to content

Commit

Permalink
fix: reduce object assign
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinbao1001 committed Oct 16, 2024
1 parent 9999d74 commit 3c25919
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/templates/meta/exports.ts.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { filesMeta, tabsMeta } from '.';
import type { IDemoData, IRouteMeta } from 'dumi/dist/client/theme-api/types';

// Copy from React official demo.
type ReactPromise<T> = Promise<T> & {
status?: 'pending' | 'fulfilled' | 'rejected';
Expand Down Expand Up @@ -105,11 +104,8 @@ export async function getFullDemos() {
// expand context for omit ext
expandDemoContext(demo.context);
});

return {
...total,
...demos,
};
Object.assign(total, demos);
return total;
}, {}),
);
}
Expand Down

0 comments on commit 3c25919

Please sign in to comment.