@@ -11,7 +11,6 @@ import type {
11
11
OwnPropertyKey
12
12
} from '#src/types'
13
13
import cast from './cast'
14
- import clone from './clone'
15
14
import define from './define'
16
15
import descriptor from './descriptor'
17
16
import properties from './properties'
@@ -28,23 +27,22 @@ import reduce from './reduce'
28
27
type AssignCustomizer = Fn < [ any , any , OwnPropertyKey ] >
29
28
30
29
/**
31
- * Assigns own properties of one or more `source` objects to a target object.
30
+ * Assigns all enumerable own properties of one or more `source` objects to a
31
+ * target object.
32
32
*
33
33
* A `customizer` is used to produce assigned values. The initial `base` object
34
34
* **will not** be modified.
35
35
*
36
36
* Source objects are applied from left to right. Subsequent sources overwrite
37
- * property assignments of previous sources.
38
- *
39
- * New properties are *defined* rather than *assigned*. Both enumerable and
40
- * non-enumerable properties will be copied from source objects. Inherited
41
- * properties are not copied.
37
+ * property assignments of previous sources. New properties are *defined* rather
38
+ * than *assigned*.
42
39
*
43
40
* **Note**: The return type may differ from the actual return value when using
44
- * a `customizer`. Additionally, TypeScript does not track inheritance. The
45
- * return type may also differ from the actual return value when source objects
46
- * contain inherited properties (e.g. `Map`, `Set`). In such cases, the return
47
- * type will include more keys than present on the return value.
41
+ * a `customizer`. Additionally, TypeScript does not track enumerability or
42
+ * property inheritance. The return type may also differ from the actual return
43
+ * value when source objects contain non-enumerable or inherited properties
44
+ * (e.g. `Map`, `Set`). In such cases, the return type will include more keys
45
+ * than present on the return value.
48
46
*
49
47
* @see {@linkcode Assign }
50
48
* @see {@linkcode AssignCustomizer }
@@ -71,7 +69,7 @@ const assignWith = <T extends Objectify<any>, U extends readonly ObjectCurly[]>(
71
69
value : customizer ( acc [ key ] , src [ key ] , key )
72
70
} )
73
71
} , acc )
74
- } , cast ( clone ( base ) ) )
72
+ } , cast ( { ... base } ) )
75
73
}
76
74
77
75
export { assignWith as default , type AssignCustomizer }
0 commit comments