@formatjs/cli 5.1.1 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/formatjs +13 -6
- package/package.json +2 -2
package/bin/formatjs
CHANGED
|
@@ -150564,7 +150564,7 @@ var require_interpolate_name = __commonJS({
|
|
|
150564
150564
|
}
|
|
150565
150565
|
let url = filename;
|
|
150566
150566
|
if (content) {
|
|
150567
|
-
url = url.replace(/\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi, (_, hashType, digestType, maxLength) => getHashDigest(content, hashType, digestType, parseInt(maxLength, 10)));
|
|
150567
|
+
url = url.replace(/\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*[a-z]*))?(?::(\d+))?\]/gi, (_, hashType, digestType, maxLength) => getHashDigest(content, hashType, digestType, parseInt(maxLength, 10)));
|
|
150568
150568
|
}
|
|
150569
150569
|
url = url.replace(/\[ext\]/gi, () => ext).replace(/\[name\]/gi, () => basename2).replace(/\[path\]/gi, () => directory).replace(/\[folder\]/gi, () => folder).replace(/\[query\]/gi, () => query);
|
|
150570
150570
|
if (regExp && loaderContext.resourcePath) {
|
|
@@ -154535,9 +154535,9 @@ var require_printer = __commonJS({
|
|
|
154535
154535
|
}
|
|
154536
154536
|
exports.printAST = printAST2;
|
|
154537
154537
|
function doPrintAST(ast, isInPlural) {
|
|
154538
|
-
var printedNodes = ast.map(function(el) {
|
|
154538
|
+
var printedNodes = ast.map(function(el, i) {
|
|
154539
154539
|
if ((0, types_1.isLiteralElement)(el)) {
|
|
154540
|
-
return printLiteralElement(el, isInPlural);
|
|
154540
|
+
return printLiteralElement(el, isInPlural, i === 0, i === ast.length - 1);
|
|
154541
154541
|
}
|
|
154542
154542
|
if ((0, types_1.isArgumentElement)(el)) {
|
|
154543
154543
|
return printArgumentElement(el);
|
|
@@ -154567,9 +154567,16 @@ var require_printer = __commonJS({
|
|
|
154567
154567
|
function printEscapedMessage(message) {
|
|
154568
154568
|
return message.replace(/([{}](?:.*[{}])?)/su, "'$1'");
|
|
154569
154569
|
}
|
|
154570
|
-
function printLiteralElement(_a, isInPlural) {
|
|
154570
|
+
function printLiteralElement(_a, isInPlural, isFirstEl, isLastEl) {
|
|
154571
154571
|
var value = _a.value;
|
|
154572
|
-
var escaped =
|
|
154572
|
+
var escaped = value;
|
|
154573
|
+
if (!isFirstEl && escaped[0] === "'") {
|
|
154574
|
+
escaped = "''".concat(escaped.slice(1));
|
|
154575
|
+
}
|
|
154576
|
+
if (!isLastEl && escaped[escaped.length - 1] === "'") {
|
|
154577
|
+
escaped = "".concat(escaped.slice(0, escaped.length - 1), "''");
|
|
154578
|
+
}
|
|
154579
|
+
escaped = printEscapedMessage(escaped);
|
|
154573
154580
|
return isInPlural ? escaped.replace("#", "'#'") : escaped;
|
|
154574
154581
|
}
|
|
154575
154582
|
function printArgumentElement(_a) {
|
|
@@ -154636,7 +154643,7 @@ var require_manipulator = __commonJS({
|
|
|
154636
154643
|
if (Array.isArray(obj)) {
|
|
154637
154644
|
return tslib_1.__spreadArray([], obj.map(cloneDeep), true);
|
|
154638
154645
|
}
|
|
154639
|
-
if (typeof obj === "object") {
|
|
154646
|
+
if (obj !== null && typeof obj === "object") {
|
|
154640
154647
|
return Object.keys(obj).reduce(function(cloned, k) {
|
|
154641
154648
|
cloned[k] = cloneDeep(obj[k]);
|
|
154642
154649
|
return cloned;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/cli",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"description": "A CLI for formatjs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"url": "https://github.com/formatjs/formatjs/issues"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@formatjs/cli-lib": "5.1.
|
|
36
|
+
"@formatjs/cli-lib": "5.1.3"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@vue/compiler-sfc": "^3.2.34"
|