Merge pull request #3563 from github/mbg/private-registry/oidc

Accept OIDC configurations in `start-proxy`
This commit is contained in:
Michael B. Gale
2026-03-13 11:58:36 +00:00
committed by GitHub
22 changed files with 1299 additions and 571 deletions
+35 -30
View File
@@ -53287,8 +53287,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -57774,7 +57774,7 @@ var require_commonjs4 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -57821,7 +57821,7 @@ var require_commonjs4 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID() {
@@ -99833,7 +99833,7 @@ var require_follow_redirects = __commonJS({
if (this._ending) {
throw new WriteAfterEndError();
}
if (!isString(data) && !isBuffer(data)) {
if (!isString2(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
@@ -100088,7 +100088,7 @@ var require_follow_redirects = __commonJS({
function request2(input, options, callback) {
if (isURL(input)) {
input = spreadUrlObject(input);
} else if (isString(input)) {
} else if (isString2(input)) {
input = spreadUrlObject(parseUrl2(input));
} else {
callback = options;
@@ -100104,7 +100104,7 @@ var require_follow_redirects = __commonJS({
maxBodyLength: exports3.maxBodyLength
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString(options.host) && !isString(options.hostname)) {
if (!isString2(options.host) && !isString2(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
@@ -100131,7 +100131,7 @@ var require_follow_redirects = __commonJS({
parsed = new URL2(input);
} else {
parsed = validateUrl(url.parse(input));
if (!isString(parsed.protocol)) {
if (!isString2(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
@@ -100203,11 +100203,11 @@ var require_follow_redirects = __commonJS({
request2.destroy(error3);
}
function isSubdomain(subdomain, domain) {
assert(isString(subdomain) && isString(domain));
assert(isString2(subdomain) && isString2(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString(value) {
function isString2(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
@@ -106965,10 +106965,10 @@ var require_util20 = __commonJS({
return typeof arg === "number";
}
exports2.isNumber = isNumber;
function isString(arg) {
function isString2(arg) {
return typeof arg === "string";
}
exports2.isString = isString;
exports2.isString = isString2;
function isSymbol(arg) {
return typeof arg === "symbol";
}
@@ -106981,10 +106981,10 @@ var require_util20 = __commonJS({
return objectToString(re) === "[object RegExp]";
}
exports2.isRegExp = isRegExp;
function isObject2(arg) {
function isObject3(arg) {
return typeof arg === "object" && arg !== null;
}
exports2.isObject = isObject2;
exports2.isObject = isObject3;
function isDate(d) {
return objectToString(d) === "[object Date]";
}
@@ -109026,11 +109026,11 @@ var require_baseGetTag = __commonJS({
// node_modules/lodash/isObject.js
var require_isObject = __commonJS({
"node_modules/lodash/isObject.js"(exports2, module2) {
function isObject2(value) {
function isObject3(value) {
var type2 = typeof value;
return value != null && (type2 == "object" || type2 == "function");
}
module2.exports = isObject2;
module2.exports = isObject3;
}
});
@@ -109038,13 +109038,13 @@ var require_isObject = __commonJS({
var require_isFunction = __commonJS({
"node_modules/lodash/isFunction.js"(exports2, module2) {
var baseGetTag = require_baseGetTag();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var asyncTag = "[object AsyncFunction]";
var funcTag = "[object Function]";
var genTag = "[object GeneratorFunction]";
var proxyTag = "[object Proxy]";
function isFunction(value) {
if (!isObject2(value)) {
if (!isObject3(value)) {
return false;
}
var tag = baseGetTag(value);
@@ -109105,7 +109105,7 @@ var require_baseIsNative = __commonJS({
"node_modules/lodash/_baseIsNative.js"(exports2, module2) {
var isFunction = require_isFunction();
var isMasked = require_isMasked();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var toSource = require_toSource();
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor = /^\[object .+?Constructor\]$/;
@@ -109117,7 +109117,7 @@ var require_baseIsNative = __commonJS({
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function baseIsNative(value) {
if (!isObject2(value) || isMasked(value)) {
if (!isObject3(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
@@ -109285,9 +109285,9 @@ var require_isIterateeCall = __commonJS({
var eq = require_eq2();
var isArrayLike = require_isArrayLike();
var isIndex = require_isIndex();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
function isIterateeCall(value, index, object) {
if (!isObject2(object)) {
if (!isObject3(object)) {
return false;
}
var type2 = typeof index;
@@ -109532,13 +109532,13 @@ var require_nativeKeysIn = __commonJS({
// node_modules/lodash/_baseKeysIn.js
var require_baseKeysIn = __commonJS({
"node_modules/lodash/_baseKeysIn.js"(exports2, module2) {
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var isPrototype = require_isPrototype();
var nativeKeysIn = require_nativeKeysIn();
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function baseKeysIn(object) {
if (!isObject2(object)) {
if (!isObject3(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object), result = [];
@@ -110030,7 +110030,7 @@ var require_event_target_shim = __commonJS({
var CAPTURE = 1;
var BUBBLE = 2;
var ATTRIBUTE = 3;
function isObject2(x) {
function isObject3(x) {
return x !== null && typeof x === "object";
}
function getListeners(eventTarget) {
@@ -110056,7 +110056,7 @@ var require_event_target_shim = __commonJS({
return null;
},
set(listener) {
if (typeof listener !== "function" && !isObject2(listener)) {
if (typeof listener !== "function" && !isObject3(listener)) {
listener = null;
}
const listeners = getListeners(this);
@@ -110147,11 +110147,11 @@ var require_event_target_shim = __commonJS({
if (listener == null) {
return;
}
if (typeof listener !== "function" && !isObject2(listener)) {
if (typeof listener !== "function" && !isObject3(listener)) {
throw new TypeError("'listener' should be a function or an object.");
}
const listeners = getListeners(this);
const optionsIsObj = isObject2(options);
const optionsIsObj = isObject3(options);
const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
const listenerType = capture ? CAPTURE : BUBBLE;
const newNode = {
@@ -110188,7 +110188,7 @@ var require_event_target_shim = __commonJS({
return;
}
const listeners = getListeners(this);
const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options);
const capture = isObject3(options) ? Boolean(options.capture) : Boolean(options);
const listenerType = capture ? CAPTURE : BUBBLE;
let prev = null;
let node = listeners.get(eventName);
@@ -160996,6 +160996,11 @@ var semver = __toESM(require_semver2());
var maximumVersion = "3.21";
var minimumVersion = "3.14";
// src/json/index.ts
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
// src/util.ts
var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
var GITHUB_DOTCOM_URL = "https://github.com";
@@ -163096,7 +163101,7 @@ function getArtifactSuffix(matrix) {
if (matrix) {
try {
const matrixObject = JSON.parse(matrix);
if (matrixObject !== null && typeof matrixObject === "object") {
if (isObject2(matrixObject)) {
for (const matrixKey of Object.keys(matrixObject).sort())
suffix += `-${matrixObject[matrixKey]}`;
} else {
+22 -12
View File
@@ -53287,8 +53287,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -57774,7 +57774,7 @@ var require_commonjs4 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID2;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -57821,7 +57821,7 @@ var require_commonjs4 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID2() {
@@ -99833,7 +99833,7 @@ var require_follow_redirects = __commonJS({
if (this._ending) {
throw new WriteAfterEndError();
}
if (!isString(data) && !isBuffer(data)) {
if (!isString2(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
@@ -100088,7 +100088,7 @@ var require_follow_redirects = __commonJS({
function request2(input, options, callback) {
if (isURL(input)) {
input = spreadUrlObject(input);
} else if (isString(input)) {
} else if (isString2(input)) {
input = spreadUrlObject(parseUrl2(input));
} else {
callback = options;
@@ -100104,7 +100104,7 @@ var require_follow_redirects = __commonJS({
maxBodyLength: exports3.maxBodyLength
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString(options.host) && !isString(options.hostname)) {
if (!isString2(options.host) && !isString2(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
@@ -100131,7 +100131,7 @@ var require_follow_redirects = __commonJS({
parsed = new URL2(input);
} else {
parsed = validateUrl(url2.parse(input));
if (!isString(parsed.protocol)) {
if (!isString2(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
@@ -100203,11 +100203,11 @@ var require_follow_redirects = __commonJS({
request2.destroy(error3);
}
function isSubdomain(subdomain, domain) {
assert(isString(subdomain) && isString(domain));
assert(isString2(subdomain) && isString2(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString(value) {
function isString2(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
@@ -105790,6 +105790,16 @@ var safeDump = renamed("safeDump", "dump");
// src/util.ts
var semver = __toESM(require_semver2());
// src/json/index.ts
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
function isString(value) {
return typeof value === "string";
}
// src/util.ts
var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
var BROKEN_VERSIONS = ["0.0.0-20211207"];
var GITHUB_DOTCOM_URL = "https://github.com";
@@ -106074,7 +106084,7 @@ var HTTPError = class extends Error {
var ConfigurationError = class extends Error {
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
if (!isObject2(arg) || !isString(arg.message)) {
return void 0;
}
if (Number.isInteger(arg.status)) {
@@ -112145,7 +112155,7 @@ function locationUpdateCallback(result, location, logger) {
}
function resolveUriToFile(location, artifacts, sourceRoot, logger) {
if (!location.uri && location.index !== void 0) {
if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || typeof artifacts[location.index].location !== "object") {
if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || !isObject2(artifacts[location.index].location)) {
logger.debug(`Ignoring location as index "${location.index}" is invalid`);
return void 0;
}
+19 -11
View File
@@ -53287,8 +53287,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -57774,7 +57774,7 @@ var require_commonjs4 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -57821,7 +57821,7 @@ var require_commonjs4 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID() {
@@ -99833,7 +99833,7 @@ var require_follow_redirects = __commonJS({
if (this._ending) {
throw new WriteAfterEndError();
}
if (!isString(data) && !isBuffer(data)) {
if (!isString2(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
@@ -100088,7 +100088,7 @@ var require_follow_redirects = __commonJS({
function request2(input, options, callback) {
if (isURL(input)) {
input = spreadUrlObject(input);
} else if (isString(input)) {
} else if (isString2(input)) {
input = spreadUrlObject(parseUrl2(input));
} else {
callback = options;
@@ -100104,7 +100104,7 @@ var require_follow_redirects = __commonJS({
maxBodyLength: exports3.maxBodyLength
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString(options.host) && !isString(options.hostname)) {
if (!isString2(options.host) && !isString2(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
@@ -100131,7 +100131,7 @@ var require_follow_redirects = __commonJS({
parsed = new URL2(input);
} else {
parsed = validateUrl(url.parse(input));
if (!isString(parsed.protocol)) {
if (!isString2(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
@@ -100203,11 +100203,11 @@ var require_follow_redirects = __commonJS({
request2.destroy(error3);
}
function isSubdomain(subdomain, domain) {
assert(isString(subdomain) && isString(domain));
assert(isString2(subdomain) && isString2(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString(value) {
function isString2(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
@@ -102888,6 +102888,14 @@ var semver = __toESM(require_semver2());
var maximumVersion = "3.21";
var minimumVersion = "3.14";
// src/json/index.ts
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
function isString(value) {
return typeof value === "string";
}
// src/util.ts
var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
var GITHUB_DOTCOM_URL = "https://github.com";
@@ -102995,7 +103003,7 @@ var HTTPError = class extends Error {
var ConfigurationError = class extends Error {
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
if (!isObject2(arg) || !isString(arg.message)) {
return void 0;
}
if (Number.isInteger(arg.status)) {
+40 -32
View File
@@ -53287,8 +53287,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -57774,7 +57774,7 @@ var require_commonjs4 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID2;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -57821,7 +57821,7 @@ var require_commonjs4 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID2() {
@@ -99833,7 +99833,7 @@ var require_follow_redirects = __commonJS({
if (this._ending) {
throw new WriteAfterEndError();
}
if (!isString(data) && !isBuffer(data)) {
if (!isString2(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
@@ -100088,7 +100088,7 @@ var require_follow_redirects = __commonJS({
function request2(input, options, callback) {
if (isURL(input)) {
input = spreadUrlObject(input);
} else if (isString(input)) {
} else if (isString2(input)) {
input = spreadUrlObject(parseUrl2(input));
} else {
callback = options;
@@ -100104,7 +100104,7 @@ var require_follow_redirects = __commonJS({
maxBodyLength: exports3.maxBodyLength
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString(options.host) && !isString(options.hostname)) {
if (!isString2(options.host) && !isString2(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
@@ -100131,7 +100131,7 @@ var require_follow_redirects = __commonJS({
parsed = new URL2(input);
} else {
parsed = validateUrl(url2.parse(input));
if (!isString(parsed.protocol)) {
if (!isString2(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
@@ -100203,11 +100203,11 @@ var require_follow_redirects = __commonJS({
request2.destroy(error3);
}
function isSubdomain(subdomain, domain) {
assert(isString(subdomain) && isString(domain));
assert(isString2(subdomain) && isString2(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString(value) {
function isString2(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
@@ -106965,10 +106965,10 @@ var require_util20 = __commonJS({
return typeof arg === "number";
}
exports2.isNumber = isNumber;
function isString(arg) {
function isString2(arg) {
return typeof arg === "string";
}
exports2.isString = isString;
exports2.isString = isString2;
function isSymbol(arg) {
return typeof arg === "symbol";
}
@@ -106981,10 +106981,10 @@ var require_util20 = __commonJS({
return objectToString(re) === "[object RegExp]";
}
exports2.isRegExp = isRegExp;
function isObject2(arg) {
function isObject3(arg) {
return typeof arg === "object" && arg !== null;
}
exports2.isObject = isObject2;
exports2.isObject = isObject3;
function isDate(d) {
return objectToString(d) === "[object Date]";
}
@@ -109026,11 +109026,11 @@ var require_baseGetTag = __commonJS({
// node_modules/lodash/isObject.js
var require_isObject = __commonJS({
"node_modules/lodash/isObject.js"(exports2, module2) {
function isObject2(value) {
function isObject3(value) {
var type2 = typeof value;
return value != null && (type2 == "object" || type2 == "function");
}
module2.exports = isObject2;
module2.exports = isObject3;
}
});
@@ -109038,13 +109038,13 @@ var require_isObject = __commonJS({
var require_isFunction = __commonJS({
"node_modules/lodash/isFunction.js"(exports2, module2) {
var baseGetTag = require_baseGetTag();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var asyncTag = "[object AsyncFunction]";
var funcTag = "[object Function]";
var genTag = "[object GeneratorFunction]";
var proxyTag = "[object Proxy]";
function isFunction(value) {
if (!isObject2(value)) {
if (!isObject3(value)) {
return false;
}
var tag = baseGetTag(value);
@@ -109105,7 +109105,7 @@ var require_baseIsNative = __commonJS({
"node_modules/lodash/_baseIsNative.js"(exports2, module2) {
var isFunction = require_isFunction();
var isMasked = require_isMasked();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var toSource = require_toSource();
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor = /^\[object .+?Constructor\]$/;
@@ -109117,7 +109117,7 @@ var require_baseIsNative = __commonJS({
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function baseIsNative(value) {
if (!isObject2(value) || isMasked(value)) {
if (!isObject3(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
@@ -109285,9 +109285,9 @@ var require_isIterateeCall = __commonJS({
var eq = require_eq2();
var isArrayLike = require_isArrayLike();
var isIndex = require_isIndex();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
function isIterateeCall(value, index, object) {
if (!isObject2(object)) {
if (!isObject3(object)) {
return false;
}
var type2 = typeof index;
@@ -109532,13 +109532,13 @@ var require_nativeKeysIn = __commonJS({
// node_modules/lodash/_baseKeysIn.js
var require_baseKeysIn = __commonJS({
"node_modules/lodash/_baseKeysIn.js"(exports2, module2) {
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var isPrototype = require_isPrototype();
var nativeKeysIn = require_nativeKeysIn();
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function baseKeysIn(object) {
if (!isObject2(object)) {
if (!isObject3(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object), result = [];
@@ -110030,7 +110030,7 @@ var require_event_target_shim = __commonJS({
var CAPTURE = 1;
var BUBBLE = 2;
var ATTRIBUTE = 3;
function isObject2(x) {
function isObject3(x) {
return x !== null && typeof x === "object";
}
function getListeners(eventTarget) {
@@ -110056,7 +110056,7 @@ var require_event_target_shim = __commonJS({
return null;
},
set(listener) {
if (typeof listener !== "function" && !isObject2(listener)) {
if (typeof listener !== "function" && !isObject3(listener)) {
listener = null;
}
const listeners = getListeners(this);
@@ -110147,11 +110147,11 @@ var require_event_target_shim = __commonJS({
if (listener == null) {
return;
}
if (typeof listener !== "function" && !isObject2(listener)) {
if (typeof listener !== "function" && !isObject3(listener)) {
throw new TypeError("'listener' should be a function or an object.");
}
const listeners = getListeners(this);
const optionsIsObj = isObject2(options);
const optionsIsObj = isObject3(options);
const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
const listenerType = capture ? CAPTURE : BUBBLE;
const newNode = {
@@ -110188,7 +110188,7 @@ var require_event_target_shim = __commonJS({
return;
}
const listeners = getListeners(this);
const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options);
const capture = isObject3(options) ? Boolean(options.capture) : Boolean(options);
const listenerType = capture ? CAPTURE : BUBBLE;
let prev = null;
let node = listeners.get(eventName);
@@ -163894,6 +163894,14 @@ var semver = __toESM(require_semver2());
var maximumVersion = "3.21";
var minimumVersion = "3.14";
// src/json/index.ts
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
function isString(value) {
return typeof value === "string";
}
// src/util.ts
var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
var BROKEN_VERSIONS = ["0.0.0-20211207"];
@@ -164004,7 +164012,7 @@ var HTTPError = class extends Error {
var ConfigurationError = class extends Error {
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
if (!isObject2(arg) || !isString(arg.message)) {
return void 0;
}
if (Number.isInteger(arg.status)) {
@@ -168089,7 +168097,7 @@ function getArtifactSuffix(matrix) {
if (matrix) {
try {
const matrixObject = JSON.parse(matrix);
if (matrixObject !== null && typeof matrixObject === "object") {
if (isObject2(matrixObject)) {
for (const matrixKey of Object.keys(matrixObject).sort())
suffix += `-${matrixObject[matrixKey]}`;
} else {
@@ -169230,7 +169238,7 @@ function locationUpdateCallback(result, location, logger) {
}
function resolveUriToFile(location, artifacts, sourceRoot, logger) {
if (!location.uri && location.index !== void 0) {
if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || typeof artifacts[location.index].location !== "object") {
if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || !isObject2(artifacts[location.index].location)) {
logger.debug(`Ignoring location as index "${location.index}" is invalid`);
return void 0;
}
+23 -15
View File
@@ -53438,8 +53438,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -57925,7 +57925,7 @@ var require_commonjs4 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID2;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -57972,7 +57972,7 @@ var require_commonjs4 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID2() {
@@ -99984,7 +99984,7 @@ var require_follow_redirects = __commonJS({
if (this._ending) {
throw new WriteAfterEndError();
}
if (!isString2(data) && !isBuffer(data)) {
if (!isString3(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
@@ -100239,7 +100239,7 @@ var require_follow_redirects = __commonJS({
function request2(input, options, callback) {
if (isURL(input)) {
input = spreadUrlObject(input);
} else if (isString2(input)) {
} else if (isString3(input)) {
input = spreadUrlObject(parseUrl2(input));
} else {
callback = options;
@@ -100255,7 +100255,7 @@ var require_follow_redirects = __commonJS({
maxBodyLength: exports3.maxBodyLength
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString2(options.host) && !isString2(options.hostname)) {
if (!isString3(options.host) && !isString3(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
@@ -100282,7 +100282,7 @@ var require_follow_redirects = __commonJS({
parsed = new URL2(input);
} else {
parsed = validateUrl(url.parse(input));
if (!isString2(parsed.protocol)) {
if (!isString3(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
@@ -100354,11 +100354,11 @@ var require_follow_redirects = __commonJS({
request2.destroy(error3);
}
function isSubdomain(subdomain, domain) {
assert(isString2(subdomain) && isString2(domain));
assert(isString3(subdomain) && isString3(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString2(value) {
function isString3(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
@@ -103107,6 +103107,14 @@ var semver = __toESM(require_semver2());
var maximumVersion = "3.21";
var minimumVersion = "3.14";
// src/json/index.ts
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
function isString(value) {
return typeof value === "string";
}
// src/util.ts
var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
var BROKEN_VERSIONS = ["0.0.0-20211207"];
@@ -103420,7 +103428,7 @@ var HTTPError = class extends Error {
var ConfigurationError = class extends Error {
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
if (!isObject2(arg) || !isString(arg.message)) {
return void 0;
}
if (Number.isInteger(arg.status)) {
@@ -104300,16 +104308,16 @@ var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => {
RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs";
return RepositoryPropertyName2;
})(RepositoryPropertyName || {});
function isString(value) {
function isString2(value) {
return typeof value === "string";
}
var stringProperty = {
validate: isString,
validate: isString2,
parse: parseStringRepositoryProperty
};
var booleanProperty = {
// The value from the API should come as a string, which we then parse into a boolean.
validate: isString,
validate: isString2,
parse: parseBooleanRepositoryProperty
};
var repositoryPropertyParsers = {
@@ -105895,7 +105903,7 @@ async function getOverlayStatus(codeql, languages, diskUsage, logger) {
}
const contents = await fs5.promises.readFile(statusFile, "utf-8");
const parsed = JSON.parse(contents);
if (typeof parsed !== "object" || parsed === null || typeof parsed["attemptedToBuildOverlayBaseDatabase"] !== "boolean" || typeof parsed["builtOverlayBaseDatabase"] !== "boolean") {
if (!isObject2(parsed) || typeof parsed["attemptedToBuildOverlayBaseDatabase"] !== "boolean" || typeof parsed["builtOverlayBaseDatabase"] !== "boolean") {
logger.debug(
"Ignoring overlay status cache entry with unexpected format."
);
+19 -11
View File
@@ -53287,8 +53287,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -57774,7 +57774,7 @@ var require_commonjs4 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -57821,7 +57821,7 @@ var require_commonjs4 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID() {
@@ -99833,7 +99833,7 @@ var require_follow_redirects = __commonJS({
if (this._ending) {
throw new WriteAfterEndError();
}
if (!isString(data) && !isBuffer(data)) {
if (!isString2(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
@@ -100088,7 +100088,7 @@ var require_follow_redirects = __commonJS({
function request2(input, options, callback) {
if (isURL(input)) {
input = spreadUrlObject(input);
} else if (isString(input)) {
} else if (isString2(input)) {
input = spreadUrlObject(parseUrl2(input));
} else {
callback = options;
@@ -100104,7 +100104,7 @@ var require_follow_redirects = __commonJS({
maxBodyLength: exports3.maxBodyLength
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString(options.host) && !isString(options.hostname)) {
if (!isString2(options.host) && !isString2(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
@@ -100131,7 +100131,7 @@ var require_follow_redirects = __commonJS({
parsed = new URL2(input);
} else {
parsed = validateUrl(url.parse(input));
if (!isString(parsed.protocol)) {
if (!isString2(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
@@ -100203,11 +100203,11 @@ var require_follow_redirects = __commonJS({
request2.destroy(error3);
}
function isSubdomain(subdomain, domain) {
assert(isString(subdomain) && isString(domain));
assert(isString2(subdomain) && isString2(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString(value) {
function isString2(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
@@ -102888,6 +102888,14 @@ var semver = __toESM(require_semver2());
var maximumVersion = "3.21";
var minimumVersion = "3.14";
// src/json/index.ts
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
function isString(value) {
return typeof value === "string";
}
// src/util.ts
var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
var GITHUB_DOTCOM_URL = "https://github.com";
@@ -102988,7 +102996,7 @@ var HTTPError = class extends Error {
var ConfigurationError = class extends Error {
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
if (!isObject2(arg) || !isString(arg.message)) {
return void 0;
}
if (Number.isInteger(arg.status)) {
+19 -11
View File
@@ -51990,8 +51990,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -56477,7 +56477,7 @@ var require_commonjs4 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID2;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -56524,7 +56524,7 @@ var require_commonjs4 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID2() {
@@ -99833,7 +99833,7 @@ var require_follow_redirects = __commonJS({
if (this._ending) {
throw new WriteAfterEndError();
}
if (!isString(data) && !isBuffer(data)) {
if (!isString2(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
@@ -100088,7 +100088,7 @@ var require_follow_redirects = __commonJS({
function request2(input, options, callback) {
if (isURL(input)) {
input = spreadUrlObject(input);
} else if (isString(input)) {
} else if (isString2(input)) {
input = spreadUrlObject(parseUrl2(input));
} else {
callback = options;
@@ -100104,7 +100104,7 @@ var require_follow_redirects = __commonJS({
maxBodyLength: exports3.maxBodyLength
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString(options.host) && !isString(options.hostname)) {
if (!isString2(options.host) && !isString2(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
@@ -100131,7 +100131,7 @@ var require_follow_redirects = __commonJS({
parsed = new URL2(input);
} else {
parsed = validateUrl(url.parse(input));
if (!isString(parsed.protocol)) {
if (!isString2(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
@@ -100203,11 +100203,11 @@ var require_follow_redirects = __commonJS({
request2.destroy(error3);
}
function isSubdomain(subdomain, domain) {
assert(isString(subdomain) && isString(domain));
assert(isString2(subdomain) && isString2(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString(value) {
function isString2(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
@@ -102944,6 +102944,14 @@ var semver = __toESM(require_semver2());
var maximumVersion = "3.21";
var minimumVersion = "3.14";
// src/json/index.ts
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
function isString(value) {
return typeof value === "string";
}
// src/util.ts
var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
var BROKEN_VERSIONS = ["0.0.0-20211207"];
@@ -103061,7 +103069,7 @@ var HTTPError = class extends Error {
var ConfigurationError = class extends Error {
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
if (!isObject2(arg) || !isString(arg.message)) {
return void 0;
}
if (Number.isInteger(arg.status)) {
+35 -30
View File
@@ -53287,8 +53287,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -57774,7 +57774,7 @@ var require_commonjs4 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -57821,7 +57821,7 @@ var require_commonjs4 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID() {
@@ -105592,10 +105592,10 @@ var require_util20 = __commonJS({
return typeof arg === "number";
}
exports2.isNumber = isNumber;
function isString(arg) {
function isString2(arg) {
return typeof arg === "string";
}
exports2.isString = isString;
exports2.isString = isString2;
function isSymbol(arg) {
return typeof arg === "symbol";
}
@@ -105608,10 +105608,10 @@ var require_util20 = __commonJS({
return objectToString(re) === "[object RegExp]";
}
exports2.isRegExp = isRegExp;
function isObject2(arg) {
function isObject3(arg) {
return typeof arg === "object" && arg !== null;
}
exports2.isObject = isObject2;
exports2.isObject = isObject3;
function isDate(d) {
return objectToString(d) === "[object Date]";
}
@@ -107653,11 +107653,11 @@ var require_baseGetTag = __commonJS({
// node_modules/lodash/isObject.js
var require_isObject = __commonJS({
"node_modules/lodash/isObject.js"(exports2, module2) {
function isObject2(value) {
function isObject3(value) {
var type2 = typeof value;
return value != null && (type2 == "object" || type2 == "function");
}
module2.exports = isObject2;
module2.exports = isObject3;
}
});
@@ -107665,13 +107665,13 @@ var require_isObject = __commonJS({
var require_isFunction = __commonJS({
"node_modules/lodash/isFunction.js"(exports2, module2) {
var baseGetTag = require_baseGetTag();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var asyncTag = "[object AsyncFunction]";
var funcTag = "[object Function]";
var genTag = "[object GeneratorFunction]";
var proxyTag = "[object Proxy]";
function isFunction(value) {
if (!isObject2(value)) {
if (!isObject3(value)) {
return false;
}
var tag = baseGetTag(value);
@@ -107732,7 +107732,7 @@ var require_baseIsNative = __commonJS({
"node_modules/lodash/_baseIsNative.js"(exports2, module2) {
var isFunction = require_isFunction();
var isMasked = require_isMasked();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var toSource = require_toSource();
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor = /^\[object .+?Constructor\]$/;
@@ -107744,7 +107744,7 @@ var require_baseIsNative = __commonJS({
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function baseIsNative(value) {
if (!isObject2(value) || isMasked(value)) {
if (!isObject3(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
@@ -107912,9 +107912,9 @@ var require_isIterateeCall = __commonJS({
var eq = require_eq2();
var isArrayLike = require_isArrayLike();
var isIndex = require_isIndex();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
function isIterateeCall(value, index, object) {
if (!isObject2(object)) {
if (!isObject3(object)) {
return false;
}
var type2 = typeof index;
@@ -108159,13 +108159,13 @@ var require_nativeKeysIn = __commonJS({
// node_modules/lodash/_baseKeysIn.js
var require_baseKeysIn = __commonJS({
"node_modules/lodash/_baseKeysIn.js"(exports2, module2) {
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var isPrototype = require_isPrototype();
var nativeKeysIn = require_nativeKeysIn();
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function baseKeysIn(object) {
if (!isObject2(object)) {
if (!isObject3(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object), result = [];
@@ -108657,7 +108657,7 @@ var require_event_target_shim = __commonJS({
var CAPTURE = 1;
var BUBBLE = 2;
var ATTRIBUTE = 3;
function isObject2(x) {
function isObject3(x) {
return x !== null && typeof x === "object";
}
function getListeners(eventTarget) {
@@ -108683,7 +108683,7 @@ var require_event_target_shim = __commonJS({
return null;
},
set(listener) {
if (typeof listener !== "function" && !isObject2(listener)) {
if (typeof listener !== "function" && !isObject3(listener)) {
listener = null;
}
const listeners = getListeners(this);
@@ -108774,11 +108774,11 @@ var require_event_target_shim = __commonJS({
if (listener == null) {
return;
}
if (typeof listener !== "function" && !isObject2(listener)) {
if (typeof listener !== "function" && !isObject3(listener)) {
throw new TypeError("'listener' should be a function or an object.");
}
const listeners = getListeners(this);
const optionsIsObj = isObject2(options);
const optionsIsObj = isObject3(options);
const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
const listenerType = capture ? CAPTURE : BUBBLE;
const newNode = {
@@ -108815,7 +108815,7 @@ var require_event_target_shim = __commonJS({
return;
}
const listeners = getListeners(this);
const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options);
const capture = isObject3(options) ? Boolean(options.capture) : Boolean(options);
const listenerType = capture ? CAPTURE : BUBBLE;
let prev = null;
let node = listeners.get(eventName);
@@ -157941,7 +157941,7 @@ var require_follow_redirects = __commonJS({
if (this._ending) {
throw new WriteAfterEndError();
}
if (!isString(data) && !isBuffer(data)) {
if (!isString2(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
@@ -158196,7 +158196,7 @@ var require_follow_redirects = __commonJS({
function request2(input, options, callback) {
if (isURL(input)) {
input = spreadUrlObject(input);
} else if (isString(input)) {
} else if (isString2(input)) {
input = spreadUrlObject(parseUrl2(input));
} else {
callback = options;
@@ -158212,7 +158212,7 @@ var require_follow_redirects = __commonJS({
maxBodyLength: exports3.maxBodyLength
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString(options.host) && !isString(options.hostname)) {
if (!isString2(options.host) && !isString2(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
@@ -158239,7 +158239,7 @@ var require_follow_redirects = __commonJS({
parsed = new URL2(input);
} else {
parsed = validateUrl(url.parse(input));
if (!isString(parsed.protocol)) {
if (!isString2(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
@@ -158311,11 +158311,11 @@ var require_follow_redirects = __commonJS({
request2.destroy(error3);
}
function isSubdomain(subdomain, domain) {
assert(isString(subdomain) && isString(domain));
assert(isString2(subdomain) && isString2(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString(value) {
function isString2(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
@@ -160993,6 +160993,11 @@ var semver = __toESM(require_semver2());
var maximumVersion = "3.21";
var minimumVersion = "3.14";
// src/json/index.ts
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
// src/util.ts
var GITHUB_DOTCOM_URL = "https://github.com";
var MINIMUM_CGROUP_MEMORY_LIMIT_BYTES = 1024 * 1024;
@@ -161996,7 +162001,7 @@ function getArtifactSuffix(matrix) {
if (matrix) {
try {
const matrixObject = JSON.parse(matrix);
if (matrixObject !== null && typeof matrixObject === "object") {
if (isObject2(matrixObject)) {
for (const matrixKey of Object.keys(matrixObject).sort())
suffix += `-${matrixObject[matrixKey]}`;
} else {
+177 -43
View File
@@ -47642,12 +47642,12 @@ var require_concat_map = __commonJS({
var res = [];
for (var i = 0; i < xs.length; i++) {
var x = fn(xs[i], i);
if (isArray(x)) res.push.apply(res, x);
if (isArray2(x)) res.push.apply(res, x);
else res.push(x);
}
return res;
};
var isArray = Array.isArray || function(xs) {
var isArray2 = Array.isArray || function(xs) {
return Object.prototype.toString.call(xs) === "[object Array]";
};
}
@@ -51990,8 +51990,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -56477,7 +56477,7 @@ var require_commonjs4 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -56524,7 +56524,7 @@ var require_commonjs4 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID() {
@@ -63195,7 +63195,7 @@ var require_Credential = __commonJS({
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.Credential = void 0;
var Credential = class {
var Credential2 = class {
/**
* Creates a RequestPolicy object.
*
@@ -63206,7 +63206,7 @@ var require_Credential = __commonJS({
throw new Error("Method should be implemented in children classes.");
}
};
exports2.Credential = Credential;
exports2.Credential = Credential2;
}
});
@@ -64335,7 +64335,7 @@ var require_Credential2 = __commonJS({
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.Credential = void 0;
var Credential = class {
var Credential2 = class {
/**
* Creates a RequestPolicy object.
*
@@ -64346,7 +64346,7 @@ var require_Credential2 = __commonJS({
throw new Error("Method should be implemented in children classes.");
}
};
exports2.Credential = Credential;
exports2.Credential = Credential2;
}
});
@@ -120116,6 +120116,25 @@ var safeDump = renamed("safeDump", "dump");
// src/util.ts
var semver = __toESM(require_semver2());
// src/json/index.ts
function parseString(data) {
return JSON.parse(data);
}
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
function isArray(value) {
return Array.isArray(value);
}
function isString(value) {
return typeof value === "string";
}
function isStringOrUndefined(value) {
return value === void 0 || isString(value);
}
// src/util.ts
var GITHUB_DOTCOM_URL = "https://github.com";
var MINIMUM_CGROUP_MEMORY_LIMIT_BYTES = 1024 * 1024;
function parseGitHubUrl(inputUrl) {
@@ -120163,7 +120182,7 @@ var HTTPError = class extends Error {
var ConfigurationError = class extends Error {
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
if (!isObject2(arg) || !isString(arg.message)) {
return void 0;
}
if (Number.isInteger(arg.status)) {
@@ -121221,6 +121240,95 @@ var KnownLanguage = /* @__PURE__ */ ((KnownLanguage2) => {
return KnownLanguage2;
})(KnownLanguage || {});
// src/start-proxy/types.ts
function hasUsername(config) {
return "username" in config;
}
function isUsernamePassword(config) {
return hasUsername(config) && "password" in config;
}
function isToken(config) {
if ("username" in config && !isStringOrUndefined(config.username)) {
return false;
}
return "token" in config && isStringOrUndefined(config.token);
}
function isAzureConfig(config) {
return "tenant_id" in config && "client_id" in config && isDefined2(config.tenant_id) && isDefined2(config.client_id) && isString(config.tenant_id) && isString(config.client_id);
}
function isAWSConfig(config) {
const requiredProperties = [
"aws_region",
"account_id",
"role_name",
"domain",
"domain_owner"
];
for (const property of requiredProperties) {
if (!(property in config) || !isDefined2(config[property]) || !isString(config[property])) {
return false;
}
}
if ("audience" in config && !isStringOrUndefined(config.audience)) {
return false;
}
return true;
}
function isJFrogConfig(config) {
if ("audience" in config && !isStringOrUndefined(config.audience)) {
return false;
}
if ("identity_mapping_name" in config && !isStringOrUndefined(config.identity_mapping_name)) {
return false;
}
return "jfrog_oidc_provider_name" in config && isDefined2(config.jfrog_oidc_provider_name) && isString(config.jfrog_oidc_provider_name);
}
function credentialToStr(credential) {
let result = `Type: ${credential.type};`;
const appendIfDefined = (name, val) => {
if (isDefined2(val)) {
result += ` ${name}: ${val};`;
}
};
appendIfDefined("Url", credential.url);
appendIfDefined("Host", credential.host);
if (hasUsername(credential)) {
appendIfDefined("Username", credential.username);
}
if ("password" in credential) {
appendIfDefined(
"Password",
isDefined2(credential.password) ? "***" : void 0
);
}
if (isToken(credential)) {
appendIfDefined("Token", isDefined2(credential.token) ? "***" : void 0);
}
if (isAzureConfig(credential)) {
appendIfDefined("Tenant", credential.tenant_id);
appendIfDefined("Client", credential.client_id);
} else if (isAWSConfig(credential)) {
appendIfDefined("AWS Region", credential.aws_region);
appendIfDefined("AWS Account", credential.account_id);
appendIfDefined("AWS Role", credential.role_name);
appendIfDefined("AWS Domain", credential.domain);
appendIfDefined("AWS Domain Owner", credential.domain_owner);
appendIfDefined("AWS Audience", credential.audience);
} else if (isJFrogConfig(credential)) {
appendIfDefined("JFrog Provider", credential.jfrog_oidc_provider_name);
appendIfDefined("JFrog Identity Mapping", credential.identity_mapping_name);
appendIfDefined("JFrog Audience", credential.audience);
}
return result;
}
function getAddressString(address) {
if (address.url === void 0) {
return address.host;
} else {
return address.url;
}
}
// src/status-report.ts
var os = __toESM(require("os"));
var core9 = __toESM(require_core());
@@ -121491,15 +121599,6 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error
}
}
// src/start-proxy/types.ts
function getAddressString(address) {
if (address.url === void 0) {
return address.host;
} else {
return address.url;
}
}
// src/start-proxy.ts
function getStartProxyErrorMessage(errorType) {
switch (errorType) {
@@ -121610,12 +121709,12 @@ var NEW_LANGUAGE_TO_REGISTRY_TYPE = {
go: ["goproxy_server", "git_source"]
};
function getRegistryAddress(registry) {
if (isDefined2(registry.url)) {
if (isDefined2(registry.url) && isString(registry.url) && isStringOrUndefined(registry.host)) {
return {
url: registry.url,
host: registry.host
};
} else if (isDefined2(registry.host)) {
} else if (isDefined2(registry.host) && isString(registry.host)) {
return {
url: void 0,
host: registry.host
@@ -121626,6 +121725,48 @@ function getRegistryAddress(registry) {
);
}
}
function getAuthConfig(config) {
if (isAzureConfig(config)) {
return {
tenant_id: config.tenant_id,
client_id: config.client_id
};
} else if (isAWSConfig(config)) {
return {
aws_region: config.aws_region,
account_id: config.account_id,
role_name: config.role_name,
domain: config.domain,
domain_owner: config.domain_owner,
audience: config.audience
};
} else if (isJFrogConfig(config)) {
return {
jfrog_oidc_provider_name: config.jfrog_oidc_provider_name,
identity_mapping_name: config.identity_mapping_name,
audience: config.audience
};
} else if (isToken(config)) {
if (isDefined2(config.token)) {
core10.setSecret(config.token);
}
return { username: config.username, token: config.token };
} else {
let username = void 0;
let password = void 0;
if ("password" in config && isString(config.password)) {
core10.setSecret(config.password);
password = config.password;
}
if ("username" in config && isString(config.username)) {
username = config.username;
}
return {
username,
password
};
}
}
function getCredentials(logger, registrySecrets, registriesCredentials, language, skipUnusedRegistries = false) {
const registryMapping = skipUnusedRegistries ? NEW_LANGUAGE_TO_REGISTRY_TYPE : LANGUAGE_TO_REGISTRY_TYPE;
const registryTypeForLanguage = language ? registryMapping[language] : void 0;
@@ -121642,30 +121783,25 @@ function getCredentials(logger, registrySecrets, registriesCredentials, language
}
let parsed;
try {
parsed = JSON.parse(credentialsStr);
parsed = parseString(credentialsStr);
} catch {
logger.error("Failed to parse the credentials data.");
throw new ConfigurationError("Invalid credentials format.");
}
if (!Array.isArray(parsed)) {
if (!isArray(parsed)) {
throw new ConfigurationError(
"Expected credentials data to be an array of configurations, but it is not."
);
}
const out = [];
for (const e of parsed) {
if (e === null || typeof e !== "object") {
if (e === null || !isObject2(e)) {
throw new ConfigurationError("Invalid credentials - must be an object");
}
if (!isDefined2(e.type)) {
if (!isDefined2(e.type) || !isString(e.type)) {
throw new ConfigurationError("Invalid credentials - must have a type");
}
if (isDefined2(e.password)) {
core10.setSecret(e.password);
}
if (isDefined2(e.token)) {
core10.setSecret(e.token);
}
const authConfig = getAuthConfig(e);
const address = getRegistryAddress(e);
if (registryTypeForLanguage && !registryTypeForLanguage.some((t) => t === e.type)) {
continue;
@@ -121673,21 +121809,22 @@ function getCredentials(logger, registrySecrets, registriesCredentials, language
const isPrintable2 = (str2) => {
return str2 ? /^[\x20-\x7E]*$/.test(str2) : true;
};
if (!isPrintable2(e.type) || !isPrintable2(e.host) || !isPrintable2(e.url) || !isPrintable2(e.username) || !isPrintable2(e.password) || !isPrintable2(e.token)) {
throw new ConfigurationError(
"Invalid credentials - fields must contain only printable characters"
);
for (const key of Object.keys(e)) {
const val = e[key];
if (typeof val === "string" && !isPrintable2(val)) {
throw new ConfigurationError(
"Invalid credentials - fields must contain only printable characters"
);
}
}
if (!isDefined2(e.username) && (isDefined2(e.password) && isPAT(e.password) || isDefined2(e.token) && isPAT(e.token))) {
if ((!hasUsername(authConfig) || !isDefined2(authConfig.username)) && isUsernamePassword(authConfig) && isDefined2(authConfig.password) && isPAT(authConfig.password) || isToken(authConfig) && isDefined2(authConfig.token) && isPAT(authConfig.token)) {
logger.warning(
`A ${e.type} private registry is configured for ${e.host || e.url} using a GitHub Personal Access Token (PAT), but no username was provided. This may not work correctly. When configuring a private registry using a PAT, select "Username and password" and enter the username of the user who generated the PAT.`
);
}
out.push({
type: e.type,
username: e.username,
password: e.password,
token: e.token,
...authConfig,
...address
});
}
@@ -121749,9 +121886,6 @@ async function getDownloadUrl(logger, features) {
version: UPDATEJOB_PROXY_VERSION
};
}
function credentialToStr(c) {
return `Type: ${c.type}; Host: ${c.host}; Url: ${c.url} Username: ${c.username}; Password: ${c.password !== void 0}; Token: ${c.token !== void 0}`;
}
async function downloadProxy(logger, url, authorization) {
try {
return toolcache.downloadTool(
+22 -12
View File
@@ -53287,8 +53287,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -57774,7 +57774,7 @@ var require_commonjs4 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID2;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -57821,7 +57821,7 @@ var require_commonjs4 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID2() {
@@ -99833,7 +99833,7 @@ var require_follow_redirects = __commonJS({
if (this._ending) {
throw new WriteAfterEndError();
}
if (!isString(data) && !isBuffer(data)) {
if (!isString2(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
@@ -100088,7 +100088,7 @@ var require_follow_redirects = __commonJS({
function request2(input, options, callback) {
if (isURL(input)) {
input = spreadUrlObject(input);
} else if (isString(input)) {
} else if (isString2(input)) {
input = spreadUrlObject(parseUrl2(input));
} else {
callback = options;
@@ -100104,7 +100104,7 @@ var require_follow_redirects = __commonJS({
maxBodyLength: exports3.maxBodyLength
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString(options.host) && !isString(options.hostname)) {
if (!isString2(options.host) && !isString2(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
@@ -100131,7 +100131,7 @@ var require_follow_redirects = __commonJS({
parsed = new URL2(input);
} else {
parsed = validateUrl(url2.parse(input));
if (!isString(parsed.protocol)) {
if (!isString2(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
@@ -100203,11 +100203,11 @@ var require_follow_redirects = __commonJS({
request2.destroy(error3);
}
function isSubdomain(subdomain, domain) {
assert(isString(subdomain) && isString(domain));
assert(isString2(subdomain) && isString2(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString(value) {
function isString2(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
@@ -105806,6 +105806,16 @@ var safeDump = renamed("safeDump", "dump");
// src/util.ts
var semver = __toESM(require_semver2());
// src/json/index.ts
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
function isString(value) {
return typeof value === "string";
}
// src/util.ts
var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
var BROKEN_VERSIONS = ["0.0.0-20211207"];
var GITHUB_DOTCOM_URL = "https://github.com";
@@ -105889,7 +105899,7 @@ var HTTPError = class extends Error {
var ConfigurationError = class extends Error {
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
if (!isObject2(arg) || !isString(arg.message)) {
return void 0;
}
if (Number.isInteger(arg.status)) {
@@ -109995,7 +110005,7 @@ function locationUpdateCallback(result, location, logger) {
}
function resolveUriToFile(location, artifacts, sourceRoot, logger) {
if (!location.uri && location.index !== void 0) {
if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || typeof artifacts[location.index].location !== "object") {
if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || !isObject2(artifacts[location.index].location)) {
logger.debug(`Ignoring location as index "${location.index}" is invalid`);
return void 0;
}
+35 -30
View File
@@ -55500,8 +55500,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -59987,7 +59987,7 @@ var require_commonjs6 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -60034,7 +60034,7 @@ var require_commonjs6 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID() {
@@ -97776,10 +97776,10 @@ var require_util19 = __commonJS({
return typeof arg === "number";
}
exports2.isNumber = isNumber;
function isString(arg) {
function isString2(arg) {
return typeof arg === "string";
}
exports2.isString = isString;
exports2.isString = isString2;
function isSymbol(arg) {
return typeof arg === "symbol";
}
@@ -97792,10 +97792,10 @@ var require_util19 = __commonJS({
return objectToString(re) === "[object RegExp]";
}
exports2.isRegExp = isRegExp;
function isObject2(arg) {
function isObject3(arg) {
return typeof arg === "object" && arg !== null;
}
exports2.isObject = isObject2;
exports2.isObject = isObject3;
function isDate(d) {
return objectToString(d) === "[object Date]";
}
@@ -99837,11 +99837,11 @@ var require_baseGetTag = __commonJS({
// node_modules/lodash/isObject.js
var require_isObject = __commonJS({
"node_modules/lodash/isObject.js"(exports2, module2) {
function isObject2(value) {
function isObject3(value) {
var type2 = typeof value;
return value != null && (type2 == "object" || type2 == "function");
}
module2.exports = isObject2;
module2.exports = isObject3;
}
});
@@ -99849,13 +99849,13 @@ var require_isObject = __commonJS({
var require_isFunction = __commonJS({
"node_modules/lodash/isFunction.js"(exports2, module2) {
var baseGetTag = require_baseGetTag();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var asyncTag = "[object AsyncFunction]";
var funcTag = "[object Function]";
var genTag = "[object GeneratorFunction]";
var proxyTag = "[object Proxy]";
function isFunction(value) {
if (!isObject2(value)) {
if (!isObject3(value)) {
return false;
}
var tag = baseGetTag(value);
@@ -99916,7 +99916,7 @@ var require_baseIsNative = __commonJS({
"node_modules/lodash/_baseIsNative.js"(exports2, module2) {
var isFunction = require_isFunction();
var isMasked = require_isMasked();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var toSource = require_toSource();
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor = /^\[object .+?Constructor\]$/;
@@ -99928,7 +99928,7 @@ var require_baseIsNative = __commonJS({
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function baseIsNative(value) {
if (!isObject2(value) || isMasked(value)) {
if (!isObject3(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
@@ -100096,9 +100096,9 @@ var require_isIterateeCall = __commonJS({
var eq = require_eq2();
var isArrayLike = require_isArrayLike();
var isIndex = require_isIndex();
var isObject2 = require_isObject();
var isObject3 = require_isObject();
function isIterateeCall(value, index, object) {
if (!isObject2(object)) {
if (!isObject3(object)) {
return false;
}
var type2 = typeof index;
@@ -100343,13 +100343,13 @@ var require_nativeKeysIn = __commonJS({
// node_modules/lodash/_baseKeysIn.js
var require_baseKeysIn = __commonJS({
"node_modules/lodash/_baseKeysIn.js"(exports2, module2) {
var isObject2 = require_isObject();
var isObject3 = require_isObject();
var isPrototype = require_isPrototype();
var nativeKeysIn = require_nativeKeysIn();
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function baseKeysIn(object) {
if (!isObject2(object)) {
if (!isObject3(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object), result = [];
@@ -100841,7 +100841,7 @@ var require_event_target_shim = __commonJS({
var CAPTURE = 1;
var BUBBLE = 2;
var ATTRIBUTE = 3;
function isObject2(x) {
function isObject3(x) {
return x !== null && typeof x === "object";
}
function getListeners(eventTarget) {
@@ -100867,7 +100867,7 @@ var require_event_target_shim = __commonJS({
return null;
},
set(listener) {
if (typeof listener !== "function" && !isObject2(listener)) {
if (typeof listener !== "function" && !isObject3(listener)) {
listener = null;
}
const listeners = getListeners(this);
@@ -100958,11 +100958,11 @@ var require_event_target_shim = __commonJS({
if (listener == null) {
return;
}
if (typeof listener !== "function" && !isObject2(listener)) {
if (typeof listener !== "function" && !isObject3(listener)) {
throw new TypeError("'listener' should be a function or an object.");
}
const listeners = getListeners(this);
const optionsIsObj = isObject2(options);
const optionsIsObj = isObject3(options);
const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
const listenerType = capture ? CAPTURE : BUBBLE;
const newNode = {
@@ -100999,7 +100999,7 @@ var require_event_target_shim = __commonJS({
return;
}
const listeners = getListeners(this);
const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options);
const capture = isObject3(options) ? Boolean(options.capture) : Boolean(options);
const listenerType = capture ? CAPTURE : BUBBLE;
let prev = null;
let node = listeners.get(eventName);
@@ -157941,7 +157941,7 @@ var require_follow_redirects = __commonJS({
if (this._ending) {
throw new WriteAfterEndError();
}
if (!isString(data) && !isBuffer(data)) {
if (!isString2(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
@@ -158196,7 +158196,7 @@ var require_follow_redirects = __commonJS({
function request2(input, options, callback) {
if (isURL(input)) {
input = spreadUrlObject(input);
} else if (isString(input)) {
} else if (isString2(input)) {
input = spreadUrlObject(parseUrl2(input));
} else {
callback = options;
@@ -158212,7 +158212,7 @@ var require_follow_redirects = __commonJS({
maxBodyLength: exports3.maxBodyLength
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString(options.host) && !isString(options.hostname)) {
if (!isString2(options.host) && !isString2(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
@@ -158239,7 +158239,7 @@ var require_follow_redirects = __commonJS({
parsed = new URL2(input);
} else {
parsed = validateUrl(url.parse(input));
if (!isString(parsed.protocol)) {
if (!isString2(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
@@ -158311,11 +158311,11 @@ var require_follow_redirects = __commonJS({
request2.destroy(error3);
}
function isSubdomain(subdomain, domain) {
assert(isString(subdomain) && isString(domain));
assert(isString2(subdomain) && isString2(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString(value) {
function isString2(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
@@ -160993,6 +160993,11 @@ var semver = __toESM(require_semver2());
var maximumVersion = "3.21";
var minimumVersion = "3.14";
// src/json/index.ts
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
// src/util.ts
var GITHUB_DOTCOM_URL = "https://github.com";
var MINIMUM_CGROUP_MEMORY_LIMIT_BYTES = 1024 * 1024;
@@ -162018,7 +162023,7 @@ function getArtifactSuffix(matrix) {
if (matrix) {
try {
const matrixObject = JSON.parse(matrix);
if (matrixObject !== null && typeof matrixObject === "object") {
if (isObject2(matrixObject)) {
for (const matrixKey of Object.keys(matrixObject).sort())
suffix += `-${matrixObject[matrixKey]}`;
} else {
+22 -12
View File
@@ -51990,8 +51990,8 @@ var require_object = __commonJS({
"node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) {
"use strict";
Object.defineProperty(exports2, "__esModule", { value: true });
exports2.isObject = isObject2;
function isObject2(input) {
exports2.isObject = isObject3;
function isObject3(input) {
return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date);
}
}
@@ -56477,7 +56477,7 @@ var require_commonjs4 = __commonJS({
exports2.computeSha256Hmac = computeSha256Hmac;
exports2.getRandomIntegerInclusive = getRandomIntegerInclusive;
exports2.isError = isError;
exports2.isObject = isObject2;
exports2.isObject = isObject3;
exports2.randomUUID = randomUUID2;
exports2.uint8ArrayToString = uint8ArrayToString;
exports2.stringToUint8Array = stringToUint8Array;
@@ -56524,7 +56524,7 @@ var require_commonjs4 = __commonJS({
function isError(e) {
return tspRuntime.isError(e);
}
function isObject2(input) {
function isObject3(input) {
return tspRuntime.isObject(input);
}
function randomUUID2() {
@@ -99833,7 +99833,7 @@ var require_follow_redirects = __commonJS({
if (this._ending) {
throw new WriteAfterEndError();
}
if (!isString(data) && !isBuffer(data)) {
if (!isString2(data) && !isBuffer(data)) {
throw new TypeError("data should be a string, Buffer or Uint8Array");
}
if (isFunction(encoding)) {
@@ -100088,7 +100088,7 @@ var require_follow_redirects = __commonJS({
function request2(input, options, callback) {
if (isURL(input)) {
input = spreadUrlObject(input);
} else if (isString(input)) {
} else if (isString2(input)) {
input = spreadUrlObject(parseUrl2(input));
} else {
callback = options;
@@ -100104,7 +100104,7 @@ var require_follow_redirects = __commonJS({
maxBodyLength: exports3.maxBodyLength
}, input, options);
options.nativeProtocols = nativeProtocols;
if (!isString(options.host) && !isString(options.hostname)) {
if (!isString2(options.host) && !isString2(options.hostname)) {
options.hostname = "::1";
}
assert.equal(options.protocol, protocol, "protocol mismatch");
@@ -100131,7 +100131,7 @@ var require_follow_redirects = __commonJS({
parsed = new URL2(input);
} else {
parsed = validateUrl(url2.parse(input));
if (!isString(parsed.protocol)) {
if (!isString2(parsed.protocol)) {
throw new InvalidUrlError({ input });
}
}
@@ -100203,11 +100203,11 @@ var require_follow_redirects = __commonJS({
request2.destroy(error3);
}
function isSubdomain(subdomain, domain) {
assert(isString(subdomain) && isString(domain));
assert(isString2(subdomain) && isString2(domain));
var dot = subdomain.length - domain.length - 1;
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
}
function isString(value) {
function isString2(value) {
return typeof value === "string" || value instanceof String;
}
function isFunction(value) {
@@ -105781,6 +105781,16 @@ var safeDump = renamed("safeDump", "dump");
// src/util.ts
var semver = __toESM(require_semver2());
// src/json/index.ts
function isObject2(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
function isString(value) {
return typeof value === "string";
}
// src/util.ts
var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
var BROKEN_VERSIONS = ["0.0.0-20211207"];
var GITHUB_DOTCOM_URL = "https://github.com";
@@ -105871,7 +105881,7 @@ var HTTPError = class extends Error {
var ConfigurationError = class extends Error {
};
function asHTTPError(arg) {
if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") {
if (!isObject2(arg) || !isString(arg.message)) {
return void 0;
}
if (Number.isInteger(arg.status)) {
@@ -110658,7 +110668,7 @@ function locationUpdateCallback(result, location, logger) {
}
function resolveUriToFile(location, artifacts, sourceRoot, logger) {
if (!location.uri && location.index !== void 0) {
if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || typeof artifacts[location.index].location !== "object") {
if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || !isObject2(artifacts[location.index].location)) {
logger.debug(`Ignoring location as index "${location.index}" is invalid`);
return void 0;
}