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 696 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const removeLinks=(e,r)=>{try{const s=r?new RegExp(`${r}://*.[^\\s]+`,"g"):new RegExp("https?://*.[^\\s]+","g");return e.replace(s,"")}catch(e){console.log('This function can handle just strings.\nExample: removeLinks("All your string here")',e)}};exports.removeLinks=removeLinks;const removeLinksArray=(e,r)=>{try{const s=r?new RegExp(`${r}://*.[^\\s]+`,"g"):new RegExp("https?://*.[^\\s]+","g"),n=[];for(const r in e)n.push(e[r].replace(s,""));return n}catch(e){console.log('This function can handle just string arrays.\nExample: removeAcentsArray(["First", "Second", "Third"])',e)}};exports.removeLinksArray=removeLinksArray;