Skip to content
Snippets Groups Projects
Commit 0820ecb4 authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

"new Buffer" --> "Buffer.from"

parent 5c9a6716
No related branches found
No related tags found
No related merge requests found
/**
* @author Rolf Niepraschk (Rolf.Niepraschk@ptb.de)
* version: 2019-01-25
* version: 2020-04-29
*/
var cfg = require('./config.js');
......@@ -62,7 +62,8 @@ function fromXLSX(pRef, js) {
try {
logger.debug('Value.length: ', js.Value.length);
utils.addStartTime(js);
var data = xlsx.parse(new Buffer(js.Value, 'base64'));
//var data = xlsx.parse(new Buffer(js.Value, 'base64'));
var data = xlsx.parse(Buffer.from(js.Value, 'base64'));
utils.addStopTime(js);
var short = (typeof js.ShortFormat == 'boolean') ? js.ShortFormat : true;
//response.prepareResult(pRef, js, short ? simplify(data) : data);
......
/**
* @author Rolf Niepraschk (Rolf.Niepraschk@ptb.de)
* version: 2019-01-25
* version: 2020-04-29
*/
var exec = require('child_process').exec;
......@@ -73,7 +73,8 @@ function call(pRef, js, postFunc) {
var res;
if (js.OutputEncoding == 'binary') {
res = new Buffer(stdout, 'binary');
//res = new Buffer(stdout, 'binary');
res = Buffer.from(stdout, 'binary');
} else {
res = stdout;
}
......
/**
* @author Rolf Niepraschk (Rolf.Niepraschk@ptb.de)
* version: 2019-01-25
* version: 2020-04-29
*/
var cfg = require('./config.js');
......@@ -20,7 +20,8 @@ var logger = cfg.logger;
function call(pRef, js) {
function doIt(b, next) {
var host = js.Host, port = tools.getInt(js.Port);
var buf = new Buffer((js.Value) ? js.Value : '');
//var buf = new Buffer((js.Value) ? js.Value : '');
var buf = Buffer.from(js.Value ? js.Value : '');
var timeout = tools.getInt(js.Timeout, cfg.DEFAULT_UDP_TIMEOUT);
var client = dgram.createSocket('udp4');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment