chore: add isFunction utils and improve isObject
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { isDef, isObj } from '.';
|
||||
import { isDef, isObject } from '.';
|
||||
import { ObjectIndex } from './types';
|
||||
|
||||
const { hasOwnProperty } = Object.prototype;
|
||||
@@ -10,11 +10,7 @@ function assignKey(to: ObjectIndex, from: ObjectIndex, key: string) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
!hasOwnProperty.call(to, key) ||
|
||||
!isObj(val) ||
|
||||
typeof val === 'function'
|
||||
) {
|
||||
if (!hasOwnProperty.call(to, key) || !isObject(val)) {
|
||||
to[key] = val;
|
||||
} else {
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
|
||||
Reference in New Issue
Block a user