Skip to content

Commit ab359ad

Browse files
mdimovskaognen
authored andcommitted
fix: Use ramda named exports (compatibility w/ ramda v0.25) (#98)
* Fix ramda imports (v0.25 does not support default imports) * Change ramda imports (use R. everywhere)
1 parent ea4a4eb commit ab359ad

File tree

31 files changed

+45
-47
lines changed

31 files changed

+45
-47
lines changed

packages/config/src/layer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { pickBy, reverse } from 'ramda'
1+
import * as R from 'ramda'
22
import deepMerge from './utils/merge'
33
import deepFreeze from './utils/freeze'
44

@@ -22,7 +22,7 @@ export default class Layer {
2222
// and overridden with values from the more important profiles
2323
let activeProfiles = profiles
2424
if (profiles) {
25-
activeProfiles = reverse(profiles)
25+
activeProfiles = R.reverse(profiles)
2626
}
2727

2828
// create a sequence of layers, starting from the current one, up to the root, in reverse order (root comes first)
@@ -43,7 +43,7 @@ export default class Layer {
4343
Object.entries(layer.configuration).forEach(
4444
([feature, configOfLayer]) => {
4545
// values from (default) profile
46-
const defaultProfileForLayer = pickBy(
46+
const defaultProfileForLayer = R.pickBy(
4747
(val, key) => key !== 'profiles',
4848
configOfLayer
4949
)

packages/config/src/utils/merge.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { is, mergeWith } from 'ramda'
1+
import * as R from 'ramda'
22

33
export default function deepMerge(a = {}, b = {}) {
4-
return is(Array, b) && !is(Object, b[0])
4+
return R.is(Array, b) && !R.is(Object, b[0])
55
? b
6-
: is(Object, a) && is(Object, b) ? mergeWith(deepMerge, a, b) : b
6+
: R.is(Object, a) && R.is(Object, b) ? R.mergeWith(deepMerge, a, b) : b
77
}

packages/core/src/action.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
import R from 'ramda'
3+
import * as R from 'ramda'
44
import { kindOf } from './data'
55

66
export const actionMetaProperty = '@@girders-elements/_actionMeta'

packages/core/src/data/element.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* @flow */
22
'use strict'
33

4-
import { all, curry } from 'ramda'
4+
import * as R from 'ramda'
55
import invariant from 'invariant'
66
import {
77
List,
@@ -21,7 +21,7 @@ import type { ElementRef, ElementRefCanonical } from './types'
2121
* @param element the element
2222
* @returns {*}
2323
*/
24-
export const isOfKind = curry(function isOfKind(
24+
export const isOfKind = R.curry(function isOfKind(
2525
kind: ElementRef,
2626
element: ?KeyedIterable
2727
): boolean {
@@ -45,7 +45,7 @@ export function isElementRef(obj: any): boolean {
4545
const isString = o => typeof o === 'string'
4646

4747
if (isString(obj)) return true
48-
if (Array.isArray(obj) && (all(isString)(obj) || obj.length === 0))
48+
if (Array.isArray(obj) && (R.all(isString)(obj) || obj.length === 0))
4949
return true
5050
if (obj instanceof List && (obj.every(isString) || obj.isEmpty())) return true
5151

@@ -59,7 +59,7 @@ export function isElementRef(obj: any): boolean {
5959
* @param element tne element
6060
* @returns {*}
6161
*/
62-
export const isExactlyOfKind = curry(function isExactlyOfKind(
62+
export const isExactlyOfKind = R.curry(function isExactlyOfKind(
6363
kind: ElementRef,
6464
element: ?KeyedIterable
6565
): boolean {

packages/core/src/data/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
import R from 'ramda'
3+
import * as R from 'ramda'
44
import * as element from './element'
55
export * from './element'
66

packages/core/src/effect/impl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
import R from 'ramda'
3+
import * as R from 'ramda'
44

55
import * as actions from '../action'
66
import { types as actionTypes } from './actions'

packages/core/src/effect/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
import R from 'ramda'
3+
import * as R from 'ramda'
44
import invariant from 'invariant'
55

66
import { chainRegistries, ActionRegistry } from '../registry'

packages/core/src/engine/__tests__/engine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { mount } from 'enzyme'
44

5-
import R from 'ramda'
5+
import * as R from 'ramda'
66
import React from 'react'
77

88
import * as Subsystem from '../../subsystem'

packages/core/src/engine/impl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
import R from 'ramda'
3+
import * as R from 'ramda'
44
import I from 'immutable'
55
import React from 'react'
66
import PropTypes from 'prop-types'

packages/core/src/enhance/impl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
import R from 'ramda'
3+
import * as R from 'ramda'
44
import I from 'immutable'
55
import * as zip from '../zip'
66

0 commit comments

Comments
 (0)