1.0.2 • Published 7 years ago

object-case v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

object-case

Object.entries MUST be supported

installation

yarn add object-case
# or
npm i --save object-case

api

camelCase(a: T): T

snakeCase(a: T): T

usage

import {camelCase, snakeCase} from 'object-case'

const tNum = 1
const tString = 'snake_case'
const tObject = {
  snake_key: 1,
  camelKey: 'immune',
}
const tArray = [tString, tNum, tObject]

console.log(camelCase(tNum))    // 1 ; unsupported types will return self
console.log(camelCase(tString)) // snakeCase
console.log(camelCase(tObject)) // { snakeKey: 1, camelKey: 1 }
console.log(camelCase(tArray))  // [ 'snakeCase', 1, { snakeKey: 1, camelKey: 'immune' } ]

license

MIT

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago