Apply no-buffer-constructor lint rule

This commit is contained in:
Zaid Abdulla committed 2018-08-25 03:24:59 -07:00
1 parent d85afcd2b5
commit b43088c03c
6 files changed
+8 -7

No files matched your search

+1 -1
View File
@@ -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;