ramda-adjunct
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -0,1 +1,13 @@ | ||
<a name="1.5.0"></a> | ||
# [1.5.0](https://github.com/char0n/ramda-adjunct/compare/v1.4.0...v1.5.0) (2017-05-10) | ||
### Features | ||
* add renameKeys ([1a2538e](https://github.com/char0n/ramda-adjunct/commit/1a2538e)) | ||
* add renameKeysWith ([fb5059c](https://github.com/char0n/ramda-adjunct/commit/fb5059c)) | ||
* expose ap as internal util ([16e2535](https://github.com/char0n/ramda-adjunct/commit/16e2535)), closes [#64](https://github.com/char0n/ramda-adjunct/issues/64) | ||
<a name="1.4.0"></a> | ||
@@ -2,0 +14,0 @@ # [1.4.0](https://github.com/char0n/ramda-adjunct/compare/v1.3.2...v1.4.0) (2017-04-28) |
@@ -7,3 +7,3 @@ { | ||
"keywords": "ramda extensions addons cookbook adjunct recipe extras", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"homepage": "https://github.com/char0n/ramda-adjunct", | ||
@@ -10,0 +10,0 @@ "license": "SEE LICENSE IN LICENSE.md", |
@@ -6,2 +6,3 @@ [![CircleCI](https://circleci.com/gh/char0n/ramda-adjunct.svg?style=svg)](https://circleci.com/gh/char0n/ramda-adjunct) | ||
[![npm](https://img.shields.io/npm/dm/ramda-adjunct.svg)](https://www.npmjs.com/package/ramda-adjunct) | ||
[![dependencies Status](https://david-dm.org/char0n/ramda-adjunct/status.svg)](https://david-dm.org/char0n/ramda-adjunct) | ||
[![devDependencies Status](https://david-dm.org/char0n/ramda-adjunct/dev-status.svg)](https://david-dm.org/char0n/ramda-adjunct?type=dev) | ||
@@ -68,18 +69,11 @@ [![peerDependencies Status](https://david-dm.org/char0n/ramda-adjunct/peer-status.svg)](https://david-dm.org/char0n/ramda-adjunct?type=peer) | ||
- [0.0.1](https://char0n.github.io/ramda-adjunct/0.0.1) | ||
- [0.1.0](https://char0n.github.io/ramda-adjunct/0.1.0) | ||
- [0.2.0](https://char0n.github.io/ramda-adjunct/0.2.0) | ||
- [0.3.0](https://char0n.github.io/ramda-adjunct/0.3.0) | ||
- [0.4.0](https://char0n.github.io/ramda-adjunct/0.4.0) | ||
- [0.5.1](https://char0n.github.io/ramda-adjunct/0.5.1) | ||
- [0.6.0](https://char0n.github.io/ramda-adjunct/0.6.0) | ||
- [0.7.0](https://char0n.github.io/ramda-adjunct/0.7.0) | ||
- [1.0.0](https://char0n.github.io/ramda-adjunct/1.0.0) | ||
- [1.1.0](https://char0n.github.io/ramda-adjunct/1.1.0) | ||
- [1.2.0](https://char0n.github.io/ramda-adjunct/1.2.0) | ||
- [1.3.0](https://char0n.github.io/ramda-adjunct/1.3.0) | ||
- [1.3.1](https://char0n.github.io/ramda-adjunct/1.3.1) | ||
- [1.3.2](https://char0n.github.io/ramda-adjunct/1.3.2) | ||
- [1.4.0](https://char0n.github.io/ramda-adjunct/1.4.0) | ||
- [Latest](https://char0n.github.io/ramda-adjunct) | ||
[0.0.1](https://char0n.github.io/ramda-adjunct/0.0.1), [0.1.0](https://char0n.github.io/ramda-adjunct/0.1.0), | ||
[0.2.0](https://char0n.github.io/ramda-adjunct/0.2.0), [0.3.0](https://char0n.github.io/ramda-adjunct/0.3.0), | ||
[0.4.0](https://char0n.github.io/ramda-adjunct/0.4.0), [0.5.1](https://char0n.github.io/ramda-adjunct/0.5.1), | ||
[0.6.0](https://char0n.github.io/ramda-adjunct/0.6.0), [0.7.0](https://char0n.github.io/ramda-adjunct/0.7.0), | ||
[1.0.0](https://char0n.github.io/ramda-adjunct/1.0.0), [1.1.0](https://char0n.github.io/ramda-adjunct/1.1.0), | ||
[1.2.0](https://char0n.github.io/ramda-adjunct/1.2.0), [1.3.0](https://char0n.github.io/ramda-adjunct/1.3.0), | ||
[1.3.1](https://char0n.github.io/ramda-adjunct/1.3.1), [1.3.2](https://char0n.github.io/ramda-adjunct/1.3.2), | ||
[1.4.0](https://char0n.github.io/ramda-adjunct/1.4.0), [1.5.0](https://char0n.github.io/ramda-adjunct/1.5.0), | ||
[LATEST](https://char0n.github.io/ramda-adjunct) | ||
@@ -86,0 +80,0 @@ ## Development |
@@ -270,2 +270,17 @@ declare var RA: RamdaAdjunct.Static; | ||
} | ||
/** | ||
* Creates a new object with the own properties of the provided object, but the | ||
* keys renamed according to the keysMap object as `{oldKey: newKey}`. | ||
* When some key is not found in the keysMap, then it's passed as-is. | ||
*/ | ||
renameKeys(keysMap: Object, obj: Object): Object | ||
renameKeys(keysMap: Object): (obj: Object) => Object | ||
/** | ||
* Creates a new object with the own properties of the provided object, but the | ||
* keys renamed according to logic of renaming function. | ||
*/ | ||
renameKeysWith(renameFn: (key: any) => any, obj: Object): Object | ||
renameKeysWith(renameFn: (key: any) => any): (obj: Object) => Object | ||
} | ||
@@ -272,0 +287,0 @@ |
@@ -51,2 +51,4 @@ // Type | ||
import paths from './paths'; | ||
import renameKeys from './renameKeys'; | ||
import renameKeysWith from './renameKeysWith'; | ||
@@ -103,2 +105,4 @@ // Type | ||
export { default as paths } from './paths'; | ||
export { default as renameKeys } from './renameKeys'; | ||
export { default as renameKeysWith } from './renameKeysWith'; | ||
@@ -159,4 +163,6 @@ /** | ||
paths, | ||
renameKeys, | ||
renameKeysWith, | ||
}; | ||
export default RA; |
@@ -1,21 +0,5 @@ | ||
import { curry, head, slice, reduce, ap as apR, curryN, map, add, flip } from 'ramda'; | ||
import { curry, head, slice, reduce, curryN, map } from 'ramda'; | ||
import Identity from './internal/fantasy-land/Identity'; | ||
import ap from './internal/ap'; | ||
const m1 = Identity.of(1); | ||
const m2 = Identity.of(2).map(add); | ||
export const createAp = (ap1, ap2) => { | ||
try { | ||
// new version of `ap` starting from ramda version > 0.23.0 | ||
return ap1.ap(ap2) && apR; | ||
} catch (e) { | ||
// old version of `ap` till ramda version <= 0.23.0 | ||
return curryN(2, flip(apR)); | ||
} | ||
}; | ||
const ap = createAp(m2, m1); | ||
/** | ||
@@ -22,0 +6,0 @@ * "lifts" a function to be the specified arity, so that it may "map over" objects that satisfy |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
866796
185
20599
188