mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-11 18:42:56 +00:00
fix: add null protection for LowcodeTypes.shape (#1326)
* fix: add null protection for LowcodeTypes.shape, to solve the error with umijs/max >= 4.0.30
This commit is contained in:
parent
55c3fc9e58
commit
3fa810d8ce
@ -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,
|
||||
|
||||
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user