Socket
Socket
Sign inDemoInstall

i18next-scanner

Package Overview
Dependencies
105
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.2 to 2.1.3

14

lib/parser.js

@@ -10,3 +10,2 @@ 'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* eslint no-console: 0 */
/* eslint no-continue: 0 */
/* eslint no-eval: 0 */

@@ -305,4 +304,11 @@

}).join('|').replace(/\./g, '\\.');
var matchStrippedCharacters = '[\\r\\n\\s]*';
var pattern = '(?:(?:^\\s*)|[^a-zA-Z0-9_])(?:' + matchFuncs + ')\\((' + matchStrippedCharacters + '"(?:[^"\\\\]|\\\\(?:.|$))*"|' + matchStrippedCharacters + '\'(?:[^\'\\\\]|\\\\(?:.|$))*\')' + matchStrippedCharacters + '[,)]';
// `\s` matches a single whitespace character, which includes spaces, tabs, form feeds, line feeds and other unicode spaces.
var matchSpecialCharacters = '[\\r\\n\\s]*';
var pattern = '(?:(?:^\\s*)|[^a-zA-Z0-9_])' + '(?:' + matchFuncs + ')' + '\\(' + '(' +
// backtick (``)
matchSpecialCharacters + '`(?:[^`\\\\]|\\\\(?:.|$))*`' + '|' +
// double quotes ("")
matchSpecialCharacters + '"(?:[^"\\\\]|\\\\(?:.|$))*"' + '|' +
// single quote ('')
matchSpecialCharacters + '\'(?:[^\'\\\\]|\\\\(?:.|$))*\'' + ')' + matchSpecialCharacters + '[\\,\\)]';
var re = new RegExp(pattern, 'gim');

@@ -318,3 +324,3 @@

var firstChar = key[0];
if (_lodash2.default.includes(['\'', '"'], firstChar)) {
if (_lodash2.default.includes(['\'', '"', '`'], firstChar)) {
// Remove first and last character

@@ -321,0 +327,0 @@ key = key.slice(1, -1);

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

@@ -69,3 +69,3 @@ "homepage": "https://github.com/i18next/i18next-scanner",

"eslint": "^4.10.0",
"eslint-config-trendmicro": "^1.0.0",
"eslint-config-trendmicro": "^1.1.0",
"eslint-plugin-import": "^2.8.0",

@@ -72,0 +72,0 @@ "eslint-plugin-jsx-a11y": "^5.1.1",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc