mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 19:52:51 +00:00
fix: fix isJSFunction lacks the judgment of the old version of the protocol
This commit is contained in:
parent
f25babe728
commit
8c7f57a120
@ -1,4 +1,10 @@
|
||||
|
||||
export function isJSFunction(x: any): boolean {
|
||||
return typeof x === 'object' && x && x.type === 'JSFunction';
|
||||
/**
|
||||
* 内部版本 的 { type: 'JSExpression', source: '', value: '', extType: 'function' } 能力上等同于 JSFunction
|
||||
*/
|
||||
export function isInnerJsFunction(data: any) {
|
||||
return data && data.type === 'JSExpression' && data.extType === 'function';
|
||||
}
|
||||
|
||||
export function isJSFunction(data: any): boolean {
|
||||
return typeof data === 'object' && data && data.type === 'JSFunction' || isInnerJsFunction(data);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user