New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

can-type

Package Overview
Dependencies
Maintainers
6
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-type - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

6

can-type.js

@@ -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 @@ }

2

package.json
{
"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");
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc