Skip to content

Commit 94bd26e

Browse files
committed
Update dev-dependencies
1 parent 3c22e15 commit 94bd26e

39 files changed

+85
-80
lines changed

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.nyc_output/
12
coverage/
23
hast-util-to-html.js
34
hast-util-to-html.min.js
5+
*.json
6+
*.md

lib/doctype.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,36 @@ function serializeDoctype(ctx, node) {
1515
var name = node.name
1616
var pub = node.public
1717
var sys = node.system
18-
var val = ['<!' + doc]
18+
var parts = ['<!' + doc]
1919

2020
if (name) {
21-
val.push(sep, name)
21+
parts.push(sep, name)
2222

2323
if (pub !== null && pub !== undefined) {
24-
val.push(' public', sep, quote(ctx, pub))
24+
parts.push(' public', sep, quote(ctx, pub))
2525
} else if (sys !== null && sys !== undefined) {
26-
val.push(' system')
26+
parts.push(' system')
2727
}
2828

2929
if (sys !== null && sys !== undefined) {
30-
val.push(sep, quote(ctx, sys))
30+
parts.push(sep, quote(ctx, sys))
3131
}
3232
}
3333

34-
return val.join('') + '>'
34+
return parts.join('') + '>'
3535
}
3636

3737
function quote(ctx, value) {
3838
var primary = ctx.quote
3939
var secondary = ctx.alternative
40-
var val = String(value)
40+
var string = String(value)
4141
var quote =
42-
ccount(val, primary) > ccount(val, secondary) ? secondary : primary
42+
ccount(string, primary) > ccount(string, secondary) ? secondary : primary
4343

4444
return (
4545
quote +
4646
// Prevent breaking out of doctype.
47-
entities(val, xtend(ctx.entities, {subset: ['<', '&', quote]})) +
47+
entities(string, xtend(ctx.entities, {subset: ['<', '&', quote]})) +
4848
quote
4949
)
5050
}

