@@ -35,26 +35,9 @@ export function isDraftable(value: any): boolean {
3535}
3636
3737const objectCtorString = Object . prototype . constructor . toString ( )
38- /*#__PURE__*/
39- export function isPlainObjectOriginal ( value : any ) : boolean {
40- if ( ! value || typeof value !== "object" ) return false
41- const proto = getPrototypeOf ( value )
42- if ( proto === null ) {
43- return true
44- }
45- const Ctor =
46- Object . hasOwnProperty . call ( proto , "constructor" ) && proto . constructor
47-
48- if ( Ctor === Object ) return true
49-
50- return (
51- typeof Ctor == "function" &&
52- Function . toString . call ( Ctor ) === objectCtorString
53- )
54- }
55-
5638const cachedCtorStrings = new WeakMap ( )
57- function isPlainObjectCached ( value : any ) {
39+ /*#__PURE__*/
40+ export function isPlainObject ( value : any ) : boolean {
5841 if ( ! value || typeof value !== "object" ) return false
5942 const proto = Object . getPrototypeOf ( value )
6043 if ( proto === null || proto === Object . prototype ) return true
@@ -74,8 +57,6 @@ function isPlainObjectCached(value: any) {
7457 return ctorString === objectCtorString
7558}
7659
77- export const isPlainObject = isPlainObjectCached
78-
7960/** Get the underlying object that is represented by the given draft */
8061/*#__PURE__*/
8162export function original < T > ( value : T ) : T | undefined
@@ -91,7 +72,7 @@ export function original(value: Drafted<any>): any {
9172 * @param obj The object to iterate over
9273 * @param iter The iterator function
9374 * @param strict When true (default), includes symbols and non-enumerable properties.
94- * When false, uses ultra-fast iteration over only enumerable string properties.
75+ * When false, uses looseiteration over only enumerable string properties.
9576 */
9677export function each < T extends Objectish > (
9778 obj : T ,
0 commit comments