[Pkg-javascript-commits] [node-asn1.js] 87/202: lib: use minimalistic-assert

Bastien Roucariès rouca at moszumanska.debian.org
Thu Apr 20 19:18:57 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-asn1.js.

commit 125c5bbad3e67cc3858f7620b7968eafeecd61fd
Author: Calvin Metcalf <cmetcalf at appgeo.com>
Date:   Mon Jan 12 10:58:49 2015 -0500

    lib: use minimalistic-assert
---
 lib/asn1/base/buffer.js   | 5 ++---
 lib/asn1/base/node.js     | 2 +-
 lib/asn1/base/reporter.js | 4 ++--
 lib/asn1/decoders/der.js  | 4 ++--
 lib/asn1/encoders/der.js  | 4 ++--
 package.json              | 4 ++++
 6 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/lib/asn1/base/buffer.js b/lib/asn1/base/buffer.js
index ff94be6..7b1152f 100644
--- a/lib/asn1/base/buffer.js
+++ b/lib/asn1/base/buffer.js
@@ -1,5 +1,4 @@
-var assert = require('assert');
-var util = require('util');
+var inherits = require('inherits');
 var Reporter = require('../base').Reporter;
 var Buffer = require('buffer').Buffer;
 
@@ -14,7 +13,7 @@ function DecoderBuffer(base, options) {
   this.offset = 0;
   this.length = base.length;
 }
-util.inherits(DecoderBuffer, Reporter);
+inherits(DecoderBuffer, Reporter);
 exports.DecoderBuffer = DecoderBuffer;
 
 DecoderBuffer.prototype.save = function save() {
diff --git a/lib/asn1/base/node.js b/lib/asn1/base/node.js
index 2737f40..508ebc9 100644
--- a/lib/asn1/base/node.js
+++ b/lib/asn1/base/node.js
@@ -1,6 +1,6 @@
-var assert = require('assert');
 var Reporter = require('../base').Reporter;
 var EncoderBuffer = require('../base').EncoderBuffer;
+var assert = require('minimalistic-assert');
 
 // Supported tags
 var tags = [
diff --git a/lib/asn1/base/reporter.js b/lib/asn1/base/reporter.js
index 605ae4e..7f02190 100644
--- a/lib/asn1/base/reporter.js
+++ b/lib/asn1/base/reporter.js
@@ -1,4 +1,4 @@
-var util = require('util');
+var inherits = require('inherits');
 
 function Reporter(options) {
   this._reporterState = {
@@ -79,7 +79,7 @@ function ReporterError(path, msg) {
   this.path = path;
   this.rethrow(msg);
 };
-util.inherits(ReporterError, Error);
+inherits(ReporterError, Error);
 
 ReporterError.prototype.rethrow = function rethrow(msg) {
   this.message = msg + ' at: ' + (this.path || '(shallow)');
diff --git a/lib/asn1/decoders/der.js b/lib/asn1/decoders/der.js
index 3690ca2..559600d 100644
--- a/lib/asn1/decoders/der.js
+++ b/lib/asn1/decoders/der.js
@@ -1,4 +1,4 @@
-var util = require('util');
+var inherits = require('inherits');
 
 var asn1 = require('../../asn1');
 var base = asn1.base;
@@ -30,7 +30,7 @@ DERDecoder.prototype.decode = function decode(data, options) {
 function DERNode(parent) {
   base.Node.call(this, 'der', parent);
 }
-util.inherits(DERNode, base.Node);
+inherits(DERNode, base.Node);
 
 DERNode.prototype._peekTag = function peekTag(buffer, tag) {
   if (buffer.isEmpty())
diff --git a/lib/asn1/encoders/der.js b/lib/asn1/encoders/der.js
index 29b9c9d..68ad4ab 100644
--- a/lib/asn1/encoders/der.js
+++ b/lib/asn1/encoders/der.js
@@ -1,4 +1,4 @@
-var util = require('util');
+var inherits = require('inherits');
 var Buffer = require('buffer').Buffer;
 
 var asn1 = require('../../asn1');
@@ -28,7 +28,7 @@ DEREncoder.prototype.encode = function encode(data, reporter) {
 function DERNode(parent) {
   base.Node.call(this, 'der', parent);
 }
-util.inherits(DERNode, base.Node);
+inherits(DERNode, base.Node);
 
 DERNode.prototype._encodeComposite = function encodeComposite(tag,
                                                               primitive,
diff --git a/package.json b/package.json
index ac59078..7aa01a0 100644
--- a/package.json
+++ b/package.json
@@ -25,5 +25,9 @@
   },
   "optionalDependencies": {
     "bn.js": "^1.0.0"
+  },
+  "dependencies": {
+    "inherits": "^2.0.1",
+    "minimalistic-assert": "^1.0.0"
   }
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-asn1.js.git



More information about the Pkg-javascript-commits mailing list