Skip to content
A string validator and formater for case Style
Branch: master
Clone or download
Latest commit d959b59 May 13, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig INITIal commit Apr 30, 2019
.eslintrc.json INITIal commit Apr 30, 2019
.travis.yml INITIal commit Apr 30, 2019
LICENSE Initial commit Apr 30, 2019
README.md Update README.md May 13, 2019
_test.ts lint May 1, 2019
mod.ts INITIal commit Apr 30, 2019
mod_test.ts lint May 1, 2019
tsconfig.json INITIal commit Apr 30, 2019

README.md

Deno Case Style Build Status

A string validator and formater for case Style

Validate

Returns a boolean if the string is validated by the style Case:

import { validate } from "./mod.ts";

validate("SALADE-TOMATE-OIGNONS", caseStyle.screamingKebabCase); // true
validate("DIZ_IZ_DA_GLOBAL_VAL", caseStyle.screamingSnakeCase); // true
validate("SmokingIsBad", caseStyle.camelCase); // false
validate("imNotPascal", caseStyle.pascalCase); // false

Format

Format the input string to the wanted style case

import { format } from "./mod.ts";

format("FOO Bar", caseStyle.kebabCase); // output: foo-bar
format("FOO Bar", caseStyle.snakeCase); // output: foo_bar
format("FOO Bar", caseStyle.camelCase); // output: fooBar
format("FOO Bar", caseStyle.pascalCase); // output: FooBar
format("FOO Bar", caseStyle.kebabCase); // output: foo-bar
format("FOO Bar", caseStyle.screamingKebabCase); // output: FOO-BAR
format("FOO Bar", caseStyle.screamingSnakeCase); // output: FOO_BAR
You can’t perform that action at this time.