lib/omission/opening.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,14 @@ function body(node) {
7070
// implement in the closing tag, to the same effect, so we handle it there
7171
// instead.
7272
function colgroup(node, index, parent) {
73-
var prev = before(parent, index)
73+
var previous = before(parent, index)
7474
var head = first(node, true)
7575

7676
// Previous colgroup was already omitted.
77-
if (element(prev, 'colgroup') && closing(prev, place(parent, prev), parent)) {
77+
if (
78+
element(previous, 'colgroup') &&
79+
closing(previous, place(parent, previous), parent)
80+
) {
7881
return false
7982
}
8083

@@ -83,13 +86,13 @@ function colgroup(node, index, parent) {
8386

8487
// Whether to omit `<tbody>`.
8588
function tbody(node, index, parent) {
86-
var prev = before(parent, index)
89+
var previous = before(parent, index)
8790
var head = first(node)
8891

8992
// Previous table section was already omitted.
9093
if (
91-
element(prev, tableContainers) &&
92-
closing(prev, place(parent, prev), parent)
94+
element(previous, tableContainers) &&
95+
closing(previous, place(parent, previous), parent)
9396
) {
9497
return false
9598
}

package.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@
4848
"dtslint": "^3.0.0",
4949
"hastscript": "^5.0.0",
5050
"nyc": "^15.0.0",
51-
"prettier": "^1.0.0",
52-
"remark-cli": "^7.0.0",
53-
"remark-preset-wooorm": "^6.0.0",
54-
"tape": "^4.0.0",
51+
"prettier": "^2.0.0",
52+
"remark-cli": "^8.0.0",
53+
"remark-preset-wooorm": "^7.0.0",
54+
"tape": "^5.0.0",
5555
"tinyify": "^2.0.0",
5656
"unist-builder": "^2.0.0",
57-
"xo": "^0.27.0"
57+
"xo": "^0.30.0"
5858
},
5959
"scripts": {
60-
"format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix",
60+
"format": "remark . -qfo && prettier --write . && xo --fix",
6161
"build-bundle": "browserify . -s hastUtilToHtml > hast-util-to-html.js",
6262
"build-mangle": "browserify . -s hastUtilToHtml -p tinyify > hast-util-to-html.min.js",
6363
"build": "npm run build-bundle && npm run build-mangle",
@@ -78,8 +78,9 @@
7878
"prettier": true,
7979
"esnext": false,
8080
"rules": {
81-
"guard-for-in": "off",
82-
"unicorn/prefer-includes": "off"
81+
"unicorn/prefer-includes": "off",
82+
"unicorn/prefer-number-properties": "off",
83+
"guard-for-in": "off"
8384
},
8485
"ignores": [
8586
"hast-util-to-html.js"

readme.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Use [`hast-util-santize`][sanitize] to make the hast tree safe.
186186

187187
## Related
188188

189-
* [`hast-util-sanitize`][hast-util-sanitize]
189+
* [`hast-util-sanitize`][sanitize]
190190
— Sanitize hast nodes
191191
* [`rehype-stringify`](https://github.com/wooorm/rehype/tree/master/packages/rehype-stringify)
192192
— Wrapper around this project for [**rehype**](https://github.com/wooorm/rehype)
@@ -249,8 +249,6 @@ abide by its terms.
249249

250250
[stringify-entities]: https://github.com/wooorm/stringify-entities
251251

252-
[hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize
253-
254252
[tree]: https://github.com/syntax-tree/unist#tree
255253

256254
[root]: https://github.com/syntax-tree/unist#root

test/attribute.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ var h = require('hastscript')
55
var u = require('unist-builder')
66
var to = require('..')
77

8-
test('`element` attributes', function(t) {
9-
t.test('unknown', function(st) {
8+
test('`element` attributes', function (t) {
9+
t.test('unknown', function (st) {
1010
st.deepEqual(
1111
to(u('element', {tagName: 'i', properties: {unknown: false}}, [])),
1212
'<i></i>',
@@ -76,7 +76,7 @@ test('`element` attributes', function(t) {
7676
st.end()
7777
})
7878

79-
t.test('known booleans', function(st) {
79+
t.test('known booleans', function (st) {
8080
st.deepEqual(
8181
to(u('element', {tagName: 'i', properties: {hidden: false}}, [])),
8282
'<i></i>',
@@ -116,7 +116,7 @@ test('`element` attributes', function(t) {
116116
st.end()
117117
})
118118

119-
t.test('known overloaded booleans', function(st) {
119+
t.test('known overloaded booleans', function (st) {
120120
st.deepEqual(
121121
to(u('element', {tagName: 'a', properties: {download: false}}, [])),
122122
'<a></a>',
@@ -168,7 +168,7 @@ test('`element` attributes', function(t) {
168168
st.end()
169169
})
170170

171-
t.test('known numbers', function(st) {
171+
t.test('known numbers', function (st) {
172172
st.deepEqual(
173173
to(u('element', {tagName: 'i', properties: {cols: false}}, [])),
174174
'<i></i>',
@@ -262,7 +262,7 @@ test('`element` attributes', function(t) {
262262
st.end()
263263
})
264264

265-
t.test('known space-separated lists', function(st) {
265+
t.test('known space-separated lists', function (st) {
266266
st.deepEqual(
267267
to(u('element', {tagName: 'i', properties: {className: false}}, [])),
268268
'<i></i>',
@@ -348,7 +348,7 @@ test('`element` attributes', function(t) {
348348
st.end()
349349
})
350350

351-
t.test('known comma-separated lists', function(st) {
351+
t.test('known comma-separated lists', function (st) {
352352
st.deepEqual(
353353
to(u('element', {tagName: 'i', properties: {accept: false}}, [])),
354354
'<i></i>',
@@ -424,7 +424,7 @@ test('`element` attributes', function(t) {
424424
st.end()
425425
})
426426

427-
t.test('known normals', function(st) {
427+
t.test('known normals', function (st) {
428428
st.deepEqual(
429429
to(u('element', {tagName: 'i', properties: {id: false}}, [])),
430430
'<i></i>',
@@ -496,7 +496,7 @@ test('`element` attributes', function(t) {
496496
st.end()
497497
})
498498

499-
t.test('data properties', function(st) {
499+
t.test('data properties', function (st) {
500500
st.deepEqual(
501501
to(u('element', {tagName: 'i', properties: {dataId: false}}, [])),
502502
'<i></i>',
@@ -584,7 +584,7 @@ test('`element` attributes', function(t) {
584584
st.end()
585585
})
586586

587-
t.test('collapseEmptyAttributes', function(st) {
587+
t.test('collapseEmptyAttributes', function (st) {
588588
st.deepEqual(
589589
to(u('element', {tagName: 'i', properties: {id: ''}}, [])),
590590
'<i id=""></i>',
@@ -602,7 +602,7 @@ test('`element` attributes', function(t) {
602602
st.end()
603603
})
604604

605-
t.test('tightAttributes', function(st) {
605+
t.test('tightAttributes', function (st) {
606606
st.deepEqual(
607607
to(u('element', {tagName: 'i', properties: {title: 'a', id: 'b'}}, [])),
608608
'<i title="a" id="b"></i>',
@@ -620,7 +620,7 @@ test('`element` attributes', function(t) {
620620
st.end()
621621
})
622622

623-
t.test('tightCommaSeparatedLists', function(st) {
623+
t.test('tightCommaSeparatedLists', function (st) {
624624
st.deepEqual(
625625
to(u('element', {tagName: 'i', properties: {accept: ['a', 'b']}}, [])),
626626
'<i accept="a, b"></i>',
@@ -638,7 +638,7 @@ test('`element` attributes', function(t) {
638638
st.end()
639639
})
640640

641-
t.test('quote', function(st) {
641+
t.test('quote', function (st) {
642642
st.deepEqual(
643643
to(u('element', {tagName: 'i', properties: {title: 'a'}}, [])),
644644
'<i title="a"></i>',
@@ -678,7 +678,7 @@ test('`element` attributes', function(t) {
678678
)
679679

680680
st.throws(
681-
function() {
681+
function () {
682682
to(h('img'), {quote: '`'})
683683
},
684684
/Invalid quote ```, expected `'` or `"`/,
@@ -688,7 +688,7 @@ test('`element` attributes', function(t) {
688688
st.end()
689689
})
690690

691-
t.test('quoteSmart', function(st) {
691+
t.test('quoteSmart', function (st) {
692692
st.deepEqual(
693693
to(u('element', {tagName: 'i', properties: {title: 'a'}}, []), {
694694
allowDangerousCharacters: true,
@@ -755,7 +755,7 @@ test('`element` attributes', function(t) {
755755
st.end()
756756
})
757757

758-
t.test('preferUnquoted', function(st) {
758+
t.test('preferUnquoted', function (st) {
759759
st.deepEqual(
760760
to(u('element', {tagName: 'i', properties: {id: 'a'}}, []), {
761761
preferUnquoted: true
@@ -783,7 +783,7 @@ test('`element` attributes', function(t) {
783783
st.end()
784784
})
785785

786-
t.test('entities in attributes', function(st) {
786+
t.test('entities in attributes', function (st) {
787787
st.deepEqual(
788788
to(u('element', {tagName: 'i', properties: {'3<5\0': 'a'}}, [])),
789789
'<i 3&#x3C;5&#x0;="a"></i>',

test/comment.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var test = require('tape')
44
var u = require('unist-builder')
55
var to = require('..')
66

7-
test('`comment`', function(t) {
7+
test('`comment`', function (t) {
88
t.deepEqual(
99
to(u('comment', 'alpha')),
1010
'<!--alpha-->',
@@ -47,7 +47,7 @@ test('`comment`', function(t) {
4747
['a<!-b']
4848
]
4949

50-
matrix.forEach(function(d) {
50+
matrix.forEach(function (d) {
5151
var input = d[0]
5252
var output = d[1] || d[0]
5353
var ok = d[1] === undefined

test/core.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ var u = require('unist-builder')
55
var h = require('hastscript')
66
var to = require('..')
77

8-
test('toHtml()', function(t) {
8+
test('toHtml()', function (t) {
99
t.throws(
10-
function() {
10+
function () {
1111
to(true)
1212
},
1313
/Expected node, not `true`/,
1414
'should throw on non-nodes'
1515
)
1616

1717
t.throws(
18-
function() {
18+
function () {
1919
to(u('foo', []))
2020
},
2121
/Cannot compile unknown node `foo`/,

test/doctype.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var test = require('tape')
44
var u = require('unist-builder')
55
var to = require('..')
66

7-
test('`text`', function(t) {
7+
test('`text`', function (t) {
88
t.deepEqual(
99
to(u('doctype')),
1010
'<!doctype>',

test/element.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var test = require('tape')
44
var h = require('hastscript')
55
var to = require('..')
66

7-
test('`element`', function(t) {
7+
test('`element`', function (t) {
88
t.deepEqual(
99
to(h('i', 'bravo')),
1010
'<i>bravo</i>',

test/omission-closing-body.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var h = require('hastscript')
55
var u = require('unist-builder')
66
var to = require('..')
77

8-
test('`body` (closing)', function(t) {
8+
test('`body` (closing)', function (t) {
99
t.deepEqual(
1010
to(h('body'), {omitOptionalTags: true}),
1111
'',

test/omission-closing-caption.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var h = require('hastscript')
55
var u = require('unist-builder')
66
var to = require('..')
77

8-
test('`caption` (closing)', function(t) {
8+
test('`caption` (closing)', function (t) {
99
t.deepEqual(
1010
to(h('caption'), {omitOptionalTags: true}),
1111
'<caption>',

test/omission-closing-colgroup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var h = require('hastscript')
55
var u = require('unist-builder')
66
var to = require('..')
77

8-
test('`colgroup` (closing)', function(t) {
8+
test('`colgroup` (closing)', function (t) {
99
t.deepEqual(
1010
to(h('colgroup'), {omitOptionalTags: true}),
1111
'<colgroup>',

test/omission-closing-dd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var test = require('tape')
44
var h = require('hastscript')
55
var to = require('..')
66

7-
test('`dd` (closing)', function(t) {
7+
test('`dd` (closing)', function (t) {
88
t.deepEqual(
99
to(h('dd'), {omitOptionalTags: true}),
1010
'<dd>',

test/omission-closing-dt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var test = require('tape')
44
var h = require('hastscript')
55
var to = require('..')
66

7-
test('`dt` (closing)', function(t) {
7+
test('`dt` (closing)', function (t) {
88
t.deepEqual(
99
to(h('dt'), {omitOptionalTags: true}),
1010
'<dt></dt>',

test/omission-closing-head.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var h = require('hastscript')
55
var u = require('unist-builder')
66
var to = require('..')
77

8-
test('`head` (closing)', function(t) {
8+
test('`head` (closing)', function (t) {
99
t.deepEqual(
1010
to(h('head'), {omitOptionalTags: true}),
1111
'<head>',

0 commit comments

Comments
 (0)