Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/matchAllWords
Browse files Browse the repository at this point in the history
  • Loading branch information
kmachado committed Mar 30, 2017
2 parents 5f81b07 + c7c01ef commit 8d8c5f6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 1.10.0
- Add `matchAllWord`
- Add `matchAllWords`

# 1.9.0
- Added regex and postings based highlighting functions `postings`, `postingsForWords`, `highlightFromPostings`, `highlight`
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ Example: `{ a: { b: { c: 1 } } } => { 'a.b.c' : 1 }`.

### matchAnyWord
`string -> string -> bool` Returns true if the second string matches any of the words in the first string.
### matchAllWord

### matchAllWords
`string -> string -> bool` Returns true if the second string matches all of the words in the first string.

### postings
Expand Down
2 changes: 1 addition & 1 deletion src/regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const matchAnyWord = _.flow(
_.map(makeAndTest('gi')),
_.overSome
)
export const matchAllWord = _.flow(
export const matchAllWords = _.flow(
_.words,
_.map(makeAndTest('gi')),
_.overEvery
Expand Down
4 changes: 2 additions & 2 deletions test/regex.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ describe('Regexp Functions', () => {
expect(match(text)).to.equal(true)
})

it('matchAllWord', () => {
it('matchAllWords', () => {
const reText = 'Some text'
const text = 'Here is some to test'
const match = f.matchAllWord(reText)
const match = f.matchAllWords(reText)

expect(match(text)).to.equal(false)
})
Expand Down

0 comments on commit 8d8c5f6

Please sign in to comment.