Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

meteor-accounts-t9n

Package Overview
Dependencies
0
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.0 to 2.5.0

44

build/t9n.js

@@ -8,3 +8,2 @@ // Generated by CoffeeScript 2.4.1

if (Meteor.isClient) {
console.log('startup4');
return typeof Template !== "undefined" && Template !== null ? Template.registerHelper('t9n', function(x, params) {

@@ -143,3 +142,3 @@ return T9n.get(x, true, params.hash);

static replaceParams(str, args) {
var arg, index1, index2, line, lines, strCopy, token, tokenName, value;
var index1, index2, strCopy, token, tokenName, value;
index1 = 0;

@@ -150,23 +149,11 @@ strCopy = str;

if (index1 > -1) {
index2 = strCopy.substring(index1).indexOf('}');
index2 = strCopy.substring(index1).indexOf('}'); // no nested tokens
token = strCopy.substring(index1, index2 + 1);
if (token.indexOf('->') > -1) {
lines = strCopy.split(/\n/);
tokenName = token.substring(2, token.indexOf(' '));
arg = args[tokenName];
line = lines.find(function(l) {
return l.indexOf(`[${arg}]`) > -1;
});
if (line) {
value = line.substring(line.lastIndexOf(']') + 1).trim();
} else {
line = lines.find(function(l) {
return l.indexOf('[*]') > -1;
});
value = line.substring(line.lastIndexOf(']') + 1).trim().replace(new RegExp(`\\$${tokenName}`), args[tokenName]);
}
str = str.replace(token, value);
value = this.handleSelector(strCopy, args, token);
str = str.replace(token, value); // no selector, simply replace the token
} else {
tokenName = token.substring(2, token.indexOf('}'));
str = str.replace(token, args[tokenName]);
str = str.replace(new RegExp(token, 'g'), args[tokenName]);
str = str.replace(new RegExp(`\\$${tokenName}`, 'g'), args[tokenName]);
}

@@ -179,2 +166,21 @@ strCopy = strCopy.substring(index2 + 2).trim();

static handleSelector(str, args, token) {
var foundLine, lineMap, tokenName;
tokenName = token.substring(2, token.indexOf(' '));
lineMap = str.split(/\n/).slice(1).map(function(line) {
var regexString;
regexString = line.trim().split(/\s/)[0];
return {
regexString,
line: line.substring(line.indexOf(regexString) + regexString.length)
};
});
foundLine = lineMap.find(function(map) {
return new RegExp(map.regexString).test(args[tokenName]);
});
if (foundLine) {
return foundLine.line.substring(foundLine.line.lastIndexOf(']') + 1).trim().replace(new RegExp(`\\$${tokenName}`), args[tokenName]);
}
}
};

@@ -181,0 +187,0 @@

Package.describe({
summary: "Almost i18n, with standard translations for basic meteor packages.",
version: "2.4.0",
version: "2.5.0",
name: "softwarerero:accounts-t9n",

@@ -5,0 +5,0 @@ git: "https://github.com/softwarerero/meteor-accounts-t9n.git",

{
"name": "meteor-accounts-t9n",
"version": "2.4.0",
"version": "2.5.0",
"description": "Translations for Meteor projects, almost i18n",

@@ -5,0 +5,0 @@ "repository": "https://github.com/softwarerero/meteor-accounts-t9n",

@@ -6,5 +6,5 @@ {

"author": "Stefan Undorf <el@softwarerero.com>",
"version": "2.4.0",
"version": "2.5.0",
"git": "https://github.com/softwarerero/meteor-accounts-t9n.git",
"packages": {}
}

Sorry, the diff of this file is not supported yet

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