Skip to content

Commit

Permalink
function refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
huckbit committed Aug 17, 2020
1 parent d7ab3a5 commit 2837ab5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ yarn add extract-urls
### unpkg

```html
<script src="https://unpkg.com/extract-urls@1.1.2/index.js"></script>
<script src="https://unpkg.com/extract-urls@1.2.0/index.js"></script>
```

## Usage
Expand Down
6 changes: 1 addition & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ module.exports = (str) => {
}

if (str) {
return str
.replace(/\n/g, " ")
.split(" ")
.filter((item) => item.match(regexp))
.map((item) => item.toLowerCase());
return str.match(regexp).map((item) => item.toLowerCase());
} else {
undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "extract-urls",
"version": "1.1.2",
"version": "1.2.0",
"main": "index.js",
"author": {
"name": "Massimiliano Ranauro",
Expand Down

0 comments on commit 2837ab5

Please sign in to comment.