[Pkg-javascript-commits] [node-string-decoder] 02/08: New upstream version 1.0.3
Bastien Roucariès
rouca at moszumanska.debian.org
Sun Aug 13 10:27:49 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-string-decoder.
commit cfe97df21fb3b2ddfe715591b7887c8c34378677
Author: Bastien ROUCARIÈS <roucaries.bastien at gmail.com>
Date: Sun Aug 13 00:42:23 2017 +0200
New upstream version 1.0.3
---
README.md | 2 --
build/files.js | 10 +---------
build/test-replacements.js | 3 +--
lib/string_decoder.js | 5 ++---
package.json | 6 +++---
test/parallel/test-string-decoder-end.js | 2 +-
test/parallel/test-string-decoder.js | 2 +-
test/verify-dependencies.js | 13 +++++++++++++
8 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/README.md b/README.md
index 13d827d..dc3a2d2 100644
--- a/README.md
+++ b/README.md
@@ -7,8 +7,6 @@
[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/)
-[![Sauce Test Status](https://saucelabs.com/browser-matrix/string_decoder.svg)](https://saucelabs.com/u/string_decoder)
-
```bash
npm install --save string_decoder
```
diff --git a/build/files.js b/build/files.js
index 647cf1c..66f195d 100644
--- a/build/files.js
+++ b/build/files.js
@@ -16,15 +16,7 @@ module.exports['string_decoder.js'] = [
, [
/const Buffer = require\('buffer'\).Buffer;/
- , 'var Buffer = require(\'buffer\').Buffer;\n' +
- 'var bufferShim = require(\'buffer-shims\');'
- ]
-
- // allocUnsafe
-
- , [
- /Buffer\.((?:alloc)|(?:allocUnsafe)|(?:from))/g,
- 'bufferShim.$1'
+ , 'var Buffer = require(\'safe-buffer\').Buffer;\n'
]
// add Buffer.isEncoding where missing
diff --git a/build/test-replacements.js b/build/test-replacements.js
index 8989250..11b1bb0 100644
--- a/build/test-replacements.js
+++ b/build/test-replacements.js
@@ -11,7 +11,7 @@ module.exports.all = [
, [
/^('use strict';)$/m,
- '$1\nconst bufferShim = require(\'buffer-shims\');'
+ '$1\nconst bufferShim = require(\'safe-buffer\').Buffer;'
]
]
@@ -60,4 +60,3 @@ module.exports['test-string-decoder.js'] = [
, ''
]
]
-
diff --git a/lib/string_decoder.js b/lib/string_decoder.js
index 696d7ab..26fb94c 100644
--- a/lib/string_decoder.js
+++ b/lib/string_decoder.js
@@ -1,7 +1,6 @@
'use strict';
-var Buffer = require('buffer').Buffer;
-var bufferShim = require('buffer-shims');
+var Buffer = require('safe-buffer').Buffer;
var isEncoding = Buffer.isEncoding || function (encoding) {
encoding = '' + encoding;
@@ -78,7 +77,7 @@ function StringDecoder(encoding) {
}
this.lastNeed = 0;
this.lastTotal = 0;
- this.lastChar = bufferShim.allocUnsafe(nb);
+ this.lastChar = Buffer.allocUnsafe(nb);
}
StringDecoder.prototype.write = function (buf) {
diff --git a/package.json b/package.json
index 05ded20..49408e8 100644
--- a/package.json
+++ b/package.json
@@ -1,17 +1,17 @@
{
"name": "string_decoder",
- "version": "1.0.0",
+ "version": "1.0.3",
"description": "The string_decoder module from Node core",
"main": "lib/string_decoder.js",
"dependencies": {
- "buffer-shims": "~1.0.0"
+ "safe-buffer": "~5.1.0"
},
"devDependencies": {
"babel-polyfill": "^6.23.0",
"tap": "~0.4.8"
},
"scripts": {
- "test": "tap test/parallel/*.js"
+ "test": "tap test/parallel/*.js && node test/verify-dependencies"
},
"repository": {
"type": "git",
diff --git a/test/parallel/test-string-decoder-end.js b/test/parallel/test-string-decoder-end.js
index b82c3ca..2c9b5ac 100644
--- a/test/parallel/test-string-decoder-end.js
+++ b/test/parallel/test-string-decoder-end.js
@@ -1,6 +1,6 @@
'use strict';
-var bufferShim = require('buffer-shims');
+var bufferShim = require('safe-buffer').Buffer;
// verify that the string decoder works getting 1 byte at a time,
// the whole buffer at once, and that both match the .toString(enc)
// result of the entire buffer.
diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js
index 38e21d2..61d6534 100644
--- a/test/parallel/test-string-decoder.js
+++ b/test/parallel/test-string-decoder.js
@@ -1,6 +1,6 @@
'use strict';
-var bufferShim = require('buffer-shims');
+var bufferShim = require('safe-buffer').Buffer;
require('../common');
var assert = require('assert');
var inspect = require('util').inspect;
diff --git a/test/verify-dependencies.js b/test/verify-dependencies.js
new file mode 100644
index 0000000..e7fba50
--- /dev/null
+++ b/test/verify-dependencies.js
@@ -0,0 +1,13 @@
+'use strict'
+
+var pack = require('../package.json');
+var assert = require('assert');
+
+function verifyNoCaret(deps) {
+ var keys = Object.keys(deps);
+ for (var i = 0; i < keys.length; i++) {
+ assert(deps[keys[i]][0] !== '^', keys[i] + ' must not be depended on using ^')
+ }
+}
+
+verifyNoCaret(pack.dependencies)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-string-decoder.git
More information about the Pkg-javascript-commits
mailing list