Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

custom-translate

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

custom-translate - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

4

index.js
module.exports.wordTrans = (text, words) => {
return text.split(' ').map(word => {
const strip = word.replace(/[\[\\^$.,:;|!?%#@"*+()\]]/g, '').toLowerCase();
if (words[strip]) return word.toLowerCase().replace(strip, words[strip]);
if(words[strip]) return word.toLowerCase().replace(strip, words[strip]);
else return word;

@@ -11,5 +11,5 @@ }).join(' ');

return text.split('').map(letter => {
if (letters[letter]) return letters[letter];
if(letters[letter]) return letters[letter];
else return letter;
}).join(joinWith || '');
};
{
"name": "custom-translate",
"version": "1.2.0",
"version": "1.2.1",
"description": "A simple module for translating certain words or letters in a string with other words or letters.",

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

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