From 56e8f45a898de179eff2d576237bb235b12ba878 Mon Sep 17 00:00:00 2001 From: haoziqaq <357229046@qq.com> Date: Fri, 1 Nov 2024 03:22:08 +0800 Subject: [PATCH] style: fix lint error --- src/collection.ts | 1 + tests/collection.spec.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/collection.ts b/src/collection.ts index c6bd155..4bb69ca 100644 --- a/src/collection.ts +++ b/src/collection.ts @@ -142,6 +142,7 @@ export function cloneDeepWith(value: T, fn: (value: any) => any): T { const result: Record = Object.create(Reflect.getPrototypeOf(value)) cache.set(value, result) + // eslint-disable-next-line no-restricted-syntax for (const key in value) { if (hasOwn(value, key)) { result[key] = baseCloneDeep(value[key], cache) diff --git a/tests/collection.spec.ts b/tests/collection.spec.ts index 55280dc..10420c0 100644 --- a/tests/collection.spec.ts +++ b/tests/collection.spec.ts @@ -132,6 +132,7 @@ describe('cloneDeep', () => { }) it('String', () => { + // eslint-disable-next-line no-new-wrappers const value = new String('abc') const result = cloneDeep(value) @@ -141,6 +142,7 @@ describe('cloneDeep', () => { }) it('Number', () => { + // eslint-disable-next-line no-new-wrappers const value = new Number(1) const result = cloneDeep(value) @@ -150,6 +152,7 @@ describe('cloneDeep', () => { }) it('Boolean', () => { + // eslint-disable-next-line no-new-wrappers const value = new Boolean(true) const result = cloneDeep(value)