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

mvcobject

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mvcobject - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

2

MVCObject.d.ts

@@ -43,3 +43,3 @@ export declare class Accessor {

*/
bindTo(key: string, target: MVCObject, targetKey: string, noNotify: boolean): Accessor;
bindTo(key: string, target: MVCObject, targetKey?: string, noNotify?: boolean): Accessor;
/**

@@ -46,0 +46,0 @@ * @description 解除当前对象上key与目标对象的监听

(function (factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
var v = factory(require, exports); if (v !== undefined) module.exports = v;
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === 'function' && define.amd) {
else if (typeof define === "function" && define.amd) {
define(["require", "exports"], factory);

@@ -10,2 +11,3 @@ }

"use strict";
exports.__esModule = true;
var Accessor = (function () {

@@ -156,3 +158,3 @@ function Accessor(target, targetKey) {

for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
args[_i] = arguments[_i];
}

@@ -253,4 +255,3 @@ };

exports.MVCObject = MVCObject;
exports.__esModule = true;
exports["default"] = MVCObject;
});

@@ -1,1 +0,1 @@

!function(t){if("object"==typeof module&&"object"==typeof module.exports){var e=t(require,exports);void 0!==e&&(module.exports=e)}else"function"==typeof define&&define.amd&&define(["require","exports"],t)}(function(t,e){"use strict";function r(t){return t.substr(0,1).toUpperCase()+t.substr(1)}function n(t){return t[g]||(t[g]=++c)}function o(t){return"_"+t}function i(t){return f.hasOwnProperty(t)?f[t]:f[t]="get"+r(t)}function a(t){return p.hasOwnProperty(t)?p[t]:p[t]="set"+r(t)}function u(t,e){var r=e+"_changed";if(t[r]?t[r]():"function"==typeof t.changed&&t.changed(e),t[y]&&t[y][e]){var n,o,i=t[y][e];for(o in i)i.hasOwnProperty(o)&&(n=i[o],u(n.target,n.targetKey))}}var s=function(){function t(t,e){this.target=t,this.targetKey=e}return t.prototype.transform=function(t,e){this.from=t,this.to=e,this.target.notify(this.targetKey)},t}();e.Accessor=s;var f={},p={},c=0,y="__bindings__",h="__accessors__",g="__uid__",d=function(){function t(){}return t.prototype.get=function(t){var e=this;if(e[h]&&e[h].hasOwnProperty(t)){var r,n=e[h][t],a=n.targetKey,u=n.target,s=i(a);r=u[s]?u[s]():u.get(a),n.to&&(r=n.to(r))}else e.hasOwnProperty(o(t))&&(r=e[o(t)]);return r},t.prototype.set=function(t,e){var r=this;if(r[h]&&r[h].hasOwnProperty(t)){var n=r[h][t],i=n.targetKey,s=n.target,f=a(i);n.from&&(e=n.from(e)),s[f]?s[f](e):s.set(i,e)}else this[o(t)]=e,u(r,t);return r},t.prototype.changed=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e]},t.prototype.notify=function(t){var e=this;if(e[h]&&e[h].hasOwnProperty(t)){var r=e[h][t],n=r.targetKey,o=r.target;o.notify(n)}else u(e,t);return e},t.prototype.setValues=function(t){var e,r,n,o=this;for(e in t)t.hasOwnProperty(e)&&(n=t[e],r=a(e),o[r]?o[r](n):o.set(e,n));return o},t.prototype.bindTo=function(t,e,r,o){void 0===r&&(r=t);var i=this;i.unbind(t),i[h]||(i[h]={}),e[y]||(e[y]={}),e[y][r]||(e[y][r]={});var a=new s(i,t),f=new s(e,r);return i[h][t]=f,e[y][r][n(i)]=a,o||u(i,t),f},t.prototype.unbind=function(t){var e=this;if(e[h]){var r=e[h][t];if(r){var i=r.target,a=r.targetKey;e[o(t)]=e.get(t),delete i[y][a][n(e)],delete e[h][t]}}return e},t.prototype.unbindAll=function(){var t=this;if(t[h]){var e=t[h];for(var r in e)e.hasOwnProperty(r)&&t.unbind(r)}return t},t}();e.MVCObject=d,e.__esModule=!0,e["default"]=d});
!function(t){if("object"==typeof module&&"object"==typeof module.exports){var e=t(require,exports);void 0!==e&&(module.exports=e)}else"function"==typeof define&&define.amd&&define(["require","exports"],t)}(function(t,e){"use strict";function r(t){return t.substr(0,1).toUpperCase()+t.substr(1)}function n(t){return t[d]||(t[d]=++c)}function o(t){return"_"+t}function i(t){return f.hasOwnProperty(t)?f[t]:f[t]="get"+r(t)}function a(t){return p.hasOwnProperty(t)?p[t]:p[t]="set"+r(t)}function u(t,e){var r=e+"_changed";if(t[r]?t[r]():"function"==typeof t.changed&&t.changed(e),t[y]&&t[y][e]){var n,o,i=t[y][e];for(o in i)i.hasOwnProperty(o)&&(n=i[o],u(n.target,n.targetKey))}}e.__esModule=!0;var s=function(){function t(t,e){this.target=t,this.targetKey=e}return t.prototype.transform=function(t,e){this.from=t,this.to=e,this.target.notify(this.targetKey)},t}();e.Accessor=s;var f={},p={},c=0,y="__bindings__",h="__accessors__",d="__uid__",g=function(){function t(){}return t.prototype.get=function(t){var e=this;if(e[h]&&e[h].hasOwnProperty(t)){var r,n=e[h][t],a=n.targetKey,u=n.target,s=i(a);r=u[s]?u[s]():u.get(a),n.to&&(r=n.to(r))}else e.hasOwnProperty(o(t))&&(r=e[o(t)]);return r},t.prototype.set=function(t,e){var r=this;if(r[h]&&r[h].hasOwnProperty(t)){var n=r[h][t],i=n.targetKey,s=n.target,f=a(i);n.from&&(e=n.from(e)),s[f]?s[f](e):s.set(i,e)}else this[o(t)]=e,u(r,t);return r},t.prototype.changed=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.notify=function(t){var e=this;if(e[h]&&e[h].hasOwnProperty(t)){var r=e[h][t],n=r.targetKey;r.target.notify(n)}else u(e,t);return e},t.prototype.setValues=function(t){var e,r,n,o=this;for(e in t)t.hasOwnProperty(e)&&(n=t[e],r=a(e),o[r]?o[r](n):o.set(e,n));return o},t.prototype.bindTo=function(t,e,r,o){void 0===r&&(r=t);var i=this;i.unbind(t),i[h]||(i[h]={}),e[y]||(e[y]={}),e[y][r]||(e[y][r]={});var a=new s(i,t),f=new s(e,r);return i[h][t]=f,e[y][r][n(i)]=a,o||u(i,t),f},t.prototype.unbind=function(t){var e=this;if(e[h]){var r=e[h][t];if(r){var i=r.target,a=r.targetKey;e[o(t)]=e.get(t),delete i[y][a][n(e)],delete e[h][t]}}return e},t.prototype.unbindAll=function(){var t=this;if(t[h]){var e=t[h];for(var r in e)e.hasOwnProperty(r)&&t.unbind(r)}return t},t}();e.MVCObject=g,e.default=g});

@@ -190,3 +190,3 @@ export class Accessor{

*/
bindTo(key: string, target: MVCObject, targetKey: string = key, noNotify: boolean): Accessor{
bindTo(key: string, target: MVCObject, targetKey: string = key, noNotify?: boolean): Accessor{
var self = this;

@@ -193,0 +193,0 @@ self.unbind(key);

{
"name": "mvcobject",
"version": "1.1.2",
"version": "1.2.0",
"description": "An implementation of Google Maps' MVCObject for Node.js and browers",

@@ -5,0 +5,0 @@ "main": "MVCObject.js",

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