should-type
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -67,2 +67,5 @@ 'use strict'; | ||
function Type(type, cls, sub) { | ||
if (!type) { | ||
throw new Error('Type class must be initialized at least with `type` information'); | ||
} | ||
this.type = type; | ||
@@ -83,2 +86,15 @@ this.cls = cls; | ||
return str.join(';'); | ||
}, | ||
toTryTypes: function() { | ||
var _types = []; | ||
if (this.sub) { | ||
_types.push(new Type(this.type, this.cls, this.sub)); | ||
} | ||
if (this.cls) { | ||
_types.push(new Type(this.type, this.cls)); | ||
} | ||
_types.push(new Type(this.type)); | ||
return _types; | ||
} | ||
@@ -85,0 +101,0 @@ }; |
@@ -65,2 +65,5 @@ var types = { | ||
function Type(type, cls, sub) { | ||
if (!type) { | ||
throw new Error('Type class must be initialized at least with `type` information'); | ||
} | ||
this.type = type; | ||
@@ -81,2 +84,15 @@ this.cls = cls; | ||
return str.join(';'); | ||
}, | ||
toTryTypes: function() { | ||
var _types = []; | ||
if (this.sub) { | ||
_types.push(new Type(this.type, this.cls, this.sub)); | ||
} | ||
if (this.cls) { | ||
_types.push(new Type(this.type, this.cls)); | ||
} | ||
_types.push(new Type(this.type)); | ||
return _types; | ||
} | ||
@@ -83,0 +99,0 @@ }; |
{ | ||
"name": "should-type", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Simple module to get instance type. Like a bit more advanced version of typeof", | ||
@@ -35,4 +35,5 @@ "main": "cjs/should-type.js", | ||
"eslint": "^3.0.0", | ||
"eslint-config-shouldjs": "^1.0.2", | ||
"rollup": "^0.34.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
15183
5
435
0
5
3