不要怂,就是干,撸起袖子干!

Commit c3b65136 by Sushant

fix: use Buffer.from

1 parent 599e1bd7
...@@ -515,9 +515,9 @@ BLOB.prototype.escape = false; ...@@ -515,9 +515,9 @@ BLOB.prototype.escape = false;
BLOB.prototype._stringify = function _stringify(value) { BLOB.prototype._stringify = function _stringify(value) {
if (!Buffer.isBuffer(value)) { if (!Buffer.isBuffer(value)) {
if (Array.isArray(value)) { if (Array.isArray(value)) {
value = new Buffer(value); value = Buffer.from(value);
} else { } else {
value = new Buffer(value.toString()); value = Buffer.from(value.toString());
} }
} }
const hex = value.toString('hex'); const hex = value.toString('hex');
......
...@@ -426,7 +426,7 @@ module.exports = BaseTypes => { ...@@ -426,7 +426,7 @@ module.exports = BaseTypes => {
}; };
GEOMETRY.parse = GEOMETRY.prototype.parse = function parse(value) { GEOMETRY.parse = GEOMETRY.prototype.parse = function parse(value) {
const b = new Buffer(value, 'hex'); const b = Buffer.from(value, 'hex');
return wkx.Geometry.parse(b).toGeoJSON(); return wkx.Geometry.parse(b).toGeoJSON();
}; };
...@@ -462,7 +462,7 @@ module.exports = BaseTypes => { ...@@ -462,7 +462,7 @@ module.exports = BaseTypes => {
}; };
GEOGRAPHY.parse = GEOGRAPHY.prototype.parse = function parse(value) { GEOGRAPHY.parse = GEOGRAPHY.prototype.parse = function parse(value) {
const b = new Buffer(value, 'hex'); const b = Buffer.from(value, 'hex');
return wkx.Geometry.parse(b).toGeoJSON(); return wkx.Geometry.parse(b).toGeoJSON();
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!