[improvement] unify mixin name (#2795)

This commit is contained in:
neverland
2019-02-19 16:04:29 +08:00
committed by GitHub
parent 8c6ab91f6d
commit 9d0255d9e1
49 changed files with 112 additions and 122 deletions

View File

@@ -17,11 +17,11 @@ function assignKey(to: Object, from: Object, key: string) {
if (!hasOwnProperty.call(to, key) || !isObj(val)) {
to[key] = val;
} else {
to[key] = assign(Object(to[key]), from[key]);
to[key] = deepAssign(Object(to[key]), from[key]);
}
}
export default function assign(to: Object, from: Object) {
export function deepAssign(to: Object, from: Object) {
Object.keys(from).forEach(key => {
assignKey(to, from, key);
});