From 19a450b6cbb7171f3eec09ac8d789def3a11c03a Mon Sep 17 00:00:00 2001 From: Lukas Tetzlaff Date: Tue, 31 Oct 2017 16:52:51 -0700 Subject: [PATCH] Remove destructuring for Node 4 to work --- index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index 7fb3046..f9168d6 100644 --- a/index.ts +++ b/index.ts @@ -1,4 +1,4 @@ -const {inspect} = require('util'); +const util = require('util'); //const toString = Object.prototype.toString; const getObjectType = (x: any) => toString.call(x).slice(8, -1) as string; @@ -171,7 +171,7 @@ namespace is { return x >= Math.min.apply(null, range) && x <= Math.max.apply(null, range); } - throw new TypeError(`Invalid range: ${inspect(range)}`); + throw new TypeError(`Invalid range: ${util.inspect(range)}`); }; const NODE_TYPE_ELEMENT = 1; @@ -208,7 +208,7 @@ namespace is { values = Array.prototype.slice.call(values, 1); if (is.func(predicate) === false) { - throw new TypeError(`Invalid predicate: ${inspect(predicate)}`); + throw new TypeError(`Invalid predicate: ${util.inspect(predicate)}`); } if (values.length === 0) {