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

can-map-define

Package Overview
Dependencies
Maintainers
4
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-map-define - npm Package Compare versions

Comparing version 3.0.0-pre.3 to 3.0.0-pre.4

31

can-map-define_test.js

@@ -1298,1 +1298,32 @@ /* jshint asi: false */

});
test("compute props can be set to null or undefined (#2372)", function(assert) {
var VM = CanMap.extend({ define: {
foo: { type: 'compute' }
}});
var vmNull = new VM({foo: null});
assert.equal(vmNull.foo, null, "foo is null, no error thrown");
var vmUndef = new VM({foo: undefined});
assert.equal(vmUndef.foo, undefined, "foo is null, no error thrown");
});
test("can set properties to undefined", function(){
var MyMap = CanMap.extend({
define: {
foo: {
set: function(newVal) {
return newVal;
}
}
}
});
var map = new MyMap();
map.attr('foo', 'bar');
equal(map.attr('foo'), 'bar', 'foo should be bar');
map.attr('foo', undefined);
equal(typeof map.attr('foo'), 'undefined', 'foo should be undefined');
});

4

can-map-define.js

@@ -173,3 +173,3 @@ var dev = require('can-util/js/dev/dev');

// if it took a setter and returned nothing, don't set the value
else if (setValue === undefined && !setterCalled && setter.length >= 1) {
else if (setValue === undefined && !setterCalled && setter.length > 1) {
//!steal-remove-start

@@ -247,3 +247,3 @@ asyncTimer = setTimeout(function() {

set: function(newValue, setVal, setErr, oldValue) {
if (newValue.isComputed) {
if (newValue && newValue.isComputed) {
return newValue;

@@ -250,0 +250,0 @@ }

{
"name": "can-map-define",
"version": "3.0.0-pre.3",
"version": "3.0.0-pre.4",
"description": "Define rich attribute behavior",

@@ -31,12 +31,2 @@ "homepage": "https://canjs.com",

"main": "dist/cjs/can-map-define",
"browser": {
"transform": [
"cssify"
]
},
"browserify": {
"transform": [
"cssify"
]
},
"keywords": [

@@ -47,12 +37,2 @@ "canjs"

"main": "can-map-define",
"configDependencies": [
"live-reload"
],
"npmIgnore": [
"documentjs",
"testee",
"generator-donejs",
"donejs-cli",
"steal-tools"
],
"npmAlgorithm": "flat"

@@ -75,4 +55,2 @@ },

"can-stache": "^3.0.0-pre.11",
"cssify": "^0.6.0",
"documentjs": "^0.4.2",
"done-serve": "^0.2.0",

@@ -79,0 +57,0 @@ "donejs-cli": "^0.8.0",

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