Skip to content

Commit

Permalink
style: fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Oct 31, 2024
1 parent 8fe1be6 commit 56e8f45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export function cloneDeepWith<T>(value: T, fn: (value: any) => any): T {
const result: Record<string, any> = 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)
Expand Down
3 changes: 3 additions & 0 deletions tests/collection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ describe('cloneDeep', () => {
})

it('String', () => {
// eslint-disable-next-line no-new-wrappers
const value = new String('abc')
const result = cloneDeep(value)

Expand All @@ -141,6 +142,7 @@ describe('cloneDeep', () => {
})

it('Number', () => {
// eslint-disable-next-line no-new-wrappers
const value = new Number(1)
const result = cloneDeep(value)

Expand All @@ -150,6 +152,7 @@ describe('cloneDeep', () => {
})

it('Boolean', () => {
// eslint-disable-next-line no-new-wrappers
const value = new Boolean(true)
const result = cloneDeep(value)

Expand Down

0 comments on commit 56e8f45

Please sign in to comment.