mirror of https://github.com/node-red/node-red.git
fix: replace is-utf8 with native nodejs functions
Available since nodejs 18.14 https://nodejs.org/docs/latest-v18.x/api/buffer.html#bufferisutf8inputpull/4770/head
parent
a622d19ba7
commit
6af30f070b
|
@ -51,7 +51,6 @@
|
|||
"https-proxy-agent": "5.0.1",
|
||||
"i18next": "21.10.0",
|
||||
"iconv-lite": "0.6.3",
|
||||
"is-utf8": "0.2.1",
|
||||
"js-yaml": "4.1.0",
|
||||
"json-stringify-safe": "5.0.1",
|
||||
"jsonata": "2.0.5",
|
||||
|
@ -123,6 +122,6 @@
|
|||
"supertest": "6.3.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.5"
|
||||
"node": ">=18.14"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ module.exports = function(RED) {
|
|||
var spawn = require('child_process').spawn;
|
||||
var exec = require('child_process').exec;
|
||||
var fs = require('fs');
|
||||
var isUtf8 = require('is-utf8');
|
||||
const { isUtf8 } = require('node:buffer');
|
||||
const isWindows = process.platform === 'win32'
|
||||
|
||||
function ExecNode(n) {
|
||||
|
@ -87,7 +87,7 @@ module.exports = function(RED) {
|
|||
});
|
||||
var cmd = arg.shift();
|
||||
// Since 18.20.2/20.12.2, it is invalid to call spawn on Windows with a .bat/.cmd file
|
||||
// without using shell: true.
|
||||
// without using shell: true.
|
||||
const opts = isWindows ? { ...node.spawnOpt, shell: true } : node.spawnOpt
|
||||
/* istanbul ignore else */
|
||||
node.debug(cmd+" ["+arg+"]");
|
||||
|
|
|
@ -18,7 +18,7 @@ module.exports = function(RED) {
|
|||
"use strict";
|
||||
const { getProxyForUrl } = require('./lib/proxyHelper');
|
||||
var mqtt = require("mqtt");
|
||||
var isUtf8 = require('is-utf8');
|
||||
const { isUtf8 } = require('node:buffer');
|
||||
var HttpsProxyAgent = require('https-proxy-agent');
|
||||
var url = require('url');
|
||||
const knownMediaTypes = {
|
||||
|
|
|
@ -24,7 +24,7 @@ module.exports = function(RED) {
|
|||
var onHeaders = require('on-headers');
|
||||
var typer = require('content-type');
|
||||
var mediaTyper = require('media-typer');
|
||||
var isUtf8 = require('is-utf8');
|
||||
const { isUtf8 } = require('node:buffer');
|
||||
var hashSum = require("hash-sum");
|
||||
|
||||
function rawBodyParser(req, res, next) {
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
"hash-sum": "2.0.0",
|
||||
"hpagent": "1.2.0",
|
||||
"https-proxy-agent": "5.0.1",
|
||||
"is-utf8": "0.2.1",
|
||||
"js-yaml": "4.1.0",
|
||||
"media-typer": "1.1.0",
|
||||
"mqtt": "5.7.0",
|
||||
|
|
|
@ -48,6 +48,6 @@
|
|||
"@node-rs/bcrypt": "1.10.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.5"
|
||||
"node": ">=18.14"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue