Socket
Socket
Sign inDemoInstall

i18next

Package Overview
Dependencies
Maintainers
1
Versions
501
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18next - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

lib/dep/i18next-1.3.4.js

40

lib/filesync.js

@@ -48,28 +48,28 @@ var fs = require('fs');

postChange: function(ns, lng, key, newValue) {
var self = this;
this.load([lng], {ns: {namespaces: [ns]}}, function(err, fetched) {
// change key in resStore
var keys = key.split('.');
var x = 0;
var value = fetched[lng][ns];
while (keys[x]) {
if (x === keys.length - 1) {
value = value[keys[x]] = newValue;
} else {
value = value[keys[x]] = value[keys[x]] || {};
// change key in resStore
var keys = key.split('.');
var x = 0;
var value = fetched[lng][ns];
while (keys[x]) {
if (x === keys.length - 1) {
value = value[keys[x]] = newValue;
} else {
value = value[keys[x]] = value[keys[x]] || {};
}
x++;
}
x++;
}
var filename = this.functions.applyReplacement(this.resSetPath, {lng: lng, ns: ns});
var filename = self.functions.applyReplacement(self.options.resSetPath, {lng: lng, ns: ns});
var self = this;
fs.writeFile(filename, JSON.stringify(fetched[lng][ns], null, 4), function (err) {
if (err) {
self.functions.log('error updating key `' + key + '` with value `' + newValue + '` to: ' + filename);
} else {
self.functions.log('updated key `' + key + '` with value `' + newValue + '` to: ' + filename);
}
fs.writeFile(filename, JSON.stringify(fetched[lng][ns], null, 4), function (err) {
if (err) {
self.functions.log('error updating key `' + key + '` with value `' + newValue + '` to: ' + filename);
} else {
self.functions.log('updated key `' + key + '` with value `' + newValue + '` to: ' + filename);
}
});
});
});
}
};
(function() {
// when updating i18next dep update version here
var i18nVersion = '1.3.1';
var i18nVersion = '1.3.4';

@@ -6,0 +6,0 @@ var i18n = require('./dep/i18next-' + i18nVersion)

@@ -5,3 +5,3 @@ {

"description": "i18n made easy - full featured: middleware, template support plus clientside use",
"version": "1.3.3",
"version": "1.3.4",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

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