Skip to content

Commit

Permalink
Merge b74cefa into 12dbbc9
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Jan 12, 2019
2 parents 12dbbc9 + b74cefa commit 82bcaf9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions change-case.d.ts
Expand Up @@ -27,6 +27,8 @@ export { camelCase, camelCase as camel }
export { snakeCase, snakeCase as snake }
export { titleCase, titleCase as title }
export { paramCase, paramCase as param }
export { paramCase as kebabCase, paramCase as kebab }
export { paramCase as hyphenCase, paramCase as hyphen }
export { headerCase, headerCase as header }
export { pascalCase, pascalCase as pascal }
export { constantCase, constantCase as constant }
Expand Down
2 changes: 2 additions & 0 deletions change-case.js
Expand Up @@ -8,6 +8,8 @@ exports.camel = exports.camelCase = require('camel-case')
exports.snake = exports.snakeCase = require('snake-case')
exports.title = exports.titleCase = require('title-case')
exports.param = exports.paramCase = require('param-case')
exports.kebab = exports.kebabCase = exports.paramCase
exports.hyphen = exports.hyphenCase = exports.paramCase
exports.header = exports.headerCase = require('header-case')
exports.pascal = exports.pascalCase = require('pascal-case')
exports.constant = exports.constantCase = require('constant-case')
Expand Down
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -24,6 +24,8 @@
"lower",
"upper",
"param",
"kebab",
"hyphen",
"dot",
"path",
"constant",
Expand Down
16 changes: 16 additions & 0 deletions test.js
Expand Up @@ -101,6 +101,22 @@ describe('change case', function () {
assert.equal(changeCase.paramCase('a---better__test'), 'a-better-test')
})

it('should convert to kebab case', function () {
assert.equal(changeCase.kebab('testString'), 'test-string')
assert.equal(changeCase.kebabCase('Test String'), 'test-string')
assert.equal(changeCase.kebabCase('Test_String'), 'test-string')
assert.equal(changeCase.kebabCase('Test-String'), 'test-string')
assert.equal(changeCase.kebabCase('a---better__test'), 'a-better-test')
})

it('should convert to hyphen case', function () {
assert.equal(changeCase.hyphen('testString'), 'test-string')
assert.equal(changeCase.hyphenCase('Test String'), 'test-string')
assert.equal(changeCase.hyphenCase('Test_String'), 'test-string')
assert.equal(changeCase.hyphenCase('Test-String'), 'test-string')
assert.equal(changeCase.hyphenCase('a---better__test'), 'a-better-test')
})

it('should convert to constant case', function () {
assert.equal(changeCase.constant('testString'), 'TEST_STRING')
assert.equal(changeCase.constantCase('Test String'), 'TEST_STRING')
Expand Down

0 comments on commit 82bcaf9

Please sign in to comment.