From b2b222bcd9494577ad37aac7e20b62feade259b6 Mon Sep 17 00:00:00 2001 From: David Chambers Date: Wed, 16 Jun 2021 15:39:35 +0200 Subject: [PATCH] support Deno.inspect --- .eslintrc.json | 1 + index.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.eslintrc.json b/.eslintrc.json index 063ea8c..efe14af 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -36,6 +36,7 @@ }, { "files": ["index.js"], + "globals": {"Deno": false}, "rules": { "multiline-comment-style": ["off"] } diff --git a/index.js b/index.js index aa9cbd2..08d695f 100644 --- a/index.js +++ b/index.js @@ -2781,6 +2781,12 @@ wrapNext ({}, [], 0); wrapped[inspect] = wrapped.toString = always0 (typeSignature (typeInfo)); + /* istanbul ignore if */ + if (typeof Deno !== 'undefined') { + if (Deno != null && typeof Deno.customInspect === 'symbol') { + wrapped[Deno.customInspect] = wrapped.toString; + } + } return wrapped; }