@lingui/macro
Advanced tools
Comparing version 3.13.2 to 3.13.3
@@ -122,5 +122,5 @@ // @ts-ignore | ||
* const message = selectOrdinal(count, { | ||
* one: "1st", | ||
* two: "2nd", | ||
* few: "3rd", | ||
* one: "#st", | ||
* two: "#nd", | ||
* few: "#rd", | ||
* other: "#th", | ||
@@ -127,0 +127,0 @@ * }); |
@@ -114,5 +114,5 @@ import type { ReactElement, ComponentType, ReactNode } from "react" | ||
* const message = selectOrdinal(count, { | ||
* one: "1st", | ||
* two: "2nd", | ||
* few: "3rd", | ||
* one: "#st", | ||
* two: "#nd", | ||
* few: "#rd", | ||
* other: "#th", | ||
@@ -176,2 +176,3 @@ * }); | ||
context?: string | ||
children?: React.ReactNode | ||
component?: React.ComponentType<TransRenderProps> | ||
@@ -178,0 +179,0 @@ render?: (props: TransRenderProps) => ReactElement<any, any> | null |
@@ -69,2 +69,9 @@ "use strict"; | ||
(0, _defineProperty2.default)(this, "elementIndex", void 0); | ||
(0, _defineProperty2.default)(this, "safeJsxAttribute", function (name, value) { | ||
// Quoted JSX attributes use XML-style escapes instead of JavaScript-style escapes. | ||
// This means that <Trans id="Say \"hi\"!" /> is invalid, but <Trans id={"Say \"hi\"!"} /> is valid. | ||
// We could consider removing this condition and always wrap in a jsxExpressionContainer. | ||
var attributeValue = value.includes('"') ? _this.types.jsxExpressionContainer(_this.types.stringLiteral(value)) : _this.types.stringLiteral(value); | ||
return _this.types.jsxAttribute(_this.types.jsxIdentifier(name), attributeValue); | ||
}); | ||
(0, _defineProperty2.default)(this, "replacePath", function (path) { | ||
@@ -97,7 +104,7 @@ var tokens = _this.tokenizeNode(path.node); | ||
if (message) { | ||
attributes.push(_this.types.jsxAttribute(_this.types.jsxIdentifier(_constants.MESSAGE), _this.types.stringLiteral(message))); | ||
attributes.push(_this.safeJsxAttribute(_constants.MESSAGE, message)); | ||
} | ||
} | ||
} else { | ||
attributes.push(_this.types.jsxAttribute(_this.types.jsxIdentifier(_constants.ID), _this.types.stringLiteral(message))); | ||
attributes.push(_this.safeJsxAttribute(_constants.ID, message)); | ||
} | ||
@@ -104,0 +111,0 @@ |
{ | ||
"name": "@lingui/macro", | ||
"version": "3.13.2", | ||
"version": "3.13.3", | ||
"description": "Macro for generating messages in ICU MessageFormat syntax", | ||
@@ -33,3 +33,3 @@ "main": "index.js", | ||
"@babel/runtime": "^7.11.2", | ||
"@lingui/conf": "^3.13.2", | ||
"@lingui/conf": "^3.13.3", | ||
"ramda": "^0.27.1" | ||
@@ -36,0 +36,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
56478
1291
Updated@lingui/conf@^3.13.3