Comparing version 1.0.2 to 1.0.3
@@ -87,3 +87,7 @@ var canReflect = require("can-reflect"); | ||
function getBaseType(Type) { | ||
if(strictTypeOfSymbol in Type) { | ||
if(typeof Type === "function") { | ||
if(canReflect.hasOwnKey(Type, strictTypeOfSymbol)) { | ||
return Type[strictTypeOfSymbol]; | ||
} | ||
} else if(strictTypeOfSymbol in Type) { | ||
return Type[strictTypeOfSymbol]; | ||
@@ -90,0 +94,0 @@ } |
{ | ||
"name": "can-type", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Type definitions", | ||
@@ -5,0 +5,0 @@ "homepage": "https://canjs.com/doc/can-type.html", |
@@ -409,2 +409,17 @@ var canSymbol = require("can-symbol"); | ||
assert.equal(person.age, 8); | ||
}); | ||
}); | ||
QUnit.test("Subtypes convert correctly", function(assert) { | ||
var Animal = function(){}; | ||
var Frog = function() { | ||
Animal.call(this, arguments); | ||
}; | ||
Object.setPrototypeOf(Frog.prototype, Animal.prototype); | ||
Object.setPrototypeOf(Frog, Animal); | ||
type.convert(Animal); | ||
var ConvertingFrog = type.convert(Frog); | ||
var frog = canReflect.convert({}, ConvertingFrog); | ||
assert.ok(frog instanceof Frog, "a frog is a frog"); | ||
}); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
47016
685
0