Skip to content

Commit

Permalink
fix: hotfix is-class bug (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Sep 21, 2018
1 parent 32aab2b commit 1468e4e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

var utils = require('core-util-is');
var isStearm = require('isstream');
var isClass = require('is-class');
// wait for https://github.com/miguelmota/is-class/pull/6 merge
var isClass = require('is-class-hotfix');

/**
* Expose all methods in core-util-is
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"homepage": "https://github.com/node-modules/is-type-of",
"dependencies": {
"core-util-is": "^1.0.2",
"is-class": "~0.0.4",
"is-class-hotfix": "~0.0.6",
"isstream": "~0.1.2"
},
"devDependencies": {
Expand Down
12 changes: 11 additions & 1 deletion test/is.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,20 @@ describe('is', () => {
});

describe('class', () => {
if (semver.gt(process.version.substring(1), '4.0.0')){
if (semver.gt(process.version.substring(1), '4.0.0')) {
it('should true', () => {
class Foo{};
assert(is.class(Foo) === true);
assert(is.class(class {}) === true);
assert(is.class(class{}) === true);
assert(is.class(class OK2{}) === true);
assert(is.class(class OK{constructor(){}}) === true);
assert(is.class(class{constructor(){}}) === true);
assert(is.class(class {constructor(){}}) === true);
assert(is.class(class _{constructor(){}}) === true);
assert(is.class(class _F___ {constructor(){}}) === true);
assert(is.class(class B extends(Foo){}) === true);
assert(is.class(class{constructor(app){cov_1z5ezlsbi5.f[0]++;cov_1z5ezlsbi5.s[17]++;this.app=app;}configDidLoad(){cov_1z5ezlsbi5.f[1]++;}}) === true);
});

it('should false', () => {
Expand Down

0 comments on commit 1468e4e

Please sign in to comment.