From d3e775183c21cc2ac24b03cf1833d50ede39a4b6 Mon Sep 17 00:00:00 2001 From: Karolis Narkevicius Date: Wed, 3 Oct 2018 19:43:55 +0100 Subject: [PATCH] Use Buffer.from instead of new Buffer --- __tests__/registries/npm-registry.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/registries/npm-registry.js b/__tests__/registries/npm-registry.js index e9deb193e1..6f7551174f 100644 --- a/__tests__/registries/npm-registry.js +++ b/__tests__/registries/npm-registry.js @@ -7,8 +7,8 @@ import {BufferReporter} from '../../src/reporters/index.js'; import homeDir, {home} from '../../src/util/user-home-dir.js'; function basicAuth(username, password): string { - const pw = new Buffer(String(password), 'base64').toString(); - return new Buffer(String(username) + ':' + pw).toString('base64'); + const pw = Buffer.from(String(password), 'base64').toString(); + return Buffer.from(String(username) + ':' + pw).toString('base64'); } describe('normalizeConfig', () => {