chore: ramda-adjunct v4.0.0

Vladimír Gorej
Ramda Adjunct
Published in
2 min readApr 6, 2023

--

ramda-adjunct@4.0.0

We’ve just released ramda-adjunct@4.0.0. This is a breaking change release which comes with full support for ramda@0.29.0 (see the ramda release notes what changed there). Note that 4.0.0 will only work with ramda ≥ 0.29.0.

BREAKING CHANGE #1 — propNotEq

The order of first two parameters has changed. This function is based on ramdas propEq, which changed the order of the parameters; thus we made the change as well for consistency reasons.

Before the 4.0.0 release

const abby = { name: 'Abby', age: 7, hair: 'blond' };
const fred = { name: 'Fred', age: 12, hair: 'brown' };
const rusty = { name: 'Rusty', age: 10, hair: 'brown' };
const alois = { name: 'Alois', age: 15, disposition: 'surly' };
const kids = [abby, fred, rusty, alois];
const hasNotBrownHair = RA.propNotEq('hair', 'brown');

R.filter(hasNotBrownHair, kids); //=> [abby, alois]

After the 4.0.0 release

const abby = { name: 'Abby', age: 7, hair: 'blond' };
const fred = { name: 'Fred', age: 12, hair: 'brown' };
const rusty = { name: 'Rusty', age: 10, hair: 'brown' };
const alois = { name: 'Alois', age: 15, disposition: 'surly' };
const kids = [abby, fred, rusty, alois];
const hasNotBrownHair = RA.propNotEq('brown', 'hair');

R.filter(hasNotBrownHair, kids); //=> [abby, alois]

BREAKING CHANGE #1 — pathNotEq

The order of first two parameters has changed. This function is based on ramdas pathEq, which changed the order of the parameters; thus we made the change as well for consistency reasons.

Before the 4.0.0 release

const user1 = { address: { zipCode: 90210 } };
const user2 = { address: { zipCode: 55555 } };
const user3 = { name: 'Bob' };
const users = [ user1, user2, user3 ];
const isFamous = RA.pathNotEq(['address', 'zipCode'], 90210);

R.filter(isFamous, users); //=> [ user2, user3 ]

After the 4.0.0 release

const user1 = { address: { zipCode: 90210 } };
const user2 = { address: { zipCode: 55555 } };
const user3 = { name: 'Bob' };
const users = [ user1, user2, user3 ];
const isFamous = RA.pathNotEq(90210, ['address', 'zipCode']);

R.filter(isFamous, users); //=> [ user2, user3 ]

Like always, I end my article with the following axiom: Define your code-base as pure functions and lift them only if needed. And compose, compose, compose…

--

--

Vladimír Gorej
Ramda Adjunct

Certified Open Source Software Engineer, OSS contributor, author and content creator. OSS is my passion and my profession. GitHub Star.