@automattic/babel-plugin-i18n-calypso
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"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 @@ }, |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
39970
8
708
0
3
Updatedgettext-parser@^4.0.3
Updatedlodash@^4.17.15