mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-14 13:03:07 +00:00
23 lines
469 B
TypeScript
23 lines
469 B
TypeScript
const excludePropertyNames = [
|
|
'$$typeof',
|
|
'render',
|
|
'defaultProps',
|
|
'props',
|
|
'length',
|
|
'prototype',
|
|
'name',
|
|
'caller',
|
|
'callee',
|
|
'arguments',
|
|
];
|
|
|
|
export function cloneEnumerableProperty(target: any, origin: any, excludes = excludePropertyNames) {
|
|
const compExtraPropertyNames = Object.keys(origin).filter(d => !excludes.includes(d));
|
|
|
|
compExtraPropertyNames.forEach((d: string) => {
|
|
(target as any)[d] = origin[d];
|
|
});
|
|
|
|
return target;
|
|
}
|