Comparing version 4.0.1 to 4.0.2
@@ -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"); | ||
}); |
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
79142
1523
0