JSPM

titleize-props

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q23231F
  • License MIT

Capitalize every word in a string prop (excluding links) of a object.

Package Exports

  • titleize-props

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (titleize-props) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

titleize-props

Last version Build Status Coverage Status Dependency status Dev Dependencies Status NPM Status Donate

Capitalize every word in a string prop (excluding links) of a object.

Install

$ npm install titleize-props --save

Usage

const titleizeProps = require('titleize-props')

const output = titleizeProps({
  title: 'TITLEIZE PROPS',
  stars: 1337,
  link: 'http://github.com/Kikobeats/titleize-props'
})

console.log(output)
// {
//  title: 'Titleize Props',
//  stars: 1337,
//  link: 'http://github.com/Kikobeats/titleize-props'
// }
//

API

titleizeProps(obj, [validator])

obj

Type: object

The object to be titleized.

validator(value)

Type: function

The method used for calculate each new key value.

The behavior of the default method:

  • Exclude non strings values.
  • Exclude urls.

License

MIT © Kiko Beats.