Socket
Socket
Sign inDemoInstall

mining-utils

Package Overview
Dependencies
0
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 0.1.0

8

mining-utils.ts

@@ -1,7 +0,1 @@

import { stringsManipulation } from './strings/index'
stringsManipulation.removeAccent('Mussum Ipsum, cacilds vidis litro abertis. Em pé sem cair, deitado sem dormir, sentado sem cochilar e fazendo pose. Suco de cevadiss deixa as pessoas mais interessantis. Todo mundo vê os porris que eu tomo, mas ninguém vê os tombis que eu levo! Per aumento de cachacis, eu reclamis. ')
// ['áÁàÀãÃâÂäÄ', 'éÉèÈẽẼêÊëË', 'íÍìÌĩĨîÎ', 'óÓòÒõÕÔ', 'úÚùÙũŨÛ', 'çÇĉĈ', 'ǵǴĝĜ', 'ĥĤḧḦ'
// , 'ĵĴ', 'ḱḰ', 'ĺĹ', 'ḿḾ', 'ńŃǹǸñÑ', 'ṕṔ', 'ŕŔ', 'śŚŝŜ', 'ẗ', 'ǘǗǜǛṽṼ', 'ẃẂẁẀŵŴẅẄ', 'ẍẌ', 'ýÝỳỲŷŶỹỸ', 'źŹẑẐ']
import * as stringChanges from './strings/index'

2

package.json
{
"name": "mining-utils",
"version": "0.0.2",
"version": "0.1.0",
"description": "",

@@ -5,0 +5,0 @@ "author": "Oracy Rezende Martos <oramartos_21@hotmail.com> (https://github.com/Oracy)",

@@ -1,23 +0,37 @@

export const removeAccent = (phrase?: string, words?: string[]): string[] | string => {
if (phrase){
const removeAccent = (phrase: string | string[]): string[] | string => {
try {
const replace: string[] = ['a', 'e', 'i', 'o', 'u', 'c', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'r', 's', 't', 'u', 'w', 'x', 'y', 'z']
const accent: string[] = ['áÁàÀãÃâÂäÄ', 'éÉèÈẽẼêÊëË', 'íÍìÌĩĨîÎ', 'óÓòÒõÕÔ', 'úÚùÙũŨÛ', 'çÇĉĈ', 'ǵǴĝĜ', 'ĥĤḧḦ'
, 'ĵĴ', 'ḱḰ', 'ĺĹ', 'ḿḾ', 'ńŃǹǸñÑ', 'ṕṔ', 'ŕŔ', 'śŚŝŜ', 'ẗ', 'ǘǗǜǛṽṼ', 'ẃẂẁẀŵŴẅẄ', 'ẍẌ', 'ýÝỳỲŷŶỹỸ', 'źŹẑẐ']
let newString: string = ''
, 'ĵĴ', 'ḱḰ', 'ĺĹ', 'ḿḾ', 'ńŃǹǸñÑ', 'ṕṔ', 'ŕŔ', 'śŚŝŜ', 'ẗ', 'ǘǗǜǛṽṼ', 'ẃẂẁẀŵŴẅẄ', 'ẍẌ', 'ýÝỳỲŷŶỹỸ', 'źŹẑẐ']
for (const word of accent) {
if (phrase.match(`/[${word}]/gi`)) {
accent.indexOf(word)
newString = phrase.replace(`[${word}]`, replace[accent.indexOf(word)])
} else{
// console.log(word)
let reg: RegExp
let data: string
if (!Array.isArray(phrase)) {
data = phrase.toString()
for (const word of accent) {
if (data.match(`[${word}]`)) {
reg = new RegExp(`[${accent[accent.indexOf(word)]}]`, "g")
data = data.replace(reg, replace[accent.indexOf(word)])
}
}
return data
} else {
for (let x = 0; x < phrase.length; x++) {
for (const word of accent) {
if (phrase[x].match(`[${word}]`)) {
reg = new RegExp(`[${accent[accent.indexOf(word)]}]`, "g")
phrase[x] = phrase[x].replace(reg, replace[accent.indexOf(word)])
}
}
}
return phrase
}
console.log(newString)
// const newStr: string = phrase.replace(replace, "")
return 'a'
}else{
return 'a'
} catch (err) {
throw err
}
}
export const accent = removeAccent
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc