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

@ewb/translate

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ewb/translate - npm Package Compare versions

Comparing version 1.8.1 to 1.8.2

4

lib/index.d.ts

@@ -28,3 +28,3 @@ import Tree, { WordTranslations, TreeOptions } from './Tree';

private readonly noTranslation;
constructor({ defaultLocale, locale, words, texts, noMatch, noTranslation }?: TranslateOptions, overrideNew?: boolean);
constructor({ defaultLocale, locale, words, texts, noMatch, noTranslation, }?: TranslateOptions, overrideNew?: boolean);
w(word: string, locale?: string): string;

@@ -53,2 +53,2 @@ word(word: string, locale?: string): string;

}
export { Tree, Empty, Branch, Translate, TranslateOptions, WordTranslations, TreeOptions, Translations, BranchObject, Variables, TextOptions, ISO_639_1, TranslationApi, TranslationUsage };
export { Tree, Empty, Branch, Translate, TranslateOptions, WordTranslations, TreeOptions, Translations, BranchObject, Variables, TextOptions, ISO_639_1, TranslationApi, TranslationUsage, };

@@ -26,3 +26,3 @@ "use strict";

class Translate {
constructor({ defaultLocale = 'en', locale = 'en', words = {}, texts = {}, noMatch, noTranslation } = {}, overrideNew) {
constructor({ defaultLocale = 'en', locale = 'en', words = {}, texts = {}, noMatch, noTranslation, } = {}, overrideNew) {
this.defaultLocale = '';

@@ -40,3 +40,3 @@ this.locale = '';

words,
texts
texts,
});

@@ -67,3 +67,3 @@ translate = this;

words: this.exportWords(),
texts: this.exportTexts()
texts: this.exportTexts(),
};

@@ -102,6 +102,6 @@ }

addWords(words) {
Object.keys(words).forEach(key => this.tree.addText(key, words[key]));
Object.keys(words).forEach((key) => this.tree.addWord(key, words[key]));
}
addTexts(texts) {
Object.keys(texts).forEach(key => this.tree.addText(key, texts[key]));
Object.keys(texts).forEach((key) => this.tree.addText(key, texts[key]));
}

@@ -108,0 +108,0 @@ _branch(wordOrText, isText = false) {

{
"name": "@ewb/translate",
"version": "1.8.1",
"version": "1.8.2",
"description": "Translate as you create your app. Saves the words and text in a tree structure for fast and easy lookup.",

@@ -42,7 +42,2 @@ "main": "./lib/index.js",

],
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
"devDependencies": {

@@ -49,0 +44,0 @@ "@types/chai": "^4.2.21",

@@ -45,3 +45,3 @@ import Tree, { WordTranslations, TreeOptions } from './Tree';

noMatch,
noTranslation
noTranslation,
}: TranslateOptions = {},

@@ -60,3 +60,3 @@ overrideNew?: boolean

words,
texts
texts,
});

@@ -95,3 +95,3 @@

words: this.exportWords(),
texts: this.exportTexts()
texts: this.exportTexts(),
};

@@ -139,7 +139,7 @@ }

public addWords(words: WordTranslations) {
Object.keys(words).forEach(key => this.tree.addText(key, words[key]));
Object.keys(words).forEach((key) => this.tree.addWord(key, words[key]));
}
public addTexts(texts: WordTranslations) {
Object.keys(texts).forEach(key => this.tree.addText(key, texts[key]));
Object.keys(texts).forEach((key) => this.tree.addText(key, texts[key]));
}

@@ -210,3 +210,3 @@

TranslationApi,
TranslationUsage
TranslationUsage,
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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