Socket
Socket
Sign inDemoInstall

mining-utils

Package Overview
Dependencies
308
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.0 to 0.6.0

src/lib/removeLinks.ts

2

package.json
{
"name": "mining-utils",
"version": "0.5.0",
"version": "0.6.0",
"description": "",

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

@@ -30,2 +30,3 @@ # Data Mining

## Implemented Functions
```javascript

@@ -44,3 +45,11 @@ removeAccents('Em linguística, a noção de texto é ampla e ainda aberta a uma definição mais precisa. Grosso modo, pode ser entendido como manifestação linguística das ideias de um autor, que serão interpretadas pelo leitor de acordo com seus conhecimentos linguísticos e culturais. Seu tamanho é variável.')

// output: ['Hey , how are you ?', 'I am good!!']
removeLinks('This is an example to remove links from a single phrase, https://web.whatsapp.com/ and text after the link.')
// output: 'This is an example to remove links from a single phrase, and text after the link.'
removeLinks('This is an example to remove links from a single phrase, mms://link.com/ and text after the link.', 'mms')
// you can pass on second parameter another links pattern for example: 'mms', 'm3u'
// output: 'This is an example to remove links from a single phrase, and text after the link.'
removeLinksArray(['This is an example to remove links from a single phrase, https://web.whatsapp.com/ and text after the link.', 'This is an example to remove links from a single phrase, https://www.instagram.com/ and text after the link.', 'This is an example to remove links from a single phrase, https://www.google.com/ and text after the link.'])
// output: ['This is an example to remove links from a single phrase, and text after the link.', 'This is an example to remove links from a single phrase, and text after the link.', 'This is an example to remove links from a single phrase, and text after the link.']
```
---

@@ -52,3 +61,2 @@

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FOracy%2Fmining-utils.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FOracy%2Fmining-utils?ref=badge_large)

@@ -64,3 +72,15 @@

<tr>
<td align="center"><a href="https://github.com/lu002047"><img src="https://avatars1.githubusercontent.com/u/12716914?v=4" width="100px;" alt="lu002047"/><br /><sub><b>lu002047</b></sub></a><br /><a href="#maintenance-lu002047" title="Maintenance">🚧</a> <a href="https://github.com/Oracy/mining-utils/commits?author=lu002047" title="Code">💻</a> <a href="#review-lu002047" title="Reviewed Pull Requests">👀</a></td>
<td align="center">
<a href="https://github.com/lu002047">
<img src="https://avatars1.githubusercontent.com/u/12716914?v=4" width="100px;" alt="lu002047"/>
<br />
<sub>
<b>lu002047</b>
</sub>
</a>
<br />
<a href="#maintenance-lu002047" title="Maintenance">🚧</a>
<a href="https://github.com/Oracy/mining-utils/commits?author=lu002047" title="Code">💻</a>
<a href="#review-lu002047" title="Reviewed Pull Requests">👀</a>
s</td>
</tr>

@@ -67,0 +87,0 @@ </table>

@@ -5,2 +5,3 @@ import * as mining from '../index'

import { removeAccents, removeAccentsArray } from '../src/lib/removeAccent'
import { removeLinks, removeLinksArray } from '../src/lib/removeLinks'
import { removeBlankSpace, removeBlankSpaceArray, removePunctuation, removePunctuationArray } from '../src/lib/removePunctuation'

@@ -37,2 +38,16 @@

describe('Test to check remove links function', () => {
it('Test if removeLinks is working as expected', () => {
assert.equal(removeLinks('This is an example to remove links from a single phrase, https://web.whatsapp.com/ and text after the link.'), 'This is an example to remove links from a single phrase, and text after the link.')
})
it('Test if removeLinks is working as expected', () => {
assert.equal(removeLinks('This is an example to remove links from a single phrase, mms://web.whatsapp.com/ and text after the link.', 'mms'), 'This is an example to remove links from a single phrase, and text after the link.')
})
it('Test if removeLinksArray is working as expected', () => {
expect(removeLinksArray(['This is an example to remove links from a single phrase, https://web.whatsapp.com/ and text after the link.', 'This is an example to remove links from a single phrase, https://www.instagram.com/ and text after the link.', 'This is an example to remove links from a single phrase, https://www.google.com/ and text after the link.'])).to.deep.equal(['This is an example to remove links from a single phrase, and text after the link.', 'This is an example to remove links from a single phrase, and text after the link.', 'This is an example to remove links from a single phrase, and text after the link.'])
})
})
describe('Test main function!', () => {

@@ -64,2 +79,2 @@ it('Test to check imports in main file.', () => {

})
})
})
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