@sindresorhus/slugify
Advanced tools
Comparing version 0.8.0 to 0.9.0
12
index.js
@@ -27,3 +27,3 @@ 'use strict'; | ||
module.exports = (string, options) => { | ||
const slugify = (string, options) => { | ||
if (typeof string !== 'string') { | ||
@@ -33,8 +33,9 @@ throw new TypeError(`Expected a string, got \`${typeof string}\``); | ||
options = Object.assign({ | ||
options = { | ||
separator: '-', | ||
lowercase: true, | ||
decamelize: true, | ||
customReplacements: [] | ||
}, options); | ||
customReplacements: [], | ||
...options | ||
}; | ||
@@ -69,1 +70,4 @@ const separator = escapeStringRegexp(options.separator); | ||
}; | ||
module.exports = slugify; | ||
module.exports.default = slugify; |
{ | ||
"name": "@sindresorhus/slugify", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "Slugify a string", | ||
@@ -13,9 +13,10 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=8" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
"test": "xo && ava && tsd-check" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts", | ||
"replacements.js", | ||
@@ -48,5 +49,6 @@ "overridable-replacements.js" | ||
"devDependencies": { | ||
"ava": "^0.25.0", | ||
"xo": "^0.23.0" | ||
"ava": "^1.3.1", | ||
"tsd-check": "^0.3.0", | ||
"xo": "^0.24.0" | ||
} | ||
} |
@@ -57,2 +57,4 @@ # slugify [![Build Status](https://travis-ci.org/sindresorhus/slugify.svg?branch=master)](https://travis-ci.org/sindresorhus/slugify) | ||
```js | ||
const slugify = require('@sindresorhus/slugify'); | ||
slugify('BAR and baz'); | ||
@@ -73,2 +75,4 @@ //=> 'bar-and-baz' | ||
```js | ||
const slugify = require('@sindresorhus/slugify'); | ||
slugify('Déjà Vu!'); | ||
@@ -89,2 +93,4 @@ //=> 'deja-vu' | ||
```js | ||
const slugify = require('@sindresorhus/slugify'); | ||
slugify('fooBar'); | ||
@@ -109,2 +115,4 @@ //=> 'foo-bar' | ||
```js | ||
const slugify = require('@sindresorhus/slugify'); | ||
slugify('Foo@unicorn', { | ||
@@ -121,2 +129,4 @@ customReplacements: [ | ||
```js | ||
const slugify = require('@sindresorhus/slugify'); | ||
slugify('foo@unicorn', { | ||
@@ -123,0 +133,0 @@ customReplacements: [ |
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
12720
7
462
145
3