can-simple-map
Advanced tools
Comparing version 4.1.1 to 4.2.0
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var Construct = require("can-construct"); | ||
@@ -56,14 +57,24 @@ var eventQueue = require("can-event-queue/map/map"); | ||
//!steal-remove-start | ||
if (typeof this._log === "function") { | ||
this._log(prop, value, old); | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (typeof this._log === "function") { | ||
this._log(prop, value, old); | ||
} | ||
} | ||
//!steal-remove-end | ||
var dispatched = { | ||
keyChanged: !had ? prop : undefined, | ||
type: prop | ||
}; | ||
//!steal-remove-start | ||
if (process.env.NODE_ENV !== 'production') { | ||
dispatched = { | ||
keyChanged: !had ? prop : undefined, | ||
type: prop, | ||
reasonLog: [ canReflect.getName(this) + "'s", prop, "changed to", value, "from", old ], | ||
}; | ||
} | ||
//!steal-remove-end | ||
this.dispatch({ | ||
keyChanged: !had ? prop : undefined, | ||
type: prop, | ||
//!steal-remove-start | ||
reasonLog: [ canReflect.getName(this) + "'s", prop, "changed to", value, "from", old ], | ||
//!steal-remove-end | ||
}, [value, old]); | ||
this.dispatch(dispatched, [value, old]); | ||
} | ||
@@ -102,6 +113,7 @@ | ||
//!steal-remove-start | ||
var quoteString = function quoteString(x) { | ||
return typeof x === "string" ? JSON.stringify(x) : x; | ||
}; | ||
if (process.env.NODE_ENV !== 'production') { | ||
var quoteString = function quoteString(x) { | ||
return typeof x === "string" ? JSON.stringify(x) : x; | ||
}; | ||
} | ||
var meta = ensureMeta(this); | ||
@@ -132,3 +144,3 @@ meta.allowedLogKeysSet = meta.allowedLogKeysSet || new Set(); | ||
canReflect.assignSymbols(SimpleMap.prototype,{ | ||
var simpleMapProto = { | ||
// -type- | ||
@@ -143,2 +155,3 @@ "can.isMapLike": true, | ||
"can.deleteKeyValue": function(prop) { | ||
var dispatched; | ||
if( this._data.hasOwnProperty(prop) ) { | ||
@@ -149,13 +162,22 @@ var old = this._data[prop]; | ||
//!steal-remove-start | ||
if (typeof this._log === "function") { | ||
this._log(prop, undefined, old); | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (typeof this._log === "function") { | ||
this._log(prop, undefined, old); | ||
} | ||
} | ||
//!steal-remove-end | ||
this.dispatch({ | ||
dispatched = { | ||
keyChanged: prop, | ||
type: prop, | ||
//!steal-remove-start | ||
reasonLog: [ canReflect.getName(this) + "'s", prop, "deleted", old ], | ||
//!steal-remove-end | ||
}, [undefined, old]); | ||
type: prop | ||
}; | ||
//!steal-remove-start | ||
if (process.env.NODE_ENV !== 'production') { | ||
dispatched = { | ||
keyChanged: prop, | ||
type: prop, | ||
reasonLog: [ canReflect.getName(this) + "'s", prop, "deleted", old ] | ||
}; | ||
} | ||
//!steal-remove-end | ||
this.dispatch(dispatched, [undefined, old]); | ||
} | ||
@@ -189,10 +211,13 @@ }, | ||
return undefined; | ||
}, | ||
} | ||
}; | ||
//!steal-remove-start | ||
"can.getName": function() { | ||
//!steal-remove-start | ||
if (process.env.NODE_ENV !== 'production') { | ||
simpleMapProto["can.getName"] = function() { | ||
return canReflect.getName(this.constructor) + "{}"; | ||
}, | ||
//!steal-remove-end | ||
}); | ||
}; | ||
} | ||
//!steal-remove-end | ||
canReflect.assignSymbols(SimpleMap.prototype,simpleMapProto); | ||
@@ -199,0 +224,0 @@ // Setup other symbols |
{ | ||
"name": "can-simple-map", | ||
"version": "4.1.1", | ||
"version": "4.2.0", | ||
"description": "A performant live-bound map", | ||
@@ -61,4 +61,4 @@ "homepage": "https://canjs.com/doc/can-simple-map.html", | ||
"steal-tools": "^1.1.2", | ||
"testee": "^0.7.0" | ||
"testee": "^0.8.0" | ||
} | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
25074
16
384
6
1