File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
33var visit = require ( 'unist-util-visit' ) ;
4- var has = require ( 'has' ) ;
54
65module . exports = getDefinitionFactory ;
76
7+ var own = { } . hasOwnProperty ;
8+
89/* Get a definition in `node` by `identifier`. */
910function 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
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments