fix lgtm warnings

This commit is contained in:
Martin Aeschlimann
2019-01-17 20:53:18 +01:00
parent 1539caf1b4
commit 54adadd72c
6 changed files with 11 additions and 11 deletions
@@ -229,7 +229,7 @@ export class PackageJSONContribution implements IJSONContribution {
if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']) || location.matches(['optionalDependencies', '*']) || location.matches(['peerDependencies', '*']))) {
const currentKey = location.path[location.path.length - 1];
if (typeof currentKey === 'string') {
const queryUrl = 'https://registry.npmjs.org/' + encodeURIComponent(currentKey).replace('%40', '@');
const queryUrl = 'https://registry.npmjs.org/' + encodeURIComponent(currentKey).replace(/%40/g, '@');
return this.xhr({
url: queryUrl,
agent: USER_AGENT
@@ -289,7 +289,7 @@ export class PackageJSONContribution implements IJSONContribution {
private getInfo(pack: string): Thenable<string[]> {
const queryUrl = 'https://registry.npmjs.org/' + encodeURIComponent(pack).replace('%40', '@');
const queryUrl = 'https://registry.npmjs.org/' + encodeURIComponent(pack).replace(/%40/g, '@');
return this.xhr({
url: queryUrl,
agent: USER_AGENT