Skip to content

Commit

Permalink
fix: remove util dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
npenin committed Mar 28, 2024
1 parent da696b4 commit 4c90028
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/chain.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { inspect } from "util";

const oldProxy = Proxy;


export const isProxy = Symbol.for('isProxy')
export const customInspect = Symbol.for('nodejs.util.inspect.custom');

global['Proxy'] = new oldProxy(oldProxy, {
get: function (target, key)
Expand All @@ -28,7 +28,7 @@ export function chain<T extends (...args: unknown[]) => unknown>(target: T, keyH
{
switch (key)
{
case inspect.custom:
case customInspect:
return () => target;
case Symbol.toPrimitive:
return target[Symbol.toPrimitive];
Expand Down Expand Up @@ -67,7 +67,7 @@ export function chain<T extends (...args: unknown[]) => unknown>(target: T, keyH
{
switch (subKey)
{
case inspect.custom:
case customInspect:
return () => target;
case Symbol.toPrimitive:
return target[Symbol.toPrimitive];
Expand Down

0 comments on commit 4c90028

Please sign in to comment.