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

can-map

Package Overview
Dependencies
Maintainers
9
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.0.1 to 4.0.2

26

can-map_test.js

@@ -501,1 +501,27 @@ /* jshint asi:true */

});
QUnit.test("can read numbers", function(assert) {
var map = new Map({ 0: "zero" });
assert.equal(canReflect.getKeyValue(map, 0), "zero");
assert.equal(map.attr(0), "zero");
canReflect.onKeyValue(0, function handler(ev, newVal) {
assert.equal(newVal, "one");
canReflect.offKeyValue(0, handler);
});
canReflect.setKeyValue(map, 0, "one");
});
QUnit.test("attr should work when remove === 'true'", function(assert) {
var map = new Map({ 0: "zero" });
map.attr({ 1: "one" }, "true");
assert.equal(canReflect.getKeyValue(map, 0), undefined);
assert.equal(map.attr(0), undefined);
assert.equal(canReflect.getKeyValue(map, 1), "one");
assert.equal(map.attr(1), "one");
});

6

can-map.js

@@ -233,3 +233,3 @@ /* jshint -W079 */

// Get a single attribute.
return this._get(attr+"");
return this._get(attr);
} else {

@@ -249,2 +249,3 @@ // Set an attribute.

_get: function (attr) {
attr = attr + "";
var dotIndex = attr.indexOf('.');

@@ -312,2 +313,3 @@

_set: function (attr, value, keepKey) {
attr = attr + "";

@@ -489,3 +491,3 @@ var dotIndex = attr.indexOf('.'),

_setAttrs: function (props, remove) {
if(remove === true) {
if(remove === true || remove === "true") {
this[canSymbol.for("can.updateDeep")](props);

@@ -492,0 +494,0 @@ } else {

{
"name": "can-map",
"version": "4.0.1",
"version": "4.0.2",
"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