Socket
Socket
Sign inDemoInstall

gettext-parser

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gettext-parser - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

32

lib/poparser.js

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

this._state = this.states.none;
this._lineNumber = 1;

@@ -124,3 +125,4 @@ if (typeof fileContents === 'string') {

whitespace: /\s/,
key: /[\w\-[\]]/
key: /[\w\-[\]]/,
keyNames: /^(?:msgctxt|msgid(?:_plural)?|msgstr(?:\[\d+])?)$/
};

@@ -138,2 +140,7 @@

chr = chunk.charAt(i);
if (chr === '\n') {
this._lineNumber += 1;
}
switch (this._state) {

@@ -202,2 +209,7 @@ case this.states.none:

if (!chr.match(this.symbols.key)) {
if (!this._node.value.match(this.symbols.keyNames)) {
var err = new SyntaxError('Error parsing PO data: Invalid key name "' + this._node.value + '" at line ' + this._lineNumber + '. This can be caused by an unescaped quote character in a msgid or msgstr value.');
err.lineNumber = this._lineNumber;
throw err;
}
this._state = this.states.none;

@@ -504,3 +516,10 @@ i--;

if (chunk.length) {
this._parser._lexer(this._parser._toString(chunk));
try {
this._parser._lexer(this._parser._toString(chunk));
} catch (error) {
setImmediate(function () {
done(error);
});
return;
}
}

@@ -526,3 +545,10 @@

if (chunk) {
this._parser._lexer(this._parser._toString(chunk));
try {
this._parser._lexer(this._parser._toString(chunk));
} catch (error) {
setImmediate(function () {
done(error);
});
return;
}
}

@@ -529,0 +555,0 @@

2

package.json
{
"name": "gettext-parser",
"description": "Parse and compile gettext po and mo files to/from json, nothing more, nothing less",
"version": "3.0.0",
"version": "3.1.0",
"author": "Andris Reinman",

@@ -6,0 +6,0 @@ "contributors": [

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