1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-03 20:30:04 +02:00

update node modules

This commit is contained in:
s2
2019-03-29 15:56:41 +01:00
parent f114871153
commit 89c32fb4e6
8347 changed files with 390123 additions and 159877 deletions

View File

@@ -3,6 +3,7 @@
module.exports = SSHBuffer;
var assert = require('assert-plus');
var Buffer = require('safer-buffer').Buffer;
function SSHBuffer(opts) {
assert.object(opts, 'options');
@@ -10,7 +11,7 @@ function SSHBuffer(opts) {
assert.buffer(opts.buffer, 'options.buffer');
this._size = opts.buffer ? opts.buffer.length : 1024;
this._buffer = opts.buffer || (new Buffer(this._size));
this._buffer = opts.buffer || Buffer.alloc(this._size);
this._offset = 0;
}
@@ -32,7 +33,7 @@ SSHBuffer.prototype.skip = function (n) {
SSHBuffer.prototype.expand = function () {
this._size *= 2;
var buf = new Buffer(this._size);
var buf = Buffer.alloc(this._size);
this._buffer.copy(buf, 0);
this._buffer = buf;
};
@@ -96,7 +97,7 @@ SSHBuffer.prototype.writeBuffer = function (buf) {
};
SSHBuffer.prototype.writeString = function (str) {
this.writeBuffer(new Buffer(str, 'utf8'));
this.writeBuffer(Buffer.from(str, 'utf8'));
};
SSHBuffer.prototype.writeCString = function (str) {