1.0.0 • Published 6 years ago
@zenjs/underscore v1.0.0
@zenjs/underscore
A port of node.inflection method .underscore, but there are some differences in string processing:
When the first character is _, this _ will not be removed like node.inflection.underscore and will still be preserved.
Installation
Install inflection through npm
npm install @zenjs/underscoreDescription
This function transforms String object from camelcase to underscore.
Arguments
str
type: String
desc: The subject string.all_upper_case
type: Boolean
desc: Default is to lowercase and add underscore prefixExample code
const underscore = require('@zenjs/uppercase')
underscore('MessageProperties') // Return 'message_properties'
underscore('messageProperties') // Return 'message_properties'
underscore('MP') // Return 'm_p'
underscore('MP', true) // Return 'MP'
underscore('_createdAt') // Return '_created_at'1.0.0
6 years ago