Skip to content

Commit

Permalink
Correcting what comes input first and second
Browse files Browse the repository at this point in the history
hightlight([query array], [item array], {highlighting object})
  • Loading branch information
eklem committed Sep 21, 2019
1 parent ef51253 commit 4373afb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ hightlight([query array], [item array], {highlighting object})
### Default highlighting

```javaScript
const item = ['some', 'interesting', 'words', 'to', 'remember']
const query = ['interesting', 'words']
const item = ['some', 'interesting', 'words', 'to', 'remember']

highlight(item, query)
highlight(query, item)

// returns:
//[
Expand All @@ -62,11 +62,11 @@ highlight(item, query)
### Custom highlight.start and .end

```javaScript
const item = ['some', 'interesting', 'words', 'to', 'remember']
const query = ['interesting', 'words']
const item = ['some', 'interesting', 'words', 'to', 'remember']
const highlighting = { start: '**', end: '**' }

highlight(item, query, highlighting)
highlight(query, item, highlighting)

// returns:
//[
Expand All @@ -81,10 +81,10 @@ highlight(item, query, highlighting)
### No hits, returing item untouched

```javaScript
const item = ['some', 'interesting', 'words', 'to', 'remember']
const query = ['no', 'hits']
const item = ['some', 'interesting', 'words', 'to', 'remember']

highlight(item, query)
highlight(query, item)

// returns:
//[
Expand Down

0 comments on commit 4373afb

Please sign in to comment.