Huge News!Announcing our $40M Series B led by Abstract Ventures.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.4.0 to 1.4.1

2

lib/Empty.d.ts

@@ -11,3 +11,3 @@ import Branch, { Translations } from './Branch';

add(translations?: Translations): void;
suggestions(): string;
suggestions(): Branch[];
}

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

}
return words.map(x => x.word).join(', ');
return words;
}

@@ -40,0 +40,0 @@ }

@@ -40,4 +40,6 @@ import Tree, { WordTranslations, TreeOptions } from './Tree';

exportTexts(): WordTranslations;
getBranch(wordOrText: string): Branch | null;
delete(wordOrText: string): boolean;
getWord(word: string): Branch | null;
getText(text: string): Branch | null;
getBranch(wordOrText: string, isText?: boolean): Branch | null;
delete(wordOrText: string): Branch | null;
private _branch;

@@ -44,0 +46,0 @@ private replaceVariables;

@@ -73,5 +73,14 @@ "use strict";

// todo: Create test
getBranch(wordOrText) {
return this._branch(wordOrText);
getWord(word) {
return this.getBranch(word);
}
// todo: Create test
getText(text) {
return this.getBranch(text, true);
}
// todo: Create test
getBranch(wordOrText, isText = false) {
return this._branch(wordOrText, isText);
}
// todo: Create test
delete(wordOrText) {

@@ -81,14 +90,18 @@ const branch = this._branch(wordOrText);

branch.isWord = false;
return true;
return branch;
}
return false;
return null;
}
_branch(wordOrText) {
const word = this.tree.word(wordOrText);
if (word instanceof Branch_1.default) {
return word;
_branch(wordOrText, isText = false) {
if (!isText) {
const word = this.tree.word(wordOrText);
if (word instanceof Branch_1.default) {
return word;
}
}
const text = this.tree.text(wordOrText);
if (text instanceof Branch_1.default) {
return text;
else {
const text = this.tree.text(wordOrText);
if (text instanceof Branch_1.default) {
return text;
}
}

@@ -95,0 +108,0 @@ return null;

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

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

Sorry, the diff of this file is not supported yet

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