@@ -11,7 +11,6 @@ import type {
1111 OwnPropertyKey
1212} from '#src/types'
1313import cast from './cast'
14- import clone from './clone'
1514import define from './define'
1615import descriptor from './descriptor'
1716import properties from './properties'
@@ -28,23 +27,22 @@ import reduce from './reduce'
2827type AssignCustomizer = Fn < [ any , any , OwnPropertyKey ] >
2928
3029/**
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.
3232 *
3333 * A `customizer` is used to produce assigned values. The initial `base` object
3434 * **will not** be modified.
3535 *
3636 * 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*.
4239 *
4340 * **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.
4846 *
4947 * @see {@linkcode Assign }
5048 * @see {@linkcode AssignCustomizer }
@@ -71,7 +69,7 @@ const assignWith = <T extends Objectify<any>, U extends readonly ObjectCurly[]>(
7169 value : customizer ( acc [ key ] , src [ key ] , key )
7270 } )
7371 } , acc )
74- } , cast ( clone ( base ) ) )
72+ } , cast ( { ... base } ) )
7573}
7674
7775export { assignWith as default , type AssignCustomizer }
0 commit comments