fix: make isJSExpression more robust

This commit is contained in:
LeoYuan 袁力皓 2022-11-24 19:24:59 +08:00 committed by 刘菊萍(絮黎)
parent 43b2175792
commit 01ce70c06c

View File

@ -128,8 +128,18 @@ export interface CompositeObject {
[key: string]: CompositeValue;
}
/**
* { type: 'JSExpression', extType: 'function' }
*
*
* { type: 'JSFunction', source: '', value: '' }
* { type: 'JSExpression', source: '', value: '', extType: 'function' }
* react-renderer Java RE
* @param data
* @returns
*/
export function isJSExpression(data: any): data is JSExpression {
return data && data.type === 'JSExpression';
return data && data.type === 'JSExpression' && data.extType !== 'function';
}
export function isJSFunction(x: any): x is JSFunction {