@google-cloud/logging
Advanced tools
Comparing version 10.1.1 to 10.1.2
@@ -299,5 +299,10 @@ "use strict"; | ||
delete reqOpts.gaxOptions; | ||
const gaxOptions = extend({ | ||
let gaxOptions = extend({ | ||
autoPaginate: options.autoPaginate, | ||
}, options.gaxOptions); | ||
if (options === null || options === void 0 ? void 0 : options.maxResults) { | ||
gaxOptions = extend({ | ||
maxResults: options.maxResults, | ||
}, gaxOptions); | ||
} | ||
const resp = await this.loggingService.listLogEntries(reqOpts, gaxOptions); | ||
@@ -304,0 +309,0 @@ const [entries] = resp; |
@@ -132,3 +132,3 @@ "use strict"; | ||
* when it is longer than {maxLen} chars and '*' is added instead of truncated suffix. | ||
* @param value {string} The value to be truncated. | ||
* @param value {object|string} The value to be truncated. | ||
* @param maxLen {number} The max length to be used for truncation. | ||
@@ -138,2 +138,19 @@ * @returns {string} The truncated value. | ||
function truncateValue(value, maxLen) { | ||
// Currently there are cases when we get here JSON object instead of string | ||
// Adding here additional validation to see if version still can be retrieved | ||
if (typeof value !== 'string') { | ||
try { | ||
if (Object.prototype.hasOwnProperty.call(value, 'version')) { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
value = value.version; | ||
} | ||
} | ||
catch (err) { | ||
// Ignore error since flow should continue | ||
} | ||
} | ||
// Return 'unknown' if version cannot be retrieved | ||
if (typeof value !== 'string') { | ||
return 'unknown'; | ||
} | ||
if (value && value.length > maxLen) { | ||
@@ -140,0 +157,0 @@ return value.substring(0, maxLen).concat('*'); |
{ | ||
"name": "@google-cloud/logging", | ||
"version": "10.1.1", | ||
"description": "Stackdriver Logging Client Library for Node.js", | ||
"version": "10.1.2", | ||
"description": "Cloud Logging Client Library for Node.js", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "google apis client", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
4189629
70770