Skip to content

Commit

Permalink
Remove dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jun 25, 2017
1 parent 044dfb3 commit 7aa9dfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/nest.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';

var zwitch = require('zwitch');
var has = require('has');

module.exports = zwitch('nestingOperator');

var own = {}.hasOwnProperty;

var handle = module.exports;
var handlers = handle.handlers;

Expand Down Expand Up @@ -199,7 +200,7 @@ function createTypeIndex() {

index.elements++;

if (!has(counts, type)) {
if (!own.call(counts, type)) {
counts[type] = 0;
}

Expand All @@ -208,6 +209,6 @@ function createTypeIndex() {
}

function count(node) {
return has(counts, node.tagName) ? counts[node.tagName] : 0;
return own.call(counts, node.tagName) ? counts[node.tagName] : 0;
}
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"camelcase": "^3.0.0",
"comma-separated-tokens": "^1.0.2",
"css-selector-parser": "^1.3.0",
"has": "^1.0.1",
"hast-util-has-property": "^1.0.0",
"hast-util-is-element": "^1.0.0",
"hast-util-whitespace": "^1.0.0",
Expand Down

0 comments on commit 7aa9dfe

Please sign in to comment.