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

babel-plugin-lingui-transform-js

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-lingui-transform-js - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

26

lib/index.js

@@ -51,3 +51,3 @@ 'use strict';

var name = t.isNumericLiteral(key) ? `=${key.value}` : key.name || key.value;
var name = t.isNumericLiteral(key) ? '=' + key.value : key.name || key.value;

@@ -67,3 +67,3 @@ if (name === 'value') {

}
offset = ` offset:${attr.value.value}`;
offset = ' offset:' + attr.value.value;
} else {

@@ -106,5 +106,5 @@ var value = '';

if (!choicesKeys.length) {
throw file.buildCodeFrameError(node.callee, `Missing ${choicesType} choices. At least fallback argument 'other' is required.`);
throw file.buildCodeFrameError(node.callee, 'Missing ' + choicesType + ' choices. At least fallback argument \'other\' is required.');
} else if (!choicesKeys.includes('other')) {
throw file.buildCodeFrameError(node.callee, `Missing fallback argument 'other'.`);
throw file.buildCodeFrameError(node.callee, 'Missing fallback argument \'other\'.');
}

@@ -115,3 +115,3 @@

if (!pluralRules.includes(rule) && !/=\d+/.test(rule)) {
throw file.buildCodeFrameError(node.callee, `Invalid plural rule '${rule}'. Must be ${pluralRules.join(', ')} or exact number depending on your source language ('one' and 'other' for English).`);
throw file.buildCodeFrameError(node.callee, 'Invalid plural rule \'' + rule + '\'. Must be ' + pluralRules.join(', ') + ' or exact number depending on your source language (\'one\' and \'other\' for English).');
}

@@ -122,5 +122,5 @@ });

var argument = choicesKeys.map(function (form) {
return `${form} {${choices[form]}}`;
return form + ' {' + choices[form] + '}';
}).join(' ');
props.text = `{${variable}, ${choicesType},${offset} ${argument}}`;
props.text = '{' + variable + ', ' + choicesType + ',' + offset + ' ' + argument + '}';
} else if (isFormatMethod(node.callee)) {

@@ -144,7 +144,7 @@ var _variable = node.arguments[0];

} else {
var formatName = new RegExp(`^${type}\\d+$`);
var formatName = new RegExp('^' + type + '\\d+$');
var existing = Object.keys(props.formats).filter(function (name) {
return formatName.test(name);
});
format = `${type}${existing.length || 0}`;
format = '' + type + (existing.length || 0);
}

@@ -160,3 +160,3 @@

props.params[_variable.name] = t.objectProperty(_variable, _variable);
props.text += `${parts.join(',')}`;
props.text += '' + parts.join(',');
}

@@ -183,5 +183,5 @@

props.text += `{${text}}`;
props.text += '{' + text + '}';
} else {
props.text += `{${item.name}}`;
props.text += '{' + item.name + '}';
props.params[item.name] = t.objectProperty(item, item);

@@ -225,3 +225,3 @@ }

visitor: {
CallExpression,
CallExpression: CallExpression,
TaggedTemplateExpression: CallExpression

@@ -228,0 +228,0 @@ }

{
"name": "babel-plugin-lingui-transform-js",
"version": "0.5.0",
"version": "0.6.0",
"description": "Transform lingui-i18n methods to ICU message format",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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