Skip to content

Commit 71283f0

Browse files
committed
Update dev-dependencies
1 parent a57f299 commit 71283f0

File tree

4 files changed

+28
-26
lines changed

4 files changed

+28
-26
lines changed

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
coverage/
22
hast-util-sanitize.js
33
hast-util-sanitize.min.js
4+
*.json
5+
*.md

lib/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,10 @@ function handleComment(schema) {
332332

333333
// See <https://html.spec.whatwg.org/multipage/parsing.html#serialising-html-fragments>
334334
function handleCommentValue(schema, value) {
335-
var val = typeof value === 'string' ? value : ''
336-
var index = val.indexOf(commentEnd)
335+
var result = typeof value === 'string' ? value : ''
336+
var index = result.indexOf(commentEnd)
337337

338-
return index === -1 ? val : val.slice(0, index)
338+
return index === -1 ? result : result.slice(0, index)
339339
}
340340

341341
// Sanitize `value`.

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@
3939
"hast-util-to-html": "^7.0.0",
4040
"hastscript": "^5.0.0",
4141
"nyc": "^15.0.0",
42-
"prettier": "^1.0.0",
43-
"remark-cli": "^7.0.0",
44-
"remark-preset-wooorm": "^6.0.0",
45-
"tape": "^4.0.0",
42+
"prettier": "^2.0.0",
43+
"remark-cli": "^8.0.0",
44+
"remark-preset-wooorm": "^7.0.0",
45+
"tape": "^5.0.0",
4646
"tinyify": "^2.0.0",
4747
"unist-builder": "^2.0.0",
48-
"xo": "^0.27.0"
48+
"xo": "^0.32.0"
4949
},
5050
"scripts": {
51-
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
51+
"format": "remark . -qfo && prettier . --write && xo --fix",
5252
"build-bundle": "browserify . -s hastUtilSanitize > hast-util-sanitize.js",
5353
"build-mangle": "browserify . -s hastUtilSanitize -p tinyify > hast-util-sanitize.min.js",
5454
"build": "npm run build-bundle && npm run build-mangle",

test.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ var sanitize = require('.')
1111

1212
/* eslint-disable no-script-url, max-params */
1313

14-
test('sanitize()', function(t) {
15-
t.test('non-node', function(st) {
14+
test('sanitize()', function (t) {
15+
t.test('non-node', function (st) {
1616
st.equal(html(sanitize(true)), '', 'should ignore non-nodes (#1)')
1717
st.equal(html(sanitize(null)), '', 'should ignore non-nodes (#2)')
1818
st.equal(html(sanitize(1)), '', 'should ignore non-nodes (#3)')
@@ -21,7 +21,7 @@ test('sanitize()', function(t) {
2121
st.end()
2222
})
2323

24-
t.test('unknown nodes', function(st) {
24+
t.test('unknown nodes', function (st) {
2525
st.equal(
2626
html(sanitize(u('unknown', '<xml></xml>'))),
2727
'',
@@ -31,7 +31,7 @@ test('sanitize()', function(t) {
3131
st.end()
3232
})
3333

34-
t.test('ignored nodes', function(st) {
34+
t.test('ignored nodes', function (st) {
3535
st.equal(html(sanitize(u('raw', '<xml></xml>'))), '', 'should ignore `raw`')
3636

3737
st.equal(
@@ -55,7 +55,7 @@ test('sanitize()', function(t) {
5555
st.end()
5656
})
5757

58-
t.test('`comment`', function(st) {
58+
t.test('`comment`', function (st) {
5959
st.equal(
6060
html(sanitize(u('comment', 'alpha'))),
6161
'',
@@ -87,7 +87,7 @@ test('sanitize()', function(t) {
8787
st.end()
8888
})
8989

90-
t.test('`doctype`', function(st) {
90+
t.test('`doctype`', function (st) {
9191
st.equal(
9292
html(sanitize(u('doctype', {name: 'html'}, 'alpha'))),
9393
'',
@@ -105,7 +105,7 @@ test('sanitize()', function(t) {
105105
st.end()
106106
})
107107

108-
t.test('`text`', function(st) {
108+
t.test('`text`', function (st) {
109109
st.deepEqual(
110110
sanitize({
111111
type: 'text',
@@ -159,7 +159,7 @@ test('sanitize()', function(t) {
159159
st.end()
160160
})
161161

162-
t.test('`element`', function(st) {
162+
t.test('`element`', function (st) {
163163
st.deepEqual(
164164
sanitize({
165165
type: 'element',
@@ -346,7 +346,7 @@ test('sanitize()', function(t) {
346346
'should ignore `svg` elements'
347347
)
348348

349-
st.test('href`', function(sst) {
349+
st.test('href`', function (sst) {
350350
testAllURLs(sst, 'a', 'href', {
351351
valid: {
352352
anchor: '#heading',
@@ -372,7 +372,7 @@ test('sanitize()', function(t) {
372372
sst.end()
373373
})
374374

375-
st.test('`cite`', function(sst) {
375+
st.test('`cite`', function (sst) {
376376
testAllURLs(sst, 'blockquote', 'cite', {
377377
valid: {
378378
anchor: '#heading',
@@ -397,7 +397,7 @@ test('sanitize()', function(t) {
397397
sst.end()
398398
})
399399

400-
st.test('`src`', function(sst) {
400+
st.test('`src`', function (sst) {
401401
testAllURLs(sst, 'img', 'src', {
402402
valid: {
403403
anchor: '#heading',
@@ -422,7 +422,7 @@ test('sanitize()', function(t) {
422422
sst.end()
423423
})
424424

425-
st.test('`longDesc`', function(sst) {
425+
st.test('`longDesc`', function (sst) {
426426
testAllURLs(sst, 'img', 'longDesc', {
427427
valid: {
428428
anchor: '#heading',
@@ -447,7 +447,7 @@ test('sanitize()', function(t) {
447447
sst.end()
448448
})
449449

450-
st.test('`li`', function(sst) {
450+
st.test('`li`', function (sst) {
451451
sst.deepEqual(
452452
sanitize(h('li', 'alert(1)')),
453453
u('text', 'alert(1)'),
@@ -480,8 +480,8 @@ test('sanitize()', function(t) {
480480

481481
sst.end()
482482
})
483-
;['tr', 'td', 'th', 'tbody', 'thead', 'tfoot'].forEach(function(name) {
484-
st.test('`' + name + '`', function(sst) {
483+
;['tr', 'td', 'th', 'tbody', 'thead', 'tfoot'].forEach(function (name) {
484+
st.test('`' + name + '`', function (sst) {
485485
sst.deepEqual(
486486
sanitize(h(name, 'alert(1)')),
487487
u('text', 'alert(1)'),
@@ -611,7 +611,7 @@ test('sanitize()', function(t) {
611611
st.end()
612612
})
613613

614-
t.test('`root`', function(st) {
614+
t.test('`root`', function (st) {
615615
st.deepEqual(
616616
sanitize({
617617
type: 'root',
@@ -660,7 +660,7 @@ function testAllURLs(t, tagName, prop, all) {
660660

661661
// Test `valid` `url`s in `prop` on `tagName`.
662662
function testURLs(t, tagName, prop, urls, valid) {
663-
Object.keys(urls).forEach(function(name) {
663+
Object.keys(urls).forEach(function (name) {
664664
var props = {}
665665

666666
props[prop] = urls[name]

0 commit comments

Comments
 (0)