Skip to content

Commit 750e1d6

Browse files
committed
Remove dependency
1 parent 8d8d186 commit 750e1d6

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
var xtend = require('xtend');
44
var toH = require('hast-to-hyperscript');
55
var NS = require('web-namespaces');
6-
var has = require('has');
76
var zwitch = require('zwitch');
87
var mapz = require('mapz');
98

109
module.exports = transform;
1110

11+
var own = {}.hasOwnProperty;
1212
var one = zwitch('type');
1313
var all = mapz(one, {key: 'children', indices: false});
1414

@@ -47,7 +47,7 @@ function transform(tree) {
4747

4848
function root(node) {
4949
var data = node.data || {};
50-
var qs = has(data, 'quirksMode') ? Boolean(data.quirksMode) : false;
50+
var qs = own.call(data, 'quirksMode') ? Boolean(data.quirksMode) : false;
5151

5252
return {
5353
nodeName: '#document',
@@ -66,7 +66,7 @@ function element(node) {
6666
var key;
6767

6868
for (key in attrs) {
69-
if (has(attributeSpaces, key)) {
69+
if (own.call(attributeSpaces, key)) {
7070
values.push(xtend({
7171
name: key,
7272
value: attrs[key]
@@ -142,11 +142,11 @@ function patch(node, parent, ns) {
142142
}
143143
}
144144

145-
if (has(namespaces, name)) {
145+
if (own.call(namespaces, name)) {
146146
ns = namespaces[name];
147147
}
148148

149-
if (has(replacement, 'tagName')) {
149+
if (own.call(replacement, 'tagName')) {
150150
replacement.namespaceURI = ns;
151151
}
152152

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"index.js"
2020
],
2121
"dependencies": {
22-
"has": "^1.0.1",
2322
"hast-to-hyperscript": "^3.0.0",
2423
"mapz": "^1.0.0",
2524
"web-namespaces": "^1.0.0",

0 commit comments

Comments
 (0)