import _ from 'lodash'
import {camelCaseObject, snakeCaseObject, kebabCaseObject} from '../../js/object.js'

function test() {
  // lodash库函数测试
  console.log(_.isObject({}))
  console.log(_.isObject(1))
  console.log(_.isObject(null))
  console.log(_.camelCase('a_bc')) // aBc
  console.log(_.snakeCase('aBc')) // a_bc
  console.log(_.kebabCase('aBc')) // a-bc

  // 单元测试
  let obj = {aBc: 1, en: 'khz', cnNew: '华仔'}
  let objSnake = snakeCaseObject(obj)
  console.log(objSnake)  // { a_bc: 1, en: 'khz', cn_new: '华仔' }
  let objCamel = camelCaseObject(objSnake)
  console.log(objCamel)  // { aBc: 1, en: 'khz', cnNew: '华仔' }
  let objKebab = kebabCaseObject(objSnake)
  console.log(objKebab)  // { 'a-bc': 1, en: 'khz', 'cn-new': '华仔' }
}

test()
