Updating NPM dependencies

This commit is contained in:
Drew Heavner
2020-11-11 13:30:52 +00:00
committed by GitHub
parent 7a6fb66c63
commit bd487ef324
9068 changed files with 1400893 additions and 587661 deletions

View File

@@ -1,5 +1,5 @@
"use strict";
// Copyright 2014-2016, Google, Inc.
// Copyright 2020 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -12,9 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Discovery = void 0;
const fs = require("fs");
const google_auth_library_1 = require("google-auth-library");
const url = require("url");
const resolve = require("url");
const util = require("util");
const apirequest_1 = require("./apirequest");
const endpoint_1 = require("./endpoint");
@@ -68,7 +69,7 @@ class Discovery {
return { api, endpointCreator };
}));
const versionIndex = {};
// tslint:disable-next-line no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const apisIndex = {};
for (const set of apis) {
if (!apisIndex[set.api.name]) {
@@ -88,9 +89,7 @@ class Discovery {
throw new Error('Argument error: Accepts only string or object');
}
try {
const ep =
// tslint:disable-next-line: no-any
set.endpointCreator(options, this);
const ep = set.endpointCreator(options, this);
return Object.freeze(ep); // create new & freeze
}
catch (e) {
@@ -110,7 +109,7 @@ class Discovery {
*/
async discoverAPI(apiDiscoveryUrl) {
if (typeof apiDiscoveryUrl === 'string') {
const parts = url.parse(apiDiscoveryUrl);
const parts = resolve.parse(apiDiscoveryUrl);
if (apiDiscoveryUrl && !parts.protocol) {
this.log('Reading from file ' + apiDiscoveryUrl);
const file = await readFile(apiDiscoveryUrl, { encoding: 'utf8' });