Socket
Socket
Sign inDemoInstall

i18next-scanner

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18next-scanner - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

lib/match-recursive-regexp.js

26

lib/jsx-parser.js

@@ -42,10 +42,20 @@ 'use strict';

var m = jsExpr.exec(txt);
var addText = function addText(txt) {
var lastNode = stack[0].childNodes.slice(-1)[0];
if (lastNode && lastNode.nodeName === '#text') {
lastNode.value += txt;
} else {
stack[0].childNodes.push({
nodeName: '#text',
value: txt,
childNodes: []
});
}
};
if (m) {
while (m = jsExpr.exec(txt)) {
if (m[1]) {
stack[0].childNodes.push({
nodeName: '#text',
value: m[1],
childNodes: []
});
addText(m[1]);
}

@@ -61,7 +71,3 @@ stack[0].childNodes.push({

if (txt) {
stack[0].childNodes.push({
nodeName: '#text',
value: txt,
childNodes: []
});
addText(txt);
}

@@ -68,0 +74,0 @@ }

@@ -704,2 +704,11 @@ 'use strict';

_this3.log('i18next-scanner: Added a new translation key { ' + _chalk2.default.yellow(JSON.stringify(resKey)) + ': ' + _chalk2.default.yellow(JSON.stringify(resLoad[resKey])) + ' } to ' + _chalk2.default.yellow(JSON.stringify(_this3.formatResourceLoadPath(lng, ns))));
} else if (options.defaultValue) {
if (!resLoad[resKey]) {
// Use `options.defaultValue` if specified
resLoad[resKey] = options.defaultValue;
} else if (resLoad[resKey] !== options.defaultValue) {
// We already had a different default.
var k = _chalk2.default.yellow(JSON.stringify(resKey));
_this3.log('i18next-scanner: Translation key ' + k + ' has multiple different default values. Using first default');
}
}

@@ -706,0 +715,0 @@

{
"name": "i18next-scanner",
"version": "2.1.1",
"version": "2.1.2",
"description": "Scan your code, extract translation keys/values, and merge them into i18n resource files.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/i18next/i18next-scanner",

@@ -93,2 +93,4 @@ # i18next-scanner [![build status](https://travis-ci.org/i18next/i18next-scanner.svg?branch=master)](https://travis-ci.org/i18next/i18next-scanner) [![Coverage Status](https://coveralls.io/repos/i18next/i18next-scanner/badge.svg?branch=master&service=github)](https://coveralls.io/github/i18next/i18next-scanner?branch=master)

_Note: Globbing patterns should be wrapped in single quotes._
#### Examples

@@ -95,0 +97,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