Socket
Socket
Sign inDemoInstall

@automattic/babel-plugin-i18n-calypso

Package Overview
Dependencies
Maintainers
37
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automattic/babel-plugin-i18n-calypso - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

dist/cjs/index.js

8

package.json
{
"name": "@automattic/babel-plugin-i18n-calypso",
"version": "1.1.0",
"version": "1.1.1",
"description": "A Babel plugin to generate a POT file for translate calls",
"main": "src/index.js",
"dependencies": {
"gettext-parser": "^4.0.0",
"lodash": "^4.17.14"
"gettext-parser": "^4.0.3",
"lodash": "^4.17.15"
},

@@ -24,3 +24,3 @@ "peerDependencies": {

"license": "GPL-2.0-or-later",
"gitHead": "e50bdc06da220ce237bf309703102dec8673436f"
"gitHead": "d2e6d7e0b02619f09de68f11bb24f86f8aca8b76"
}

@@ -99,3 +99,7 @@ /**

let comment;
forEach( node.leadingComments, commentNode => {
forEach( node.leadingComments, ( commentNode ) => {
if ( ! commentNode.loc ) {
return;
}
const { line } = commentNode.loc.end;

@@ -111,3 +115,3 @@ if ( line < _originalNodeLine - 1 || line > _originalNodeLine ) {

.split( '\n' )
.map( text => text.trim() )
.map( ( text ) => text.trim() )
.join( ' ' );

@@ -185,6 +189,8 @@

function isValidTranslationKey( key ) {
return Object.values( DEFAULT_FUNCTIONS_ARGUMENTS_ORDER ).some( args => args.includes( key ) );
return Object.values( DEFAULT_FUNCTIONS_ARGUMENTS_ORDER ).some( ( args ) =>
args.includes( key )
);
}
module.exports = function() {
module.exports = function () {
let strings = {},

@@ -204,3 +210,3 @@ nplurals = 2,

path.node.specifiers.forEach( specifier => {
path.node.specifiers.forEach( ( specifier ) => {
if ( specifier.imported && 'translate' === specifier.imported.name && specifier.local ) {

@@ -276,5 +282,3 @@ functions[ specifier.local.name ] = functions.translate;

const base = state.opts.base || '.';
const pathname = relative( base, filename )
.split( sep )
.join( '/' );
const pathname = relative( base, filename ).split( sep ).join( '/' );
translation.comments.reference = pathname + ':' + path.node.loc.start.line;

@@ -289,3 +293,3 @@

if ( 'ObjectExpression' === arg.type ) {
arg.properties.forEach( property => {
arg.properties.forEach( ( property ) => {
if ( 'ObjectProperty' !== property.type ) {

@@ -349,5 +353,3 @@ return;

const base = state.opts.base || '.';
const pathname = relative( base, filename )
.split( sep )
.join( '-' );
const pathname = relative( base, filename ).split( sep ).join( '-' );
writeFileSync( dir + pathname + '.pot', compiled );

@@ -354,0 +356,0 @@ },

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