Skip to content

Commit

Permalink
feat: ensure to not crash
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Apr 4, 2019
1 parent 3d48841 commit 3998348
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions prototype/is.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ var isObject = require("../object/is");

module.exports = function (value) {
if (!isObject(value)) return false;
if (!value.constructor) return false;
return value.constructor.prototype === value;
try {
if (!value.constructor) return false;
return value.constructor.prototype === value;
} catch (error) {
return false;
}
};

0 comments on commit 3998348

Please sign in to comment.