Skip to content

Commit a8942d4

Browse files
committed
Refactor code-style
1 parent c59ba4d commit a8942d4

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {toString} from 'nlcst-to-string'
1313
* @param {NormalizeOptions} [options={}]
1414
*/
1515
export function normalize(node, options) {
16-
var value = (typeof node === 'string' ? node : toString(node))
16+
let value = (typeof node === 'string' ? node : toString(node))
1717
.toLowerCase()
1818
.replace(//g, "'")
1919

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@
6262
"trailingComma": "none"
6363
},
6464
"xo": {
65-
"prettier": true,
66-
"rules": {
67-
"no-var": "off",
68-
"prefer-arrow-callback": "off"
69-
}
65+
"prettier": true
7066
},
7167
"remarkConfig": {
7268
"plugins": [

test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
import test from 'tape'
77
import {normalize} from './index.js'
88

9-
test('Basic', function (t) {
10-
t.throws(function () {
9+
test('Basic', (t) => {
10+
t.throws(() => {
1111
// @ts-ignore runtime.
1212
normalize(true)
1313
}, 'should fail when given a boolean')
1414

1515
t.end()
1616
})
1717

18-
test('Case', function (t) {
18+
test('Case', (t) => {
1919
t.equal(normalize('Dont'), 'dont', 'should normalize case (string)')
2020

2121
t.equal(
@@ -44,7 +44,7 @@ test('Case', function (t) {
4444
t.end()
4545
})
4646

47-
test('Apostrophes', function (t) {
47+
test('Apostrophes', (t) => {
4848
t.equal(
4949
normalize("Don't Block-Level"),
5050
'dont blocklevel',
@@ -290,7 +290,7 @@ test('Apostrophes', function (t) {
290290
t.end()
291291
})
292292

293-
test('Dashes', function (t) {
293+
test('Dashes', (t) => {
294294
t.equal(
295295
normalize("Don't Block-Level"),
296296
'dont blocklevel',

0 commit comments

Comments
 (0)