Skip to content

Commit

Permalink
fix: removed use of deprecated API
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Oct 20, 2023
1 parent 327365b commit cd2cbcc
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/client/database/record/index.js
Expand Up @@ -90,7 +90,7 @@ const internalUpdate = function(record, options) {
if (found["@type"] === "b") {
keys = Object.keys(found);
total = keys.length;
var foundClone = new Buffer(record);
var foundClone = Buffer.from(record);
for (i = 0; i < total; i++) {
key = keys[i];
if (key.charAt(0) === "@") {
Expand Down
2 changes: 1 addition & 1 deletion lib/db/record.js
Expand Up @@ -297,7 +297,7 @@ exports.update = function (record, options) {
if (found['@type'] === 'b') {
keys = Object.keys(found);
total = keys.length;
var foundClone = new Buffer(record);
var foundClone = Buffer.from(record);
for (i = 0; i < total; i++) {
key = keys[i];
if (key.charAt(0) === '@') {
Expand Down
2 changes: 1 addition & 1 deletion lib/db/statement.js
Expand Up @@ -599,7 +599,7 @@ Statement.prototype.addParams = function (params) {
*/
Statement.prototype.token = function (token) {
if (typeof token === 'string') {
token = new Buffer(token, 'base64');
token = Buffer.from(token, 'base64');
}
this._state.token = token || false;
return this;
Expand Down
2 changes: 1 addition & 1 deletion lib/server/index.js
Expand Up @@ -40,7 +40,7 @@ Object.defineProperty(Server.prototype, "token", {
},
set: function(token) {
if (typeof token === "string") {
token = new Buffer(token, "base64");
token = Buffer.from(token, "base64");
}
this.transport.token = token;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/transport/binary/protocol33/deserializer-csv.js
Expand Up @@ -539,7 +539,7 @@ function eatBinary (input) {
}
input = input.slice(i + 1);

return [new Buffer(collected, 'base64'), input];
return [Buffer.from(collected, 'base64'), input];
}


Expand Down
4 changes: 2 additions & 2 deletions lib/transport/binary/protocol33/serializer-csv.js
Expand Up @@ -9,7 +9,7 @@ var RecordID = require('../../../recordid');
* @return {Buffer} The buffer containing the content.
*/
function encodeRecordData (content) {
return new Buffer(serializeDocument(content), 'utf8');
return Buffer.from(serializeDocument(content), 'utf8');
}

/**
Expand Down Expand Up @@ -138,4 +138,4 @@ function serializeObject (value) {

exports.serializeDocument = serializeDocument;
exports.serializeValue = serializeValue;
exports.encodeRecordData = encodeRecordData;
exports.encodeRecordData = encodeRecordData;
2 changes: 1 addition & 1 deletion lib/transport/binary/protocol33/serializer.js
Expand Up @@ -10,7 +10,7 @@ try {
}catch (e) {
serializer = require('./serializer-csv');
encodeRecordData =function(content) {
return new Buffer(serializer.serializeDocument(content), 'utf8');
return Buffer.from(serializer.serializeDocument(content), 'utf8');
};
}

Expand Down

0 comments on commit cd2cbcc

Please sign in to comment.