Skip to content

Commit 3e3d885

Browse files
committed
Remove dependency
1 parent 47651ba commit 3e3d885

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/one.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
module.exports = one;
44

55
var u = require('unist-builder');
6-
var has = require('has');
76
var all = require('./all');
87

8+
var own = {}.hasOwnProperty;
9+
910
/* Transform an unknown node. */
1011
function unknown(h, node) {
1112
if (text(node)) {
@@ -18,7 +19,7 @@ function unknown(h, node) {
1819
/* Visit a node. */
1920
function one(h, node, parent) {
2021
var type = node && node.type;
21-
var fn = has(h.handlers, type) ? h.handlers[type] : null;
22+
var fn = own.call(h.handlers, type) ? h.handlers[type] : null;
2223

2324
/* Fail on non-nodes. */
2425
if (!type) {
@@ -32,7 +33,7 @@ function one(h, node, parent) {
3233
function text(node) {
3334
var data = node.data || {};
3435

35-
if (has(data, 'hName') || has(data, 'hProperties') || has(data, 'hChildren')) {
36+
if (own.call(data, 'hName') || own.call(data, 'hProperties') || own.call(data, 'hChildren')) {
3637
return false;
3738
}
3839

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"dependencies": {
2222
"collapse-white-space": "^1.0.0",
2323
"detab": "^2.0.0",
24-
"has": "^1.0.1",
2524
"mdast-util-definitions": "^1.2.0",
2625
"normalize-uri": "^1.0.0",
2726
"trim": "0.0.1",

0 commit comments

Comments
 (0)