New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

new-i18n

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

new-i18n - npm Package Compare versions

Comparing version 3.0.0-0 to 3.0.0-2

.eslintignore

9

CHANGELOG.md

@@ -8,2 +8,8 @@ # Changelog

## [3.0.0-0] 2020-05-20
### Changed
- Switched to TypeScript
## [2.0.0] - 2020-04-19

@@ -16,2 +22,3 @@

[2.0.0]: https://github.com/YouTwitFace/new-i18n/tree/v2.0.0
[2.0.0]: https://github.com/AndrewLaneX/new-i18n/tree/v2.0.0
[3.0.0-0]: https://github.com/AndrewLaneX/new-i18n/tree/v3.0.0-0

7

lib/index.js

@@ -9,2 +9,5 @@ "use strict";

}
else if (fallback && !languages.includes(fallback)) {
throw new Error(`The fallback language wasn't listed as a language.`);
}
this.fallback = fallback;

@@ -38,6 +41,6 @@ this._languages = new Map(languages.map(language => [language, require(`${folder}/${language}.json`)]));

}
return value.replace(/\{{2}(.+?)\}{2}/g, (_, variable) => variables[variable] || variable);
return value.replace(/\{{2}(.+?)\}{2}/g, (_, variable) => (variables[variable] || variable).toString());
}
_update(oldValues, newValues) {
const result = Object.assign({}, oldValues);
const result = { ...oldValues };
for (const key in newValues) {

@@ -44,0 +47,0 @@ if (typeof newValues[key] === `object`) {

export interface Language {
[key: string]: string | Language;
}
export declare type Variable = string | number;
export interface Variables {
[key: string]: any;
[key: string]: Variable;
}
export declare type Translation = string | null;
{
"name": "new-i18n",
"version": "3.0.0-0",
"version": "3.0.0-2",
"description": "new-i18n is a simple and easy to use internationalization library.",

@@ -8,4 +8,5 @@ "main": "lib/index.js",

"scripts": {
"test": "mocha -r ts-node/register test/**/*.ts",
"lint": "eslint src/",
"test": "npm run prepare && mocha -r ts-node/register test/**/*.ts",
"coverage": "nyc npm run test",
"lint": "eslint .",
"prepare": "rm -rf lib/ && tsc",

@@ -20,2 +21,3 @@ "preversion": "npm run test"

"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/mocha": "^7.0.2",

@@ -27,2 +29,3 @@ "@types/node": "^14.0.1",

"mocha": "^7.1.2",
"nyc": "^15.1.0",
"ts-node": "^8.10.1",

@@ -29,0 +32,0 @@ "typescript": "^3.9.2"

{
"include": ["./src/**/*"],
"include": ["src/"],
"compilerOptions": {
"target": "es6",
"target": "ES2019",
"module": "commonjs",
"declaration": true,
"outDir": "./lib/",
"outDir": "lib/",
"strict": true,

@@ -9,0 +9,0 @@ "noUnusedLocals": true,

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