Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

can-define

Package Overview
Dependencies
Maintainers
15
Versions
208
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-define - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

16

can-define.js

@@ -28,3 +28,4 @@ "use strict";

var newSymbol = canSymbol.for("can.new");
var newSymbol = canSymbol.for("can.new"),
serializeSymbol = canSymbol.for("can.serialize");

@@ -799,4 +800,13 @@ var eventsProto, define,

}
else if(isDefineType(value)) {
definition = {type: value};
else if(value && (value[serializeSymbol] || value[newSymbol]) ) {
definition = {};
var serialize = value[serializeSymbol];
if(serialize) {
definition.serialize = function(val){
return serialize.call(val);
};
}
if(value[newSymbol]) {
definition.type = value[newSymbol];
}
}

@@ -803,0 +813,0 @@ else if(typeof value === "function") {

11

map/map-test.js

@@ -1279,3 +1279,3 @@ var QUnit = require("steal-qunit");

QUnit.test("use can.new for conversion", function(){
QUnit.test("use can.new and can.serialize for conversion", function(){
var Status = canReflect.assignSymbols({},{

@@ -1291,3 +1291,6 @@ "can.new": function(val){

};
}
},
"can.serialize": function(){
return this.toUpperCase();
}
});

@@ -1301,3 +1304,5 @@

var todo = new Todo({status: "NEW"});
QUnit.equal(todo.status, "new", "converted");
QUnit.equal(todo.status, "new", "converted during set");
QUnit.deepEqual(todo.serialize(),{status: "NEW"}, "serialized to upper case");
});
{
"name": "can-define",
"version": "2.2.1",
"version": "2.2.2",
"description": "Create observable objects with JS dot operator compatibility",

@@ -5,0 +5,0 @@ "main": "can-define.js",

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