Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jul 23, 2018
1 parent 2bbb066 commit 7115b20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -73,6 +73,8 @@ Default: `[]`

A list of links to be excluded from the final output. It supports regex patterns.

See [matcher](https://github.com/sindresorhus/matcher#matcher-= for know more.

##### removeDuplicates

Type: `boolean`<br>
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -67,7 +67,7 @@ const createGetLinksByAttribute = ({ removeDuplicates }) => {
if (isEmpty(link)) return acc
const isAlreadyAdded = has(acc, uid)
if (isAlreadyAdded) return acc
const match = whitelist && matcher([uid], whitelist)
const match = !isEmpty(whitelist) && matcher([uid], concat(whitelist))
return isEmpty(match) ? concat(acc, link) : acc
},
[]
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Expand Up @@ -190,8 +190,8 @@ describe('html links', () => {

const html = generateHtml({ urls })
const whitelist = [
'https://indiehackers.com**',
'https://www.indiehackers.com**'
'https://indiehackers.com*',
'https://www.indiehackers.com*'
]
const htmlUrls = getLinks({ html, whitelist }).map(
({ normalizedUrl }) => normalizedUrl
Expand Down

0 comments on commit 7115b20

Please sign in to comment.