Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-formatjs

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-formatjs - npm Package Compare versions

Comparing version 9.0.4 to 9.1.0

21

index.js

@@ -18,3 +18,3 @@ "use strict";

var DESCRIPTOR_PROPS = new Set(['id', 'description', 'defaultMessage']);
function getICUMessageValue(messagePath, _a) {
function getICUMessageValue(messagePath, _a, preserveWhitespace) {
var _b = _a === void 0 ? {} : _a, _c = _b.isJSXSource, isJSXSource = _c === void 0 ? false : _c;

@@ -24,5 +24,6 @@ if (!messagePath) {

}
var message = getMessageDescriptorValue(messagePath)
.trim()
.replace(/\s+/gm, ' ');
var message = getMessageDescriptorValue(messagePath);
if (!preserveWhitespace) {
message = message.trim().replace(/\s+/gm, ' ');
}
try {

@@ -85,3 +86,3 @@ intl_messageformat_parser_1.parse(message);

}
function evaluateMessageDescriptor(descriptorPath, isJSXSource, filename, idInterpolationPattern, overrideIdFn) {
function evaluateMessageDescriptor(descriptorPath, isJSXSource, filename, idInterpolationPattern, overrideIdFn, preserveWhitespace) {
if (isJSXSource === void 0) { isJSXSource = false; }

@@ -92,3 +93,3 @@ if (idInterpolationPattern === void 0) { idInterpolationPattern = '[contenthash:5]'; }

isJSXSource: isJSXSource,
});
}, preserveWhitespace);
var description = getMessageDescriptorValue(descriptorPath.description);

@@ -232,3 +233,3 @@ if (overrideIdFn) {

var opts = _a.opts, filename = _a.file.opts.filename;
var _b = opts.additionalComponentNames, additionalComponentNames = _b === void 0 ? [] : _b, removeDefaultMessage = opts.removeDefaultMessage, idInterpolationPattern = opts.idInterpolationPattern, overrideIdFn = opts.overrideIdFn, ast = opts.ast;
var _b = opts.additionalComponentNames, additionalComponentNames = _b === void 0 ? [] : _b, removeDefaultMessage = opts.removeDefaultMessage, idInterpolationPattern = opts.idInterpolationPattern, overrideIdFn = opts.overrideIdFn, ast = opts.ast, preserveWhitespace = opts.preserveWhitespace;
if (wasExtracted(path)) {

@@ -264,3 +265,3 @@ return;

// context, then store it.
var descriptor = evaluateMessageDescriptor(descriptorPath, true, filename, idInterpolationPattern, overrideIdFn);
var descriptor = evaluateMessageDescriptor(descriptorPath, true, filename, idInterpolationPattern, overrideIdFn, preserveWhitespace);
storeMessage(descriptor, path, opts, filename, this.ReactIntlMessages);

@@ -320,3 +321,3 @@ var idAttr = void 0;

var messages = this.ReactIntlMessages;
var overrideIdFn = opts.overrideIdFn, idInterpolationPattern = opts.idInterpolationPattern, removeDefaultMessage = opts.removeDefaultMessage, _b = opts.additionalFunctionNames, additionalFunctionNames = _b === void 0 ? [] : _b, ast = opts.ast;
var overrideIdFn = opts.overrideIdFn, idInterpolationPattern = opts.idInterpolationPattern, removeDefaultMessage = opts.removeDefaultMessage, _b = opts.additionalFunctionNames, additionalFunctionNames = _b === void 0 ? [] : _b, ast = opts.ast, preserveWhitespace = opts.preserveWhitespace;
var callee = path.get('callee');

@@ -337,3 +338,3 @@ /**

// Evaluate the Message Descriptor values, then store it.
var descriptor = evaluateMessageDescriptor(descriptorPath, false, filename, idInterpolationPattern, overrideIdFn);
var descriptor = evaluateMessageDescriptor(descriptorPath, false, filename, idInterpolationPattern, overrideIdFn, preserveWhitespace);
storeMessage(descriptor, messageDescriptor, opts, filename, messages);

@@ -340,0 +341,0 @@ // Remove description since it's not used at runtime.

@@ -15,3 +15,4 @@ /**

ast?: boolean;
preserveWhitespace?: boolean;
}
//# sourceMappingURL=options.d.ts.map

@@ -14,5 +14,6 @@ {

"extractSourceLocation": { "type": "boolean" },
"ast": { "type": "boolean" }
"ast": { "type": "boolean" },
"preserveWhitespace": { "type": "boolean" }
},
"additionalProperties": false
}
{
"name": "babel-plugin-formatjs",
"version": "9.0.4",
"version": "9.1.0",
"description": "Extracts string messages for translation from modules that use formatjs.",

@@ -17,6 +17,6 @@ "repository": {

"@babel/types": "^7.9.5",
"@formatjs/ts-transformer": "3.0.4",
"@formatjs/ts-transformer": "3.1.0",
"@types/babel__core": "^7.1.7",
"@types/schema-utils": "^2.4.0",
"intl-messageformat-parser": "6.3.1",
"intl-messageformat-parser": "6.3.2",
"schema-utils": "^3.0.0",

@@ -23,0 +23,0 @@ "tslib": "^2.0.1"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc