Skip to content

Commit 0d04c0a

Browse files
committed
Update dev-dependencies
1 parent 79fe33a commit 0d04c0a

File tree

4 files changed

+29
-26
lines changed

4 files changed

+29
-26
lines changed

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
coverage/
22
nlcst-is-literal.js
33
nlcst-is-literal.min.js
4+
*.json
5+
*.md

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ function isLiteral(parent, index) {
116116
// Check if the node in `parent` at `position` is enclosed by matching
117117
// delimiters.
118118
function isWrapped(parent, position, delimiters) {
119-
var prev = previousDelimiter(parent, position, delimiters)
119+
var previous = previousDelimiter(parent, position, delimiters)
120120
var next
121121

122-
if (prev) {
123-
next = nextDelimiter(parent, position, delimiters[toString(prev)])
122+
if (previous) {
123+
next = nextDelimiter(parent, position, delimiters[toString(previous)])
124124
}
125125

126126
return Boolean(next)

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@
3131
"devDependencies": {
3232
"browserify": "^16.0.0",
3333
"nyc": "^15.0.0",
34-
"prettier": "^1.0.0",
35-
"remark-cli": "^7.0.0",
36-
"remark-preset-wooorm": "^6.0.0",
34+
"prettier": "^2.0.0",
35+
"remark-cli": "^8.0.0",
36+
"remark-preset-wooorm": "^7.0.0",
3737
"retext": "^7.0.0",
38-
"tape": "^4.0.0",
38+
"tape": "^5.0.0",
3939
"tinyify": "^2.0.0",
4040
"unist-util-visit": "^2.0.0",
41-
"xo": "^0.26.0"
41+
"xo": "^0.32.0"
4242
},
4343
"scripts": {
44-
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
44+
"format": "remark . -qfo && prettier . --write && xo --fix",
4545
"build-bundle": "browserify . -s nlcstIsLiteral -o nlcst-is-literal.js",
4646
"build-mangle": "browserify . -s nlcstIsLiteral -p tinyify -o nlcst-is-literal.min.js",
4747
"build": "npm run build-bundle && npm run build-mangle",
@@ -67,6 +67,7 @@
6767
"prettier": true,
6868
"esnext": false,
6969
"rules": {
70+
"unicorn/prefer-number-properties": "off",
7071
"unicorn/prefer-type-error": "off"
7172
},
7273
"ignore": [

test.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,51 @@ var visit = require('unist-util-visit')
66
var retext = require('retext')
77
var isLiteral = require('.')
88

9-
test('isLiteral()', function(t) {
9+
test('isLiteral()', function (t) {
1010
t.throws(
11-
function() {
11+
function () {
1212
isLiteral()
1313
},
1414
/Parent must be a node/,
1515
'should throw without arguments'
1616
)
1717

1818
t.throws(
19-
function() {
19+
function () {
2020
isLiteral({})
2121
},
2222
/Parent must be a node/,
2323
'should throw without parent'
2424
)
2525

2626
t.throws(
27-
function() {
27+
function () {
2828
isLiteral({children: []})
2929
},
3030
/Index must be a number/,
3131
'should throw without node'
3232
)
3333

3434
t.throws(
35-
function() {
35+
function () {
3636
isLiteral({children: []}, {type: 'a'})
3737
},
3838
/Node must be a child of `parent`/,
3939
'should throw if `node` is not in `parent`'
4040
)
4141

42-
t.doesNotThrow(function() {
42+
t.doesNotThrow(function () {
4343
var n = {type: 'a'}
4444
isLiteral({children: [n]}, n)
4545
}, 'should not throw if `node` is in `parent`')
4646

47-
t.doesNotThrow(function() {
48-
process('Well? Ha! Funky', function(node, index, parent) {
47+
t.doesNotThrow(function () {
48+
process('Well? Ha! Funky', function (node, index, parent) {
4949
assert.strictEqual(isLiteral(parent, index), false)
5050
})
5151
}, 'should work on single word sentences')
5252

53-
t.doesNotThrow(function() {
53+
t.doesNotThrow(function () {
5454
;[
5555
'Foo - is meant as a literal.',
5656
'Foo – is meant as a literal.',
@@ -61,14 +61,14 @@ test('isLiteral()', function(t) {
6161
'Foo—is meant as a literal.',
6262
'Foo: is meant as a literal.',
6363
'Foo; is meant as a literal.'
64-
].forEach(function(fixture) {
65-
process(fixture, function(node, index, parent) {
64+
].forEach(function (fixture) {
65+
process(fixture, function (node, index, parent) {
6666
assert.strictEqual(isLiteral(parent, index), index === 0, fixture)
6767
})
6868
})
6969
}, 'Initial')
7070

71-
t.doesNotThrow(function() {
71+
t.doesNotThrow(function () {
7272
;[
7373
'Meant as a literal is - foo.',
7474
'Meant as a literal is – foo.',
@@ -79,8 +79,8 @@ test('isLiteral()', function(t) {
7979
'Meant as a literal is—foo.',
8080
'Meant as a literal is: foo.',
8181
'Meant as a literal is; foo.'
82-
].forEach(function(fixture) {
83-
process(fixture, function(node, index, parent) {
82+
].forEach(function (fixture) {
83+
process(fixture, function (node, index, parent) {
8484
assert.strictEqual(
8585
isLiteral(parent, index),
8686
index === parent.children.length - 2,
@@ -90,7 +90,7 @@ test('isLiteral()', function(t) {
9090
})
9191
}, 'Final')
9292

93-
t.doesNotThrow(function() {
93+
t.doesNotThrow(function () {
9494
;[
9595
'The word, foo, is meant as a literal.',
9696
'The word -foo- is meant as a literal.',
@@ -118,8 +118,8 @@ test('isLiteral()', function(t) {
118118
'The word {foo} is meant as a literal.',
119119
'The word ⟨foo⟩ is meant as a literal.',
120120
'The word 「foo」 is meant as a literal.'
121-
].forEach(function(fixture, n) {
122-
process(fixture, function(node, index, parent) {
121+
].forEach(function (fixture, n) {
122+
process(fixture, function (node, index, parent) {
123123
var pos = 5
124124

125125
// Adjacent hyphens are part of the word.

0 commit comments

Comments
 (0)