@salesforce/core
Advanced tools
Comparing version 8.1.1 to 8.1.2
@@ -40,2 +40,3 @@ "use strict"; | ||
const kit_1 = require("@salesforce/kit"); | ||
const lifecycleEvents_1 = require("./lifecycleEvents"); | ||
const sfError_1 = require("./sfError"); | ||
@@ -523,4 +524,25 @@ const getKey = (packageName, bundleName) => `${packageName}:${bundleName}`; | ||
return messages.map((message) => { | ||
(0, ts_types_1.ensureString)(message); | ||
return util.format(message, ...tokens); | ||
const msgStr = (0, ts_types_1.ensureString)(message); | ||
// If the message does not contain a specifier, util.format still appends the token to the end. | ||
// The 'markdownLoader' automatically splits bulleted lists into arrays. | ||
// This causes the token to be appended to each line regardless of the presence of a specifier. | ||
// Here we check for the presence of a specifier and only format the message if one is present. | ||
// https://nodejs.org/api/util.html#utilformatformat-args | ||
// https://regex101.com/r/8Hf8Z6/1 | ||
const specifierRegex = new RegExp('%[sdifjoO]{1}', 'gm'); | ||
// NOTE: This is a temporary telemetry event to track down missing specifiers in messages. | ||
// Once we have enough data and correct missing specifiers, we can remove this. | ||
// The followup work is outlined in: W-16197665 | ||
if (!specifierRegex.test(msgStr) && tokens.length > 0) { | ||
void lifecycleEvents_1.Lifecycle.getInstance().emitTelemetry({ | ||
eventName: 'missing_message_specifier', | ||
library: 'sfdx-core', | ||
function: 'getMessageWithMap', | ||
messagesLength: messages.length, | ||
message: msgStr, | ||
tokensLength: tokens.length, | ||
}); | ||
} | ||
// return specifierRegex.test(msgStr) ? util.format(msgStr, ...tokens) : msgStr; | ||
return util.format(msgStr, ...tokens); | ||
}); | ||
@@ -527,0 +549,0 @@ } |
{ | ||
"name": "@salesforce/core", | ||
"version": "8.1.1", | ||
"version": "8.1.2", | ||
"description": "Core libraries to interact with SFDX projects, orgs, and APIs.", | ||
@@ -59,3 +59,3 @@ "main": "lib/index", | ||
"@salesforce/ts-types": "^2.0.10", | ||
"ajv": "^8.16.0", | ||
"ajv": "^8.17.1", | ||
"change-case": "^4.1.2", | ||
@@ -62,0 +62,0 @@ "fast-levenshtein": "^3.0.0", |
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
1042306
22158
Updatedajv@^8.17.1