Apply no-buffer-constructor lint rule
This commit is contained in:
1 parent
d85afcd2b5
commit
b43088c03c
6 files changed
+8
-7
No files matched your search
+1
-1
@@ -34,7 +34,7 @@ function generateDeviceId(deviceIdStruct) {
|
||||
// Escapes everything except alphanumerics and underscore
|
||||
function esc(str) {
|
||||
return str.replace(/[^A-Za-z0-9_]/g, chr => {
|
||||
const buf = new Buffer(chr, "utf8");
|
||||
const buf = Buffer.from(chr, "utf8");
|
||||
let rep = "";
|
||||
for (let b of buf) rep += "%" + b.toString(16).toUpperCase();
|
||||
return rep;
|
||||
|
||||
Reference in new issue
Block a user