chore: ramda-adjunct v2.11.0 release

ramda-adjunct v2.11.0

We’ve just released ramda-adjunct v2.11.0. This release brings four new features: allEqualTo, allIdentical, allIdenticalTo and repeatStr. We’ve also done some changes to our CI infrastructure. We are no longer running nsp checks; the nsp project has been discontinued and is no longer available. We will be using either snyk or github security alerts to replace it. We’ve also amended our README file, it now contains ramda-adjunct branding logo and list of all the articles on the internet that mentions ramda-adjunct (or at least those we could find). Npm distribution package should now be a little bit lighter; we’re only including documents that really needs to be there like LICENSE or README and excluding documents that add no value to the distribution file like CODE_OF_CONDUCT, GOVERNANCE and CONTRIBUTING.

License change

Due to various legal and practical reasons, we’ve decided to change our license copyright notice. It now gives me less prominence and gives implicit prominence to all ramda-adjunct contributors. We think that this is more legally correct. Special thanks to Ben Baltner who wrote a great article about this.

Old copyright notice

Copyright 2017-2018 Vladimír Gorej

New copyright notice

Copyright 2017-2018 Ramda-Adjunct contributors

allEqualTo

Returns true if all items in the list are equivalent to user provided value using R.equals for equality comparisons.

RA.allEqualTo(1, [ 1, 2, 3, 4 ]); //=> false
RA.allEqualTo(1, [ 1, 1, 1, 1 ]); //=> true
RA.allEqualTo({}, [ {}, {} ]); //=> true
RA.allEqualTo(1, []); //=> true

Beware of the behavior regarding the empty list. If the second argument is empty list the function always returns true.

allIdentical

Returns true if all items in the list are equivalent using R.identical for equality comparisons.

RA.allIdentical([ 1, 2, 3, 4 ]); //=> false
RA.allIdentical([ 1, 1, 1, 1 ]); //=> true
RA.allIdentical([]); //=> true
RA.allIdentical([ {}, {} ]); //=> false
RA.allIdentical([ () => {}, () => {} ]); //=> false

allIdenticalTo

Returns true if all items in the list are equivalent to user provided value using R.identical for equality comparisons.

RA.allIdenticalTo(1, [ 1, 2, 3, 4 ]); //=> false
RA.allIdenticalTo(1, [ 1, 1, 1, 1 ]); //=> true
RA.allIdenticalTo(1, []); //=> true
RA.allIdenticalTo({}, [ {}, {} ]); //=> false

Beware of the behavior regarding the empty list. If the second argument is empty list the function always returns true.

repeatStr

Constructs and returns a new string which contains the specified number of copies of the string on which it was called, concatenated together. This has been very requested feature, so we finally got it in. We had to be careful with the implementation though. We created a mdn compatible ponyfill (not a polyfill) for the environments where String.prototype.repeat() does not exist. If we detect that the String.prototype.repeat() exists we dispatch directly to it and avoid calling our ponyfill. This makes repeatStr possible to use even on very old JavaScript environments.

RA.repeatStr('a', 3); //=> 'aaa'

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…

Ramda Adjunct

Ramda Adjunct is the most popular and most comprehensive set of utilities for use with Ramda, providing a variety of useful, well tested functions with excellent documentation.

Vladimir Gorej

Written by

Ramda Adjunct

Ramda Adjunct is the most popular and most comprehensive set of utilities for use with Ramda, providing a variety of useful, well tested functions with excellent documentation.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade