String overview
Added in v1.0.0-alpha
Table of contents
string
camelCase
convert string
to camelCase
Signature
export declare const camelCase: (input: string) => string
Example
import { camelCase } from '@warungpintar/ninshu'
camelCase('camel_case') // output: camelCase
Added in v1.0.0-alpha
snakeCase
convert string
to snake_case
Signature
export declare const snakeCase: (input: string) => string
Example
import { snakeCase } from '@warungpintar/ninshu'
snakeCase('snakeCase') // output: snake_case
Added in v1.0.0-alpha
words
Splits string
into an array of its words.
Signature
export declare const words: (input: string, pattern?: RegExp | string) => string[]
Example
import { words } from '@warungpintar/ninshu'
words('camelCase') // output: ['camel', 'Case']
Added in v1.0.0-alpha