Skip to content

Commit b5b8e30

Browse files
committed
Remove dependency
1 parent 9920b2e commit b5b8e30

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/index.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
'use strict';
22

33
/* Dependencies. */
4-
var has = require('has');
54
var xtend = require('xtend');
65
var defaults = require('./github');
76

87
/* Expose. */
98
module.exports = wrapper;
109

10+
var own = {}.hasOwnProperty;
11+
1112
/* Schema. */
1213
var NODES = {
1314
root: {children: all},
@@ -60,7 +61,7 @@ function one(schema, node, stack) {
6061
var result;
6162
var key;
6263

63-
if (!has(NODES, type)) {
64+
if (!own.call(NODES, type)) {
6465
replace = false;
6566
} else {
6667
allowed = xtend(NODES[type], NODES['*']);
@@ -129,7 +130,7 @@ function handleProperties(schema, properties, node, stack) {
129130
var prop;
130131
var value;
131132

132-
allowed = has(attrs, name) ? attrs[name] : [];
133+
allowed = own.call(attrs, name) ? attrs[name] : [];
133134
allowed = [].concat(allowed, attrs['*']);
134135

135136
for (prop in props) {
@@ -204,7 +205,7 @@ function handleProtocol(schema, value, prop) {
204205
var length;
205206
var index;
206207

207-
protocols = has(protocols, prop) ? protocols[prop].concat() : [];
208+
protocols = own.call(protocols, prop) ? protocols[prop].concat() : [];
208209

209210
if (protocols.length === 0) {
210211
return true;
@@ -263,7 +264,7 @@ function handleTagName(schema, tagName, node, stack) {
263264
return false;
264265
}
265266

266-
ancestors = has(ancestors, name) ? ancestors[name] : [];
267+
ancestors = own.call(ancestors, name) ? ancestors[name] : [];
267268

268269
/* Some nodes can break out of their context if they
269270
* don’t have a certain ancestor. */

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"index.js"
2020
],
2121
"dependencies": {
22-
"has": "^1.0.1",
2322
"xtend": "^4.0.1"
2423
},
2524
"devDependencies": {

0 commit comments

Comments
 (0)