@achipiga/decamelize 中文文档教程

发布于 4年前 浏览 15 项目主页 更新于 3年前

decamelize Build Status

使用自定义分隔符将驼峰化字符串转换为小写字符串
示例:unicornRainbowunicorn_rainbow

Install

$ npm install decamelize

Usage

const decamelize = require('decamelize');

decamelize('unicornRainbow');
//=> 'unicorn_rainbow'

decamelize('unicornRainbow', '-');
//=> 'unicorn-rainbow'

API

decamelize(input, separator?)

input

类型:string

separator

类型:string
默认值:_

请参阅 camelcase 以了解相反的情况。


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

decamelize Build Status

Convert a camelized string into a lowercased one with a custom separator
Example: unicornRainbowunicorn_rainbow

Install

$ npm install decamelize

Usage

const decamelize = require('decamelize');

decamelize('unicornRainbow');
//=> 'unicorn_rainbow'

decamelize('unicornRainbow', '-');
//=> 'unicorn-rainbow'

API

decamelize(input, separator?)

input

Type: string

separator

Type: string
Default: _

See camelcase for the inverse.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文