import R from 'ramda';
import spaceCase from './space-case.js';
import uncapitalize from './uncapitalize.js';

// a -> a
const snakeCase = R.compose(
  uncapitalize,
  R.join('_'),
  R.split(' '),
  spaceCase
);

export default snakeCase;

import R from 'ramda';
import compose from './util/compose.js';
import spaceCase from './space-case.js';
import uncapitalize from './uncapitalize.js';

// a -> a
const snakeCase = compose(
  uncapitalize,
  R.join('_'),
  R.split(' '),
  spaceCase
);

export default snakeCase;

Refactor snakeCase function to use custom compose function
Refactor snakeCase function to use custom compose function
