import R from 'ramda';

// a -> a
const spaceCase = R.compose(
  R.trim,
  R.replace(/([a-z])([A-Z])/g, '$1 $2'),
  R.replace(/(\.|-|_)/g, ' ')
);

export default spaceCase;

import R from 'ramda';
import compose from './util/compose.js';

// a -> a
const spaceCase = compose(
  R.trim,
  R.replace(/([a-z])([A-Z])/g, '$1 $2'),
  R.replace(/(\.|-|_)/g, ' ')
);

export default spaceCase;

Refactor spaceCase function to use custom compose function
Refactor spaceCase function to use custom compose function
