Skip to content

Commit 0b15386

Browse files
committed
Remove dependency
1 parent 81fd417 commit 0b15386

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use strict';
22

33
var visit = require('unist-util-visit');
4-
var has = require('has');
54

65
module.exports = getDefinitionFactory;
76

7+
var own = {}.hasOwnProperty;
8+
89
/* Get a definition in `node` by `identifier`. */
910
function getDefinitionFactory(node, options) {
1011
return getterFactory(gather(node, options));
@@ -24,7 +25,7 @@ function gather(node, options) {
2425

2526
function commonmark(definition) {
2627
var id = normalise(definition.identifier);
27-
if (!has(cache, id)) {
28+
if (!own.call(cache, id)) {
2829
cache[id] = definition;
2930
}
3031
}
@@ -41,7 +42,7 @@ function getterFactory(cache) {
4142
/* Get a node from the bound definition-cache. */
4243
function getter(identifier) {
4344
var id = identifier && normalise(identifier);
44-
return id && has(cache, id) ? cache[id] : null;
45+
return id && own.call(cache, id) ? cache[id] : null;
4546
}
4647
}
4748

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"cache"
1414
],
1515
"dependencies": {
16-
"has": "^1.0.1",
1716
"unist-util-visit": "^1.0.0"
1817
},
1918
"repository": "https://github.com/syntax-tree/mdast-util-definitions",

0 commit comments

Comments
 (0)