Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "kebab-case", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Convert a string to kebab-case, i.e. its dash separated form", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "xo && ava" | ||
"lint": "eslint *.js", | ||
"pretest": "npm run lint -s", | ||
"test": "node test.js" | ||
}, | ||
@@ -23,3 +25,3 @@ "repository": { | ||
], | ||
"author": "Joakim Carlstein <joakim.carlstein@gmail.com> (http://joakim.beng.se/)", | ||
"author": "Joakim Carlstein <joakim.carlstein@gmail.com> (https://joakim.beng.se/)", | ||
"license": "MIT", | ||
@@ -31,5 +33,5 @@ "bugs": { | ||
"devDependencies": { | ||
"ava": "^0.8.0", | ||
"xo": "^0.12.1" | ||
"eslint": "^7.21.0", | ||
"zora": "^4.0.2" | ||
} | ||
} |
# kebab-case | ||
[![Build status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![XO code style][codestyle-image]][codestyle-url] | ||
[![NPM version][npm-image]][npm-url] | ||
@@ -28,7 +28,7 @@ > Convert a string to kebab-case, i.e. its dash separated form | ||
```javascript | ||
var kebabCase = require('kebab-case'); | ||
var kebabCase = require("kebab-case"); | ||
kebabCase('WebkitTransform'); | ||
kebabCase("WebkitTransform"); | ||
// "-webkit-transform" | ||
kebabCase.reverse('-webkit-transform'); | ||
kebabCase.reverse("-webkit-transform"); | ||
// "WebkitTransform" | ||
@@ -41,5 +41,5 @@ ``` | ||
| Name | Type | Description | | ||
|------|------|-------------| | ||
| str | `String` | The string to convert | | ||
| Name | Type | Description | | ||
| ---- | -------- | --------------------- | | ||
| str | `String` | The string to convert | | ||
@@ -50,5 +50,5 @@ Returns: `String`, the kebab cased string. | ||
| Name | Type | Description | | ||
|------|------|-------------| | ||
| str | `String` | The string to convert back | | ||
| Name | Type | Description | | ||
| ---- | -------- | -------------------------- | | ||
| str | `String` | The string to convert back | | ||
@@ -59,9 +59,5 @@ Returns: `String`, the "unkebab cased" string. | ||
MIT © [Joakim Carlstein](http://joakim.beng.se/) | ||
MIT © [Joakim Carlstein](https://joakim.beng.se/) | ||
[npm-url]: https://npmjs.org/package/kebab-case | ||
[npm-image]: https://badge.fury.io/js/kebab-case.svg | ||
[travis-url]: https://travis-ci.org/joakimbeng/kebab-case | ||
[travis-image]: https://travis-ci.org/joakimbeng/kebab-case.svg?branch=master | ||
[codestyle-url]: https://github.com/sindresorhus/xo | ||
[codestyle-image]: https://img.shields.io/badge/code_style-XO-5ed9c7.svg?style=flat |
36
test.js
@@ -1,28 +0,28 @@ | ||
'use strict'; | ||
const test = require('ava'); | ||
const kebabCase = require('./'); | ||
"use strict"; | ||
const { test } = require("zora"); | ||
const kebabCase = require("./"); | ||
test('string with uppercased letters', t => { | ||
t.is(kebabCase('helloWorld'), 'hello-world'); | ||
t.is(kebabCase('hello World!'), 'hello -world!'); | ||
test("string with uppercased letters", (t) => { | ||
t.equal(kebabCase("helloWorld"), "hello-world"); | ||
t.equal(kebabCase("hello World!"), "hello -world!"); | ||
}); | ||
test('string without uppercased letters', t => { | ||
t.is(kebabCase('hello world'), 'hello world'); | ||
t.is(kebabCase('-- hello world --'), '-- hello world --'); | ||
test("string without uppercased letters", (t) => { | ||
t.equal(kebabCase("hello world"), "hello world"); | ||
t.equal(kebabCase("-- hello world --"), "-- hello world --"); | ||
}); | ||
test('string with leading uppercased letters', t => { | ||
t.is(kebabCase('WebkitTransform'), '-webkit-transform'); | ||
t.is(kebabCase('Mr. Kebab'), '-mr. -kebab'); | ||
test("string with leading uppercased letters", (t) => { | ||
t.equal(kebabCase("WebkitTransform"), "-webkit-transform"); | ||
t.equal(kebabCase("Mr. Kebab"), "-mr. -kebab"); | ||
}); | ||
test('string with international uppercased letters', t => { | ||
t.is(kebabCase('ølÜberÅh'), 'øl-über-åh'); | ||
t.is(kebabCase('Érnest'), '-érnest'); | ||
test("string with international uppercased letters", (t) => { | ||
t.equal(kebabCase("ølÜberÅh"), "øl-über-åh"); | ||
t.equal(kebabCase("Érnest"), "-érnest"); | ||
}); | ||
test('the reverse', t => { | ||
const str = 'Hallå, Mr. Kebab Überstein! How you doin\'?-'; | ||
t.is(kebabCase.reverse(kebabCase(str)), str); | ||
test("the reverse", (t) => { | ||
const str = "Hallå, Mr. Kebab Überstein! How you doin'?-"; | ||
t.equal(kebabCase.reverse(kebabCase(str)), str); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7231
9
49
60