Skip to content

Commit

Permalink
use isobject to check obj type, fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
doowb committed Jan 26, 2018
1 parent 56f86bb commit f99c09e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -7,14 +7,14 @@

'use strict';

var typeOf = require('kind-of');
var isobject = require('isobject');
var isDescriptor = require('is-descriptor');
var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty)
? Reflect.defineProperty
: Object.defineProperty;

module.exports = function defineProperty(obj, key, val) {
if (typeOf(obj) !== 'object' && typeof obj !== 'function' && !Array.isArray(obj)) {
if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) {
throw new TypeError('expected an object, function, or array');
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -25,7 +25,7 @@
},
"dependencies": {
"is-descriptor": "^1.0.2",
"kind-of": "^6.0.2"
"isobject": "^3.0.1"
},
"devDependencies": {
"gulp-format-md": "^1.0.0",
Expand Down

0 comments on commit f99c09e

Please sign in to comment.