From 2a89a3c310b88043ce2346fa1d415e59b1f54187 Mon Sep 17 00:00:00 2001 From: Mike Nicholls Date: Tue, 26 Feb 2019 15:26:41 +1300 Subject: [PATCH] Remove the dependency on "debug" and use the options.debug flag to control output instead --- lib/apkreader/parser/binaryxml.js | 7 +++---- package-lock.json | 4 ---- package.json | 1 - 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/apkreader/parser/binaryxml.js b/lib/apkreader/parser/binaryxml.js index 9c2ae2b..5e84e08 100644 --- a/lib/apkreader/parser/binaryxml.js +++ b/lib/apkreader/parser/binaryxml.js @@ -5,7 +5,6 @@ /*eslint no-console: "off"*/ const assert = require('assert') -const debug = require('debug')('adb:apkreader:parser:binaryxml') const NodeType = { ELEMENT_NODE: 1, @@ -314,7 +313,7 @@ class BinaryXmlParser { break default: { const type = dataType.toString(16) - debug(`Not sure what to do with typed value of type 0x${type}, falling \ + this.debug && console.debug(`Not sure what to do with typed value of type 0x${type}, falling \ back to reading an uint32.`) typedValue.value = this.readU32() typedValue.type = 'unknown' @@ -326,7 +325,7 @@ back to reading an uint32.`) if (this.cursor !== end) { const type = dataType.toString(16) const diff = end - this.cursor - debug(`Cursor is off by ${diff} bytes at ${this.cursor} at supposed end \ + this.debug && console.debug(`Cursor is off by ${diff} bytes at ${this.cursor} at supposed end \ of typed value of type 0x${type}. The typed value started at offset ${start} \ and is supposed to end at offset ${end}. Ignoring the rest of the value.`) this.cursor = end @@ -661,7 +660,7 @@ and is supposed to end at offset ${end}. Ignoring the rest of the value.`) if (this.cursor !== end) { const diff = end - this.cursor const type = header.chunkType.toString(16) - debug(`Cursor is off by ${diff} bytes at ${this.cursor} at supposed \ + this.debug && console.debug(`Cursor is off by ${diff} bytes at ${this.cursor} at supposed \ end of chunk of type 0x${type}. The chunk started at offset ${start} and is \ supposed to end at offset ${end}. Ignoring the rest of the chunk.`) this.cursor = end diff --git a/package-lock.json b/package-lock.json index 59eb25b..0caee57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -221,10 +221,6 @@ } } }, - "debug": { - "version": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", - "integrity": "sha1-BuHqgILCyxTjmAbiLi9vdX+Srzk=" - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", diff --git a/package.json b/package.json index e07afd1..6f2a753 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ }, "dependencies": { "bluebird": "^3.4.7", - "debug": "~0.7.4", "yauzl": "^2.7.0" }, "engines": {