UNPKG

mining-utils

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Oracy/mining-utils/blob/master/LICENSE) [![version](https://badge.fury.io/js/mining-utils.svg)](https://badge.fury.io/js/mining-utils) [![Coverage Status](https://co

1 lines 1.12 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const accents="ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖŐòóôõöőÈÉÊËèéêëðÇĈçĉÐǵĝĜǴĥḧḦĤÌÍÎÏìíîïĵĴḱḰĺĹḿḾńǹŃǸÙÚÛÜŰùúûüűÑñṕṔŕŔśŝŜŚŠšẗǘǜṽṼẃẁŵẅẄẂẀŴẍẌýỳŷỹÿýỸÝỲŶŸžźẑẐŹŽ",noAccents="AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCCccDggGGhhHHIIIIiiiijJkKlLmMnnNNUUUUUuuuuuNnpPrRssSSSstuuvVwwwwWWWWxXyyyyyyYYYYYzzzZZZ",removeAccents=e=>{try{const c={};return accents.split("").forEach((e,n)=>c[e]=noAccents[n]),e.replace(/[^A-Za-z0-9]/g,e=>c[e]||e)}catch(e){console.log('This function can handle just strings.\nExample: removeAccents("All your string here.")',e)}};exports.removeAccents=removeAccents;const removeAccentsArray=e=>{try{const c={},n=[];accents.split("").forEach((e,n)=>c[e]=noAccents[n]);for(const r in e)n.push(e[r].replace(/[^A-Za-z0-9]/g,e=>c[e]||e));return n}catch(e){console.log('This function can handle just string arrays.\nExample: removeAcentsArray(["First", "Second", "Third"])',e)}};exports.removeAccentsArray=removeAccentsArray;