Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Updates docs prepping for 1.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
skellock committed Jun 16, 2016
1 parent e9ddd6c commit a3b7826
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Adds a few utilities based on the delicious [Ramda](http://ramdajs.com/) library

`npm i ramdasauce --save`

* Depends on `ramda 0.20.1+`.
* Depends on `ramda 0.21.+`.
* Targets ES5.
* Built with ES6.

Expand All @@ -32,6 +32,10 @@ RS.dotPath('c.x.0', x) // fetches a value from a nested object by a string
// --- Generating Things ---
RS.rangeStep(2, 2, 10) // generates a range of numbers with a step

// --- Finding Things ---
RS.findByProp('id', 'a', [{id: 'a', id: 'b'}]) // finds an object by propEq
RS.findIndexByProp('id', 'a', [{id: 'a', id: 'b'}]) // finds the index of an object by propEq

// --- Predicates ---
RS.isUndefined(qwerty) // check if something is undefined
RS.isNotNil(null) // check if something is not null or undefined
Expand Down Expand Up @@ -113,5 +117,10 @@ Do you have any common `ramda` patterns you use frequently? Drop some issues or

# Release Notes

### 1.1.0 - June 16th, 2016
* Adds findByProp & findIndexByProp - [@kevinvangelder](https://github.com/kevinvangelder)
* Fixes test environment - [@skellock](https://github.com/skellock) [@kevinvangelder](https://github.com/kevinvangelder)
* Bumped dependencies

### 1.0.0 - April 3rd, 2016
* Initial Release
2 changes: 1 addition & 1 deletion lib/findByProp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import R from 'ramda'
* @param {source} (Array) The array to search in.
* @return {Object} The object that matches the search or null if not found.
* @example
* RS.endsWith('o', 'hello') //=> true
* RS.findByProp('id', 'a', [{id: 'a', id: 'b'}]) //=> {id: 'a'}
*/
const findByProp = R.curry(
(prop, value, source) => R.find(R.propEq(prop, value))(source)
Expand Down
4 changes: 2 additions & 2 deletions lib/findIndexByProp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import R from 'ramda'
* @param {source} (Array) The array to search in.
* @return {Integer} The index of the object that matches the search or -1 if not found.
* @example
* RS.endsWith('o', 'hello') //=> true
* RS.findIndexByProp('id', 'a', [{id: 'a', id: 'b'}]) //=> 0
*/
var findIndexByProp = R.curry(
const findIndexByProp = R.curry(
(prop, value, source) => R.findIndex(R.propEq(prop, value))(source)
)

Expand Down

0 comments on commit a3b7826

Please sign in to comment.