Skip to content

Commit a67fb07

Browse files
committedJan 21, 2020
Require Node.js 10
1 parent 9122e57 commit a67fb07

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed
 

‎.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ language: node_js
22
node_js:
33
- '12'
44
- '10'
5-
- '8'

‎index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const slugify = (string, options) => {
4242
};
4343

4444
const separator = escapeStringRegexp(options.separator);
45+
4546
const customReplacements = new Map([
4647
...builtinOverridableReplacements,
4748
...options.customReplacements,
@@ -71,5 +72,3 @@ const slugify = (string, options) => {
7172
};
7273

7374
module.exports = slugify;
74-
// TODO: Remove this for the next major release
75-
module.exports.default = slugify;

‎package.json

+10-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
"description": "Slugify a string",
55
"license": "MIT",
66
"repository": "sindresorhus/slugify",
7+
"funding": "https://github.com/sponsors/sindresorhus",
78
"author": {
89
"name": "Sindre Sorhus",
910
"email": "sindresorhus@gmail.com",
1011
"url": "sindresorhus.com"
1112
},
1213
"engines": {
13-
"node": ">=8"
14+
"node": ">=10"
1415
},
1516
"scripts": {
1617
"test": "xo && ava && tsd"
@@ -45,8 +46,13 @@
4546
"lodash.deburr": "^4.1.0"
4647
},
4748
"devDependencies": {
48-
"ava": "^1.4.1",
49-
"tsd": "^0.7.3",
50-
"xo": "^0.24.0"
49+
"ava": "^2.4.0",
50+
"tsd": "^0.11.0",
51+
"xo": "^0.25.3"
52+
},
53+
"xo": {
54+
"rules": {
55+
"prefer-named-capture-group": "off"
56+
}
5157
}
5258
}

‎readme.md

+7-15
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44
55
Useful for URLs, filenames, and IDs.
66

7-
It correctly handles [German umlauts](https://en.wikipedia.org/wiki/Germanic_umlaut), Vietnamese, Arabic, Russian, Romanian, Turkish and more.
8-
7+
It correctly handles [German umlauts](https://en.wikipedia.org/wiki/Germanic_umlaut), Vietnamese, Arabic, Russian, Romanian, Turkish, and more.
98

109
## Install
1110

1211
```
1312
$ npm install @sindresorhus/slugify
1413
```
1514

16-
1715
## Usage
1816

1917
```js
@@ -38,7 +36,7 @@ slugify('I ♥ 🦄 & 🐶', {
3836

3937
## API
4038

41-
### slugify(string, [options])
39+
### slugify(string, options?)
4240

4341
#### string
4442

@@ -52,8 +50,8 @@ Type: `object`
5250

5351
##### separator
5452

55-
Type: `string`<br>
56-
Default: `-`
53+
Type: `string`\
54+
Default: `'-'`
5755

5856
```js
5957
const slugify = require('@sindresorhus/slugify');
@@ -67,7 +65,7 @@ slugify('BAR and baz', {separator: '_'});
6765

6866
##### lowercase
6967

70-
Type: `boolean`<br>
68+
Type: `boolean`\
7169
Default: `true`
7270

7371
Make the slug lowercase.
@@ -84,7 +82,7 @@ slugify('Déjà Vu!', {lowercase: false});
8482

8583
##### decamelize
8684

87-
Type: `boolean`<br>
85+
Type: `boolean`\
8886
Default: `true`
8987

9088
Convert camelcase to separate words. Internally it does `fooBar``foo bar`.
@@ -101,7 +99,7 @@ slugify('fooBar', {decamelize: false});
10199

102100
##### customReplacements
103101

104-
Type: `Array<string[]>`<br>
102+
Type: `Array<string[]>`\
105103
Default: `[
106104
['&', ' and '],
107105
['🦄', ' unicorn '],
@@ -134,13 +132,7 @@ slugify('foo@unicorn', {
134132
//=> 'foo-at-unicorn'
135133
```
136134

137-
138135
## Related
139136

140137
- [slugify-cli](https://github.com/sindresorhus/slugify-cli) - CLI for this module
141138
- [filenamify](https://github.com/sindresorhus/filenamify) - Convert a string to a valid safe filename
142-
143-
144-
## License
145-
146-
MIT © [Sindre Sorhus](https://sindresorhus.com)

0 commit comments

Comments
 (0)
Please sign in to comment.