rambda 10.2.0 → 10.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ export function mapPropObject(fn, prop) {
2
+ return obj => {
3
+ if (!Array.isArray(obj[prop])) return obj
4
+
5
+ return {
6
+ ...obj,
7
+ [prop]: obj[prop].map(fn)
8
+ }
9
+ }
10
+ }
package/src/propOr.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defaultTo } from './defaultTo.js'
2
2
 
3
- export function propOr(defaultValue, property) {
3
+ export function propOr(property, defaultValue) {
4
4
  return obj => {
5
5
  if (!obj) {
6
6
  return defaultValue
@@ -0,0 +1,10 @@
1
+ export function replaceAll(patterns, replacer) {
2
+ return input => {
3
+ let text = input
4
+ patterns.forEach(singlePattern => {
5
+ text = text.replace(singlePattern, replacer)
6
+ })
7
+
8
+ return text
9
+ }
10
+ }