Skip to content

Commit 26a0934

Browse files
committed
feat: modernize dependencies
BREAKING CHANGE: drop support for old Node versions (Node < 10) Users of old Nodes should install gulp-unassert@1.x
1 parent 8ea089e commit 26a0934

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
var unassert = require('unassert');
1515
var through = require('through2');
1616
var PluginError = require('plugin-error');
17-
var bufferFrom = require('buffer-from');
1817
var BufferStreams = require('bufferstreams');
1918
var acorn = require('acorn');
2019
var escodegen = require('escodegen');
@@ -66,7 +65,7 @@ function applyUnassertWithSourceMap (file, encoding, opt) {
6665
overwritePropertyIfExists('sourceRoot', inMap, reMap);
6766
overwritePropertyIfExists('file', inMap, reMap);
6867

69-
file.contents = bufferFrom(instrumented.code);
68+
file.contents = Buffer.from(instrumented.code);
7069
file.sourceMap = reMap.toObject();
7170
}
7271

@@ -79,7 +78,7 @@ function transform (file, encoding, opt) {
7978
if (file.sourceMap) {
8079
applyUnassertWithSourceMap(file, encoding, opt);
8180
} else {
82-
file.contents = bufferFrom(applyUnassertWithoutSourceMap(file.contents.toString(encoding)));
81+
file.contents = Buffer.from(applyUnassertWithoutSourceMap(file.contents.toString(encoding)));
8382
}
8483
}
8584

@@ -102,7 +101,7 @@ module.exports = function (opt) {
102101
} else {
103102
try {
104103
var modifiedCode = applyUnassertWithoutSourceMap(buf.toString(encoding));
105-
cb(null, bufferFrom(modifiedCode));
104+
cb(null, Buffer.from(modifiedCode));
106105
} catch (innerError) {
107106
return callback(new PluginError('gulp-unassert', innerError, { showStack: true }));
108107
}

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
},
1010
"bugs": "https://github.com/unassert-js/gulp-unassert/issues",
1111
"dependencies": {
12-
"acorn": "^5.0.0",
13-
"buffer-from": "^1.0.0",
14-
"bufferstreams": "^2.0.0",
12+
"acorn": "^7.0.0",
13+
"bufferstreams": "^3.0.0",
1514
"convert-source-map": "^1.1.2",
1615
"escodegen": "^1.10.0",
17-
"multi-stage-sourcemap": "^0.2.1",
16+
"multi-stage-sourcemap": "^0.3.1",
1817
"plugin-error": "^1.0.0",
19-
"through2": "^2.0.0",
18+
"through2": "^3.0.0",
2019
"unassert": "^1.3.1",
2120
"vinyl-sourcemaps-apply": "^0.2.0"
2221
},

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy