2.0.3 • Published 2 months ago

@loxjs/underscore v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@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/underscore

Description

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 prefix

Example 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'
2.0.3

2 months ago

2.0.2

2 months ago

2.0.1

2 months ago

2.0.0

5 years ago

1.0.0

5 years ago