custom-translate
Advanced tools
Comparing version 1.2.0 to 1.2.1
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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3286