Skip to content

Commit 537b9a8

Browse files
committed
Refactor to improve bundle size
1 parent a1ab83d commit 537b9a8

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

index.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
'use strict'
22

3-
var is = require('hast-util-is-element')
3+
var convert = require('hast-util-is-element/convert')
44

5-
module.exports = heading
6-
7-
var names = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hgroup']
8-
9-
function heading(node) {
10-
return is(node, names)
11-
}
5+
module.exports = convert(['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hgroup'])

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"index.js"
2828
],
2929
"dependencies": {
30-
"hast-util-is-element": "^1.0.0"
30+
"hast-util-is-element": "^1.1.0"
3131
},
3232
"devDependencies": {
3333
"browserify": "^17.0.0",

0 commit comments

Comments
 (0)