Skip to content

Commit 4d69ceb

Browse files
committed
Update dev-dependencies
1 parent cfc4841 commit 4d69ceb

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

lib/index.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,10 @@ function handleProperties(schema, properties, node, stack) {
162162
continue
163163
}
164164

165-
if (value && typeof value === 'object' && 'length' in value) {
166-
value = handlePropertyValues(schema, value, prop, definition)
167-
} else {
168-
value = handlePropertyValue(schema, value, prop, definition)
169-
}
165+
value =
166+
value && typeof value === 'object' && 'length' in value
167+
? handlePropertyValues(schema, value, prop, definition)
168+
: handlePropertyValue(schema, value, prop, definition)
170169

171170
if (value !== null && value !== undefined) {
172171
result[prop] = value
@@ -216,7 +215,7 @@ function handlePropertyValue(schema, value, prop, definition) {
216215
return null
217216
}
218217

219-
if (definition.length !== 0 && definition.indexOf(value) === -1) {
218+
if (definition.length > 0 && definition.indexOf(value) === -1) {
220219
return null
221220
}
222221

@@ -304,7 +303,7 @@ function handleTagName(schema, tagName, node, stack) {
304303

305304
// Some nodes can break out of their context if they don’t have a certain
306305
// ancestor.
307-
if (ancestors.length !== 0) {
306+
if (ancestors.length > 0) {
308307
length = ancestors.length + 1
309308
index = -1
310309

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,24 @@
3636
"xtend": "^4.0.0"
3737
},
3838
"devDependencies": {
39-
"browserify": "^16.0.0",
39+
"browserify": "^17.0.0",
4040
"deepmerge": "^4.0.0",
41-
"dtslint": "^3.0.0",
41+
"dtslint": "^4.0.0",
4242
"hast-util-to-html": "^7.0.0",
4343
"hastscript": "^6.0.0",
4444
"nyc": "^15.0.0",
4545
"prettier": "^2.0.0",
46-
"remark-cli": "^8.0.0",
47-
"remark-preset-wooorm": "^7.0.0",
46+
"remark-cli": "^9.0.0",
47+
"remark-preset-wooorm": "^8.0.0",
4848
"tape": "^5.0.0",
49-
"tinyify": "^2.0.0",
49+
"tinyify": "^3.0.0",
5050
"unist-builder": "^2.0.0",
51-
"xo": "^0.32.0"
51+
"xo": "^0.34.0"
5252
},
5353
"scripts": {
54-
"format": "remark . -qfo && prettier . --write && xo --fix",
55-
"build-bundle": "browserify . -s hastUtilSanitize > hast-util-sanitize.js",
56-
"build-mangle": "browserify . -s hastUtilSanitize -p tinyify > hast-util-sanitize.min.js",
54+
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
55+
"build-bundle": "browserify . -s hastUtilSanitize -o hast-util-sanitize.js",
56+
"build-mangle": "browserify . -s hastUtilSanitize -o hast-util-sanitize.min.js -p tinyify",
5757
"build": "npm run build-bundle && npm run build-mangle",
5858
"test-api": "node test",
5959
"test-coverage": "nyc --reporter lcov tape test.js",

types/index.d.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@ declare namespace sanitize {
1515
*
1616
* The special '*' key defines property names allowed on all elements
1717
*/
18-
attributes?: {
19-
[key: string]: Array<string | [string, ...HTMLValue[]]>
20-
}
18+
attributes?: Record<string, Array<string | [string, ...HTMLValue[]]>>
2119

2220
/**
2321
* Map of tag names to required property names and their default property value
2422
*/
25-
required?: {[key: string]: {[key: string]: HTMLValue}}
23+
required?: Record<string, Record<string, HTMLValue>>
2624

2725
/**
2826
* List of allowed tag names
@@ -32,12 +30,12 @@ declare namespace sanitize {
3230
/**
3331
* Map of protocols to allow in property values
3432
*/
35-
protocols?: {[key: string]: string[]}
33+
protocols?: Record<string, string[]>
3634

3735
/**
3836
* Map of tag names to their required ancestor elements
3937
*/
40-
ancestors?: {[key: string]: string[]}
38+
ancestors?: Record<string, string[]>
4139

4240
/**
4341
* List of allowed property names which can clobber

0 commit comments

Comments
 (0)