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

can-map

Package Overview
Dependencies
Maintainers
10
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-map - npm Package Compare versions

Comparing version 4.3.0 to 4.3.1

34

can-map_test.js

@@ -598,1 +598,35 @@ /* jshint asi:true */

});
QUnit.test("Can assign nested properties that are not CanMaps", function(){
var MyType = function() {
this.one = 'one';
this.two = 'two';
this.three = 'three';
};
MyType.prototype[canSymbol.for("can.onKeyValue")] = function(){};
MyType.prototype[canSymbol.for("can.isMapLike")] = true;
var map = new Map({
_legacyAttrBehavior: true,
foo: 'bar',
prop: new MyType()
});
map.attr({
prop: {one: '1', two: '2'}
});
// Did an assign
QUnit.equal(map.attr("prop.one"), "1");
QUnit.equal(map.attr("prop.two"), "2");
QUnit.equal(map.attr("prop.three"), "three");
// An update
map.attr({
prop: {one: 'one', two: 'two'}
}, true);
QUnit.equal(map.attr("prop.one"), "one");
QUnit.equal(map.attr("prop.two"), "two");
QUnit.equal(map.attr("prop.three"), undefined);
});

6

can-map.js

@@ -538,3 +538,7 @@ "use strict";

if ( types.isMapLike(curVal) && mapHelpers.canMakeObserve(newVal) ) {
curVal.attr(newVal, remove);
if(remove === true) {
canReflect.updateDeep(curVal, newVal);
} else {
canReflect.assignDeep(curVal, newVal);
}
// Otherwise just set.

@@ -541,0 +545,0 @@ } else if (curVal !== newVal) {

2

package.json
{
"name": "can-map",
"version": "4.3.0",
"version": "4.3.1",
"description": "Observable Objects",

@@ -5,0 +5,0 @@ "homepage": "http://canjs.com",

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