Skip to content

Commit

Permalink
remove local variable reference
Browse files Browse the repository at this point in the history
  • Loading branch information
planttheidea committed Sep 29, 2022
1 parent 7f8be45 commit 79fdbb1
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,15 @@ export function createCopier(options: CreateCopierOptions) {
return value;
}

const cache = state.cache;

if (cache.has(value)) {
return cache.get(value);
if (state.cache.has(value)) {
return state.cache.get(value);
}

const prototype = (state.prototype =
value.__proto__ || getPrototypeOf(value));
const Constructor = (state.Constructor =
prototype && prototype.constructor);
state.prototype = value.__proto__ || getPrototypeOf(value);
state.Constructor = state.prototype && state.prototype.constructor;

// plain objects
if (!Constructor || Constructor === Object) {
if (!state.Constructor || state.Constructor === Object) {
return object(value, state);
}

Expand Down

0 comments on commit 79fdbb1

Please sign in to comment.