builder-util-runtime
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -36,7 +36,3 @@ "use strict"; | ||
} | ||
bintrayRequest(path, auth) { | ||
let data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
let cancellationToken = arguments[3]; | ||
let method = arguments[4]; | ||
bintrayRequest(path, auth, data = null, cancellationToken, method) { | ||
return (0, (_httpExecutor || _load_httpExecutor()).parseJson)(this.httpExecutor.request((0, (_httpExecutor || _load_httpExecutor()).configureRequestOptions)({ hostname: "api.bintray.com", path, headers: this.requestHeaders || undefined }, auth, method), cancellationToken, data)); | ||
@@ -43,0 +39,0 @@ } |
@@ -14,4 +14,3 @@ export declare const BLOCK_MAP_FILE_NAME = "_blockMap.yml"; | ||
offset: number; | ||
size: number; | ||
} | ||
export declare function readBlockMapDataFromAppImage(file: string): Promise<any>; |
@@ -55,5 +55,3 @@ "use strict"; | ||
class HttpError extends Error { | ||
constructor(response) { | ||
let description = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | ||
constructor(response, description = null) { | ||
super(response.statusCode + " " + response.statusMessage + (description == null ? "" : "\n" + JSON.stringify(description, null, " ")) + "\nHeaders: " + JSON.stringify(response.headers, null, " ")); | ||
@@ -73,6 +71,3 @@ this.response = response; | ||
} | ||
request(options) { | ||
let cancellationToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new (_CancellationToken || _load_CancellationToken()).CancellationToken(); | ||
let data = arguments[2]; | ||
request(options, cancellationToken = new (_CancellationToken || _load_CancellationToken()).CancellationToken(), data) { | ||
configureRequestOptions(options); | ||
@@ -87,5 +82,3 @@ const encodedData = data == null ? undefined : Buffer.from(JSON.stringify(data)); | ||
} | ||
doApiRequest(options, cancellationToken, requestProcessor) { | ||
let redirectCount = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; | ||
doApiRequest(options, cancellationToken, requestProcessor, redirectCount = 0) { | ||
if (debug.enabled) { | ||
@@ -149,3 +142,3 @@ debug(`Request: ${safeStringifyJson(options)}`); | ||
const contentType = safeGetHeader(response, "content-type"); | ||
const isJson = contentType != null && (Array.isArray(contentType) ? contentType.find(it => it.indexOf("json") !== -1) != null : contentType.indexOf("json") !== -1); | ||
const isJson = contentType != null && (Array.isArray(contentType) ? contentType.find(it => it.includes("json")) != null : contentType.includes("json")); | ||
reject(new HttpError(response, isJson ? JSON.parse(data) : data)); | ||
@@ -206,6 +199,3 @@ } else { | ||
class DigestTransform extends (_stream || _load_stream()).Transform { | ||
constructor(expected) { | ||
let algorithm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "sha512"; | ||
let encoding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "base64"; | ||
constructor(expected, algorithm = "sha512", encoding = "base64") { | ||
super(); | ||
@@ -285,3 +275,3 @@ this.expected = expected; | ||
if (sha512 != null) { | ||
streams.push(new DigestTransform(sha512, "sha512", sha512.length === 128 && !(sha512.indexOf("+") !== -1) && !(sha512.indexOf("Z") !== -1) && !(sha512.indexOf("=") !== -1) ? "hex" : "base64")); | ||
streams.push(new DigestTransform(sha512, "sha512", sha512.length === 128 && !sha512.includes("+") && !sha512.includes("Z") && !sha512.includes("=") ? "hex" : "base64")); | ||
} else if (options.sha2 != null) { | ||
@@ -331,3 +321,3 @@ streams.push(new DigestTransform(options.sha2, "sha256", "hex")); | ||
return JSON.stringify(data, (name, value) => { | ||
if (name.endsWith("authorization") || name.endsWith("Password") || name.endsWith("PASSWORD") || name.endsWith("Token") || name.indexOf("password") !== -1 || name.indexOf("token") !== -1 || skippedNames != null && skippedNames.has(name)) { | ||
if (name.endsWith("authorization") || name.endsWith("Password") || name.endsWith("PASSWORD") || name.endsWith("Token") || name.includes("password") || name.includes("token") || skippedNames != null && skippedNames.has(name)) { | ||
return "<stripped sensitive data>"; | ||
@@ -334,0 +324,0 @@ } |
@@ -9,5 +9,3 @@ "use strict"; | ||
/** @private */ | ||
function githubUrl(options) { | ||
let defaultHost = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "github.com"; | ||
function githubUrl(options, defaultHost = "github.com") { | ||
return `${options.protocol || "https"}://${options.host || defaultHost}`; | ||
@@ -27,3 +25,3 @@ } | ||
let url; | ||
if (!(options.bucket.indexOf(".") !== -1)) { | ||
if (!options.bucket.includes(".")) { | ||
if (options.region === "cn-north-1") { | ||
@@ -30,0 +28,0 @@ url = `https://${options.bucket}.s3.${options.region}.amazonaws.com.cn`; |
@@ -72,5 +72,3 @@ "use strict"; | ||
} | ||
static check(uuid) { | ||
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; | ||
static check(uuid, offset = 0) { | ||
if (typeof uuid === "string") { | ||
@@ -153,5 +151,3 @@ uuid = uuid.toLowerCase(); | ||
// v1 | ||
function uuidTimeBased(nodeId) { | ||
let encoding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : UuidEncoding.ASCII; | ||
function uuidTimeBased(nodeId, encoding = UuidEncoding.ASCII) { | ||
let mTime = Date.now(); | ||
@@ -213,5 +209,3 @@ let nTime = lastNTime + 1; | ||
// v3 + v5 | ||
function uuidNamed(name, hashMethod, version, namespace) { | ||
let encoding = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : UuidEncoding.ASCII; | ||
function uuidNamed(name, hashMethod, version, namespace, encoding = UuidEncoding.ASCII) { | ||
const hash = (0, (_crypto || _load_crypto()).createHash)(hashMethod); | ||
@@ -218,0 +212,0 @@ if (typeof namespace === "string") { |
@@ -43,6 +43,3 @@ "use strict"; | ||
} | ||
element(name) { | ||
let ignoreCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
let errorIfMissed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | ||
element(name, ignoreCase = false, errorIfMissed = null) { | ||
const result = this.elementOrNull(name, ignoreCase); | ||
@@ -54,5 +51,3 @@ if (result === null) { | ||
} | ||
elementOrNull(name) { | ||
let ignoreCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
elementOrNull(name, ignoreCase = false) { | ||
if (this.elements === null) { | ||
@@ -68,5 +63,3 @@ return null; | ||
} | ||
getElements(name) { | ||
let ignoreCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
getElements(name, ignoreCase = false) { | ||
if (this.elements === null) { | ||
@@ -77,5 +70,3 @@ return []; | ||
} | ||
elementValueOrEmpty(name) { | ||
let ignoreCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
elementValueOrEmpty(name, ignoreCase = false) { | ||
const element = this.elementOrNull(name, ignoreCase); | ||
@@ -82,0 +73,0 @@ return element === null ? "" : element.value; |
{ | ||
"name": "builder-util-runtime", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"main": "out/index.js", | ||
@@ -19,3 +19,3 @@ "author": "Vladimir Krivosheev", | ||
"fs-extra-p": "^4.4.4", | ||
"bluebird-lst": "^1.0.4", | ||
"bluebird-lst": "^1.0.5", | ||
"sax": "^1.2.4" | ||
@@ -22,0 +22,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
149855
1701
102
4
4
13
Updatedbluebird-lst@^1.0.5