{"size": 607, "ext": "js", "max_stars_repo_path": "src/utils.js", "max_stars_repo_name": "ishiijp/vuexblaze", "max_stars_repo_stars_event_min_datetime": "2019-01-04T00:49:18.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-08T01:49:38.000Z", "max_issues_repo_path": "src/utils.js", "max_issues_repo_name": "ishiijp/vuexblaze", "max_issues_repo_issues_event_min_datetime": "2021-09-01T15:58:42.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T13:55:35.000Z", "max_forks_repo_path": "src/utils.js", "max_forks_repo_name": "ishiijp/vuexblaze", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 9, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 37.9375, "max_line_length": 77, "alphanum_fraction": 0.6836902801}
import { VUEXBLAZE_SNAKE_CASE, VUEXBLAZW_CONST_CASE } from './options'

import { camelCase, upperFirst, snakeCase } from 'lodash'

export const actionNamer = caseName => {
  if (caseName === VUEXBLAZE_SNAKE_CASE) {
    return (action, target) => `${action}_${snakeCase(target)}`.toLowerCase()
  } else if (caseName === VUEXBLAZW_CONST_CASE) {
    return (action, target) => `${action}_${snakeCase(target)}`.toUpperCase()
  }
  return (action, target) => `${action}${upperFirst(camelCase(target))}`
}

export const isObject = o => o && typeof o === 'object'
export const isReference = o => o && o.onSnapshot
