Skip to content

Commit

Permalink
fix testRegex
Browse files Browse the repository at this point in the history
  • Loading branch information
kmachado committed Mar 30, 2017
1 parent 8d8c5f6 commit 40842b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.10.1
- Fix `testRegex`

# 1.10.0
- Add `matchAllWords`

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": "futil-js",
"version": "1.10.0",
"version": "1.10.1",
"description": "F(unctional) util(ities). Resistance is futile.",
"main": "lib/futil-js.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/regex.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash/fp'
import {push, insertAtIndex, mergeRanges} from './array'

export const testRegex = regex => regex.test.bind(regex)
export const testRegex = _.curry((regex, str) => (new RegExp(regex)).test(str))
export const makeRegex = options => text => RegExp(text, options)
export const makeAndTest = options => _.flow(makeRegex(options), testRegex)
export const matchAnyWord = _.flow(
Expand Down

0 comments on commit 40842b1

Please sign in to comment.