Skip to content

Commit

Permalink
fix: add null protection for LowcodeTypes.shape (#1326)
Browse files Browse the repository at this point in the history
* fix: add null protection for LowcodeTypes.shape, to solve the error with umijs/max >= 4.0.30
  • Loading branch information
AndyJinSS authored Dec 6, 2022
1 parent 55c3fc9 commit 3fa810d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ LowcodeTypes.exact = (typesMap: any) => {
};

// An object taking on a particular shape
LowcodeTypes.shape = (typesMap: any) => {
LowcodeTypes.shape = (typesMap: any = {}) => {
const configs = Object.keys(typesMap).map(key => {
return {
name: key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ describe('parseMetadata', () => {
const md1 = parseMetadata('Div');
const md2 = parseMetadata({ componentName: 'Div' });
});
it('LowcodeTypes.shape', async () => {
const result = (window as any).PropTypes.shape()
expect(result).toBeDefined();
});
});

0 comments on commit 3fa810d

Please sign in to comment.