diff --git a/dist/store.js b/dist/store.js index 13051b3..4567218 100644 --- a/dist/store.js +++ b/dist/store.js @@ -1 +1 @@ -(function(global,factory){if(typeof define === "function" && define.amd){define("Store",["exports","module","array.prototype.find"],factory);}else if(typeof exports !== "undefined" && typeof module !== "undefined"){factory(exports,module,require("array.prototype.find"));}else {var mod={exports:{}};factory(mod.exports,mod,global.arrayPrototype);global.Store = mod.exports;}})(this,function(exports,module,_arrayPrototypeFind){"use strict";var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if("value" in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}var Store=(function(){_createClass(Store,null,[{key:"attr",value:function attr(name,options){if(name && typeof name === 'object'){return Store.attr(null,name);}else {return {type:"attr","default":options && options["default"],deserialize:function deserialize(data,key){return data.attributes && data.attributes[name || key];}};}}},{key:"hasOne",value:function hasOne(name,options){if(name && typeof name === 'object'){return Store.hasOne(null,name);}else {return {type:"has-one",inverse:options && options.inverse,deserialize:function deserialize(data,key){name = name || key;if(data.relationships && data.relationships[name]){if(data.relationships[name].data === null){return null;}else if(data.relationships[name].data){return this.find(data.relationships[name].data.type,data.relationships[name].data.id);}}}};}}},{key:"hasMany",value:function hasMany(name,options){if(name && typeof name === 'object'){return Store.hasMany(null,name);}else {return {type:"has-many","default":[],inverse:options && options.inverse,deserialize:function deserialize(data,key){var _this=this;name = name || key;if(data.relationships && data.relationships[name]){if(data.relationships[name].data === null){return [];}else if(data.relationships[name].data){return data.relationships[name].data.map(function(c){return _this.find(c.type,c.id);});}}}};}}}]);function Store(){_classCallCheck(this,Store);this._collectionListeners = {"added":{},"updated":{},"removed":{}};this._data = {};this._resourceListeners = {"added":{},"updated":{},"removed":{}};this._types = {};}_createClass(Store,[{key:"add",value:function add(object){var _this2=this;if(object){if(object.type && object.id){(function(){var event=_this2._data[object.type] && _this2._data[object.type][object.id]?"updated":"added";var resource=_this2.find(object.type,object.id);var definition=_this2._types[object.type];Object.keys(definition).forEach(function(fieldName){if(fieldName[0] !== "_"){_this2._addField(object,resource,definition,fieldName);}});if(_this2._resourceListeners[event][object.type] && _this2._resourceListeners[event][object.type][object.id]){_this2._resourceListeners[event][object.type][object.id].forEach(function(x){return x[0].call(x[1],resource);});}if(_this2._collectionListeners[event][object.type]){_this2._collectionListeners[event][object.type].forEach(function(x){return x[0].call(x[1],resource);});}})();}else {throw new TypeError("The data must have a type and id");}}else {throw new TypeError("You must provide data to add");}}},{key:"define",value:function define(names,definition){var _this3=this;names = names.constructor === Array?names:[names];definition._names = names;names.forEach(function(name){if(!_this3._types[name]){_this3._types[name] = definition;}else {throw new Error("The type '" + name + "' has already been defined.");}});}},{key:"find",value:function find(type,id){var _this4=this;if(type){var _ret2=(function(){var definition=_this4._types[type];if(definition){if(!_this4._data[type]){(function(){var collection={};definition._names.forEach(function(t){return _this4._data[t] = collection;});})();}if(id){if(!_this4._data[type][id]){_this4._data[type][id] = {_dependents:[],type:type,id:id};Object.keys(definition).forEach(function(key){if(key[0] !== "_"){_this4._data[type][id][key] = definition[key]["default"];}});}return {v:_this4._data[type][id]};}else {return {v:Object.keys(_this4._data[type]).map(function(x){return _this4._data[type][x];})};}}else {throw new TypeError("Unknown type '" + type + "'");}})();if(typeof _ret2 === "object")return _ret2.v;}else {throw new TypeError("You must provide a type");}}},{key:"off",value:function off(event,type,id,callback){if(this._resourceListeners[event] && this._collectionListeners[event]){if(this._types[type]){if(id && ({}).toString.call(id) === '[object Function]'){this.off.call(this,event,type,null,id,callback);}else {if(id){if(this._resourceListeners[event][type] && this._resourceListeners[event][type][id]){this._resourceListeners[event][type][id] = this._resourceListeners[event][type][id].filter(function(x){return x[0] !== callback;});}}else if(this._collectionListeners[event][type]){this._collectionListeners[event][type] = this._collectionListeners[event][type].filter(function(x){return x[0] !== callback;});}}}else {throw new Error("Unknown type '" + type + "'");}}else {throw new Error("Unknown event '" + event + "'");}}},{key:"on",value:function on(event,type,id,callback,context){if(this._resourceListeners[event] && this._collectionListeners[event]){if(this._types[type]){if(id && ({}).toString.call(id) === '[object Function]'){this.on.call(this,event,type,null,id,callback);}else {if(id){this._resourceListeners[event][type] = this._resourceListeners[event][type] || {};this._resourceListeners[event][type][id] = this._resourceListeners[event][type][id] || [];this._resourceListeners[event][type][id].push([callback,context]);}else {this._collectionListeners[event][type] = this._collectionListeners[event][type] || [];this._collectionListeners[event][type].push([callback,context]);}}}else {throw new Error("Unknown type '" + type + "'");}}else {throw new Error("Unknown event '" + event + "'");}}},{key:"push",value:function push(root){var _this5=this;if(root.data.constructor === Array){root.data.forEach(function(x){return _this5.add(x);});}else {this.add(root.data);}if(root.included){root.included.forEach(function(x){return _this5.add(x);});}}},{key:"remove",value:function remove(type,id){var _this6=this;if(type){if(this._types[type]){if(id){(function(){var resource=_this6._data[type][id];if(resource){_this6._remove(resource);if(_this6._resourceListeners["removed"][type] && _this6._resourceListeners["removed"][type][id]){_this6._resourceListeners["removed"][type][id].forEach(function(x){return x[0].call(x[1],resource);});}if(_this6._collectionListeners["removed"][type]){_this6._collectionListeners["removed"][type].forEach(function(x){return x[0].call(x[1],resource);});}}})();}else {Object.keys(this._data[type]).forEach(function(id){return _this6.remove(type,id);});}}else {throw new TypeError("Unknown type '" + type + "'");}}else {throw new TypeError("You must provide a type to remove");}}},{key:"_addField",value:function _addField(object,resource,definition,fieldName){var _this7=this;var field=definition[fieldName];var newValue=field.deserialize.call(this,object,fieldName);if(typeof newValue !== "undefined"){if(field.type === "has-one"){if(resource[fieldName]){this._removeInverseRelationship(resource,fieldName,resource[fieldName],field);}if(newValue){this._addInverseRelationship(resource,fieldName,newValue,field);}}else if(field.type === "has-many"){resource[fieldName].forEach(function(r){if(resource[fieldName].indexOf(r) !== -1){_this7._removeInverseRelationship(resource,fieldName,r,field);}});newValue.forEach(function(r){_this7._addInverseRelationship(resource,fieldName,r,field);});}resource[fieldName] = newValue;}}},{key:"_addInverseRelationship",value:function _addInverseRelationship(sourceResource,sourceFieldName,targetResource,sourceField){var targetDefinition=this._types[targetResource.type];var sourceDefinition=this._types[sourceResource.type];if(targetDefinition){var targetFieldName=[sourceField.inverse].concat(sourceDefinition._names).find(function(x){return targetDefinition[x];});var targetField=targetDefinition && targetDefinition[targetFieldName];targetResource._dependents.push({type:sourceResource.type,id:sourceResource.id,fieldName:sourceFieldName});if(targetField){if(targetField.type === "has-one"){sourceResource._dependents.push({type:targetResource.type,id:targetResource.id,fieldName:targetFieldName});targetResource[targetFieldName] = sourceResource;}else if(targetField.type === "has-many"){sourceResource._dependents.push({type:targetResource.type,id:targetResource.id,fieldName:targetFieldName});if(targetResource[targetFieldName].indexOf(sourceResource) === -1){targetResource[targetFieldName].push(sourceResource);}}else if(targetField.type === "attr"){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is an attribute ('" + targetFieldName + "')");}}else if(sourceField.inverse){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is missing ('" + sourceField.inverse + "')");}}}},{key:"_remove",value:function _remove(resource){var _this8=this;resource._dependents.forEach(function(dependent){var dependentResource=_this8._data[dependent.type][dependent.id];switch(_this8._types[dependent.type][dependent.fieldName].type){case "has-one":{dependentResource[dependent.fieldName] = null;break;}case "has-many":{var index=dependentResource[dependent.fieldName].indexOf(resource);if(index !== -1){dependentResource[dependent.fieldName].splice(index,1);}break;}default:{break;}}dependentResource._dependents = dependentResource._dependents.filter(function(d){return !(d.type === resource.type && d.id === resource.id);});});delete this._data[resource.type][resource.id];}},{key:"_removeInverseRelationship",value:function _removeInverseRelationship(sourceResource,sourceFieldName,targetResource,sourceField){var targetDefinition=this._types[targetResource.type];var targetFieldName=sourceField.inverse || sourceResource.type;var targetField=targetDefinition && targetDefinition[targetFieldName];targetResource._dependents = targetResource._dependents.filter(function(r){return !(r.type === sourceResource.type && r.id === sourceResource.id && r.fieldName === sourceFieldName);});if(targetField){if(targetField.type === "has-one"){sourceResource._dependents = sourceResource._dependents.filter(function(r){return !(r.type === targetResource.type && r.id === targetResource.id && r.fieldName === targetFieldName);});targetResource[targetFieldName] = null;}else if(targetField.type === "has-many"){sourceResource._dependents = sourceResource._dependents.filter(function(r){return !(r.type === targetResource.type && r.id === targetResource.id && r.fieldName === targetFieldName);});targetResource[targetFieldName] = targetResource[targetFieldName].filter(function(r){return r !== sourceResource;});}else if(targetField.type === "attr"){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is an attribute ('" + targetFieldName + "')");}}else if(sourceField.inverse){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is missing ('" + sourceField.inverse + "')");}}}]);return Store;})();module.exports = Store;}); +(function(global,factory){if(typeof define === "function" && define.amd){define("Store",["exports","module","array.prototype.find"],factory);}else if(typeof exports !== "undefined" && typeof module !== "undefined"){factory(exports,module,require("array.prototype.find"));}else {var mod={exports:{}};factory(mod.exports,mod,global.arrayPrototype);global.Store = mod.exports;}})(this,function(exports,module,_arrayPrototypeFind){"use strict";var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if("value" in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}var Store=(function(){_createClass(Store,null,[{key:"attr",value:function attr(name,options){if(name && typeof name === 'object'){return Store.attr(null,name);}else {return {type:"attr","default":options && options["default"],deserialize:function deserialize(data,key){return data.attributes && data.attributes[name || key];}};}}},{key:"hasOne",value:function hasOne(name,options){if(name && typeof name === 'object'){return Store.hasOne(null,name);}else {return {type:"has-one",inverse:options && options.inverse,deserialize:function deserialize(data,key){name = name || key;if(data.relationships && data.relationships[name]){if(data.relationships[name].data === null){return null;}else if(data.relationships[name].data){return this.find(data.relationships[name].data.type,data.relationships[name].data.id);}}}};}}},{key:"hasMany",value:function hasMany(name,options){if(name && typeof name === 'object'){return Store.hasMany(null,name);}else {return {type:"has-many","default":[],inverse:options && options.inverse,deserialize:function deserialize(data,key){var _this=this;name = name || key;if(data.relationships && data.relationships[name]){if(data.relationships[name].data === null){return [];}else if(data.relationships[name].data){return data.relationships[name].data.map(function(c){return _this.find(c.type,c.id);});}}}};}}}]);function Store(){_classCallCheck(this,Store);this._collectionListeners = {"added":{},"updated":{},"removed":{}};this._data = {};this._resourceListeners = {"added":{},"updated":{},"removed":{}};this._types = {};}_createClass(Store,[{key:"add",value:function add(object){var _this2=this;if(object){if(object.type && object.id){(function(){var event=_this2._data[object.type] && _this2._data[object.type][object.id]?"updated":"added";var resource=_this2.find(object.type,object.id);var definition=_this2._types[object.type];Object.keys(definition).forEach(function(fieldName){if(fieldName[0] !== "_"){_this2._addField(object,resource,definition,fieldName);}});if(_this2._resourceListeners[event][object.type] && _this2._resourceListeners[event][object.type][object.id]){_this2._resourceListeners[event][object.type][object.id].forEach(function(x){return x[0].call(x[1],resource);});}if(_this2._collectionListeners[event][object.type]){_this2._collectionListeners[event][object.type].forEach(function(x){return x[0].call(x[1],resource);});}})();}else {throw new TypeError("The data must have a type and id");}}else {throw new TypeError("You must provide data to add");}}},{key:"define",value:function define(names,definition){var _this3=this;names = names.constructor === Array?names:[names];definition._names = names;names.forEach(function(name){if(!_this3._types[name]){_this3._types[name] = definition;}else {throw new Error("The type '" + name + "' has already been defined.");}});}},{key:"find",value:function find(type,id){var _this4=this;if(type){var _ret2=(function(){var definition=_this4._types[type];if(definition){if(!_this4._data[type]){(function(){var collection={};definition._names.forEach(function(t){return _this4._data[t] = collection;});})();}if(id){if(!_this4._data[type][id]){_this4._data[type][id] = {_dependents:[],type:type,id:id};Object.keys(definition).forEach(function(key){if(key[0] !== "_"){_this4._data[type][id][key] = definition[key]["default"];}});}return {v:_this4._data[type][id]};}else {return {v:Object.keys(_this4._data[type]).map(function(x){return _this4._data[type][x];})};}}else {throw new TypeError("Unknown type '" + type + "'");}})();if(typeof _ret2 === "object")return _ret2.v;}else {throw new TypeError("You must provide a type");}}},{key:"off",value:function off(event,type,id,callback){var _this5=this;if(this._resourceListeners[event] && this._collectionListeners[event]){if(this._types[type]){if(id && ({}).toString.call(id) === '[object Function]'){this.off.call(this,event,type,null,id,callback);}else {this._types[type]._names.forEach(function(type){if(id){if(_this5._resourceListeners[event][type] && _this5._resourceListeners[event][type][id]){_this5._resourceListeners[event][type][id] = _this5._resourceListeners[event][type][id].filter(function(x){return x[0] !== callback;});}}else if(_this5._collectionListeners[event][type]){_this5._collectionListeners[event][type] = _this5._collectionListeners[event][type].filter(function(x){return x[0] !== callback;});}});}}else {throw new Error("Unknown type '" + type + "'");}}else {throw new Error("Unknown event '" + event + "'");}}},{key:"on",value:function on(event,type,id,callback,context){var _this6=this;if(this._resourceListeners[event] && this._collectionListeners[event]){if(this._types[type]){if(id && ({}).toString.call(id) === '[object Function]'){this.on.call(this,event,type,null,id,callback);}else {this._types[type]._names.forEach(function(type){if(id){_this6._resourceListeners[event][type] = _this6._resourceListeners[event][type] || {};_this6._resourceListeners[event][type][id] = _this6._resourceListeners[event][type][id] || [];if(!_this6._resourceListeners[event][type][id].find(function(x){return x[0] === callback;})){_this6._resourceListeners[event][type][id].push([callback,context]);}}else {_this6._collectionListeners[event][type] = _this6._collectionListeners[event][type] || [];if(!_this6._collectionListeners[event][type].find(function(x){return x[0] === callback;})){_this6._collectionListeners[event][type].push([callback,context]);}}});}}else {throw new Error("Unknown type '" + type + "'");}}else {throw new Error("Unknown event '" + event + "'");}}},{key:"push",value:function push(root){var _this7=this;if(root.data.constructor === Array){root.data.forEach(function(x){return _this7.add(x);});}else {this.add(root.data);}if(root.included){root.included.forEach(function(x){return _this7.add(x);});}}},{key:"remove",value:function remove(type,id){var _this8=this;if(type){if(this._types[type]){if(id){(function(){var resource=_this8._data[type][id];if(resource){_this8._remove(resource);if(_this8._resourceListeners["removed"][type] && _this8._resourceListeners["removed"][type][id]){_this8._resourceListeners["removed"][type][id].forEach(function(x){return x[0].call(x[1],resource);});}if(_this8._collectionListeners["removed"][type]){_this8._collectionListeners["removed"][type].forEach(function(x){return x[0].call(x[1],resource);});}}})();}else {Object.keys(this._data[type]).forEach(function(id){return _this8.remove(type,id);});}}else {throw new TypeError("Unknown type '" + type + "'");}}else {throw new TypeError("You must provide a type to remove");}}},{key:"_addField",value:function _addField(object,resource,definition,fieldName){var _this9=this;var field=definition[fieldName];var newValue=field.deserialize.call(this,object,fieldName);if(typeof newValue !== "undefined"){if(field.type === "has-one"){if(resource[fieldName]){this._removeInverseRelationship(resource,fieldName,resource[fieldName],field);}if(newValue){this._addInverseRelationship(resource,fieldName,newValue,field);}}else if(field.type === "has-many"){resource[fieldName].forEach(function(r){if(resource[fieldName].indexOf(r) !== -1){_this9._removeInverseRelationship(resource,fieldName,r,field);}});newValue.forEach(function(r){_this9._addInverseRelationship(resource,fieldName,r,field);});}resource[fieldName] = newValue;}}},{key:"_addInverseRelationship",value:function _addInverseRelationship(sourceResource,sourceFieldName,targetResource,sourceField){var targetDefinition=this._types[targetResource.type];var sourceDefinition=this._types[sourceResource.type];if(targetDefinition){var targetFieldName=[sourceField.inverse].concat(sourceDefinition._names).find(function(x){return targetDefinition[x];});var targetField=targetDefinition && targetDefinition[targetFieldName];targetResource._dependents.push({type:sourceResource.type,id:sourceResource.id,fieldName:sourceFieldName});if(targetField){if(targetField.type === "has-one"){sourceResource._dependents.push({type:targetResource.type,id:targetResource.id,fieldName:targetFieldName});targetResource[targetFieldName] = sourceResource;}else if(targetField.type === "has-many"){sourceResource._dependents.push({type:targetResource.type,id:targetResource.id,fieldName:targetFieldName});if(targetResource[targetFieldName].indexOf(sourceResource) === -1){targetResource[targetFieldName].push(sourceResource);}}else if(targetField.type === "attr"){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is an attribute ('" + targetFieldName + "')");}}else if(sourceField.inverse){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is missing ('" + sourceField.inverse + "')");}}}},{key:"_remove",value:function _remove(resource){var _this10=this;resource._dependents.forEach(function(dependent){var dependentResource=_this10._data[dependent.type][dependent.id];switch(_this10._types[dependent.type][dependent.fieldName].type){case "has-one":{dependentResource[dependent.fieldName] = null;break;}case "has-many":{var index=dependentResource[dependent.fieldName].indexOf(resource);if(index !== -1){dependentResource[dependent.fieldName].splice(index,1);}break;}default:{break;}}dependentResource._dependents = dependentResource._dependents.filter(function(d){return !(d.type === resource.type && d.id === resource.id);});});delete this._data[resource.type][resource.id];}},{key:"_removeInverseRelationship",value:function _removeInverseRelationship(sourceResource,sourceFieldName,targetResource,sourceField){var targetDefinition=this._types[targetResource.type];var targetFieldName=sourceField.inverse || sourceResource.type;var targetField=targetDefinition && targetDefinition[targetFieldName];targetResource._dependents = targetResource._dependents.filter(function(r){return !(r.type === sourceResource.type && r.id === sourceResource.id && r.fieldName === sourceFieldName);});if(targetField){if(targetField.type === "has-one"){sourceResource._dependents = sourceResource._dependents.filter(function(r){return !(r.type === targetResource.type && r.id === targetResource.id && r.fieldName === targetFieldName);});targetResource[targetFieldName] = null;}else if(targetField.type === "has-many"){sourceResource._dependents = sourceResource._dependents.filter(function(r){return !(r.type === targetResource.type && r.id === targetResource.id && r.fieldName === targetFieldName);});targetResource[targetFieldName] = targetResource[targetFieldName].filter(function(r){return r !== sourceResource;});}else if(targetField.type === "attr"){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is an attribute ('" + targetFieldName + "')");}}else if(sourceField.inverse){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is missing ('" + sourceField.inverse + "')");}}}]);return Store;})();module.exports = Store;}); diff --git a/dist/store.v0.4.1.js b/dist/store.v0.4.1.js new file mode 100644 index 0000000..4567218 --- /dev/null +++ b/dist/store.v0.4.1.js @@ -0,0 +1 @@ +(function(global,factory){if(typeof define === "function" && define.amd){define("Store",["exports","module","array.prototype.find"],factory);}else if(typeof exports !== "undefined" && typeof module !== "undefined"){factory(exports,module,require("array.prototype.find"));}else {var mod={exports:{}};factory(mod.exports,mod,global.arrayPrototype);global.Store = mod.exports;}})(this,function(exports,module,_arrayPrototypeFind){"use strict";var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if("value" in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}var Store=(function(){_createClass(Store,null,[{key:"attr",value:function attr(name,options){if(name && typeof name === 'object'){return Store.attr(null,name);}else {return {type:"attr","default":options && options["default"],deserialize:function deserialize(data,key){return data.attributes && data.attributes[name || key];}};}}},{key:"hasOne",value:function hasOne(name,options){if(name && typeof name === 'object'){return Store.hasOne(null,name);}else {return {type:"has-one",inverse:options && options.inverse,deserialize:function deserialize(data,key){name = name || key;if(data.relationships && data.relationships[name]){if(data.relationships[name].data === null){return null;}else if(data.relationships[name].data){return this.find(data.relationships[name].data.type,data.relationships[name].data.id);}}}};}}},{key:"hasMany",value:function hasMany(name,options){if(name && typeof name === 'object'){return Store.hasMany(null,name);}else {return {type:"has-many","default":[],inverse:options && options.inverse,deserialize:function deserialize(data,key){var _this=this;name = name || key;if(data.relationships && data.relationships[name]){if(data.relationships[name].data === null){return [];}else if(data.relationships[name].data){return data.relationships[name].data.map(function(c){return _this.find(c.type,c.id);});}}}};}}}]);function Store(){_classCallCheck(this,Store);this._collectionListeners = {"added":{},"updated":{},"removed":{}};this._data = {};this._resourceListeners = {"added":{},"updated":{},"removed":{}};this._types = {};}_createClass(Store,[{key:"add",value:function add(object){var _this2=this;if(object){if(object.type && object.id){(function(){var event=_this2._data[object.type] && _this2._data[object.type][object.id]?"updated":"added";var resource=_this2.find(object.type,object.id);var definition=_this2._types[object.type];Object.keys(definition).forEach(function(fieldName){if(fieldName[0] !== "_"){_this2._addField(object,resource,definition,fieldName);}});if(_this2._resourceListeners[event][object.type] && _this2._resourceListeners[event][object.type][object.id]){_this2._resourceListeners[event][object.type][object.id].forEach(function(x){return x[0].call(x[1],resource);});}if(_this2._collectionListeners[event][object.type]){_this2._collectionListeners[event][object.type].forEach(function(x){return x[0].call(x[1],resource);});}})();}else {throw new TypeError("The data must have a type and id");}}else {throw new TypeError("You must provide data to add");}}},{key:"define",value:function define(names,definition){var _this3=this;names = names.constructor === Array?names:[names];definition._names = names;names.forEach(function(name){if(!_this3._types[name]){_this3._types[name] = definition;}else {throw new Error("The type '" + name + "' has already been defined.");}});}},{key:"find",value:function find(type,id){var _this4=this;if(type){var _ret2=(function(){var definition=_this4._types[type];if(definition){if(!_this4._data[type]){(function(){var collection={};definition._names.forEach(function(t){return _this4._data[t] = collection;});})();}if(id){if(!_this4._data[type][id]){_this4._data[type][id] = {_dependents:[],type:type,id:id};Object.keys(definition).forEach(function(key){if(key[0] !== "_"){_this4._data[type][id][key] = definition[key]["default"];}});}return {v:_this4._data[type][id]};}else {return {v:Object.keys(_this4._data[type]).map(function(x){return _this4._data[type][x];})};}}else {throw new TypeError("Unknown type '" + type + "'");}})();if(typeof _ret2 === "object")return _ret2.v;}else {throw new TypeError("You must provide a type");}}},{key:"off",value:function off(event,type,id,callback){var _this5=this;if(this._resourceListeners[event] && this._collectionListeners[event]){if(this._types[type]){if(id && ({}).toString.call(id) === '[object Function]'){this.off.call(this,event,type,null,id,callback);}else {this._types[type]._names.forEach(function(type){if(id){if(_this5._resourceListeners[event][type] && _this5._resourceListeners[event][type][id]){_this5._resourceListeners[event][type][id] = _this5._resourceListeners[event][type][id].filter(function(x){return x[0] !== callback;});}}else if(_this5._collectionListeners[event][type]){_this5._collectionListeners[event][type] = _this5._collectionListeners[event][type].filter(function(x){return x[0] !== callback;});}});}}else {throw new Error("Unknown type '" + type + "'");}}else {throw new Error("Unknown event '" + event + "'");}}},{key:"on",value:function on(event,type,id,callback,context){var _this6=this;if(this._resourceListeners[event] && this._collectionListeners[event]){if(this._types[type]){if(id && ({}).toString.call(id) === '[object Function]'){this.on.call(this,event,type,null,id,callback);}else {this._types[type]._names.forEach(function(type){if(id){_this6._resourceListeners[event][type] = _this6._resourceListeners[event][type] || {};_this6._resourceListeners[event][type][id] = _this6._resourceListeners[event][type][id] || [];if(!_this6._resourceListeners[event][type][id].find(function(x){return x[0] === callback;})){_this6._resourceListeners[event][type][id].push([callback,context]);}}else {_this6._collectionListeners[event][type] = _this6._collectionListeners[event][type] || [];if(!_this6._collectionListeners[event][type].find(function(x){return x[0] === callback;})){_this6._collectionListeners[event][type].push([callback,context]);}}});}}else {throw new Error("Unknown type '" + type + "'");}}else {throw new Error("Unknown event '" + event + "'");}}},{key:"push",value:function push(root){var _this7=this;if(root.data.constructor === Array){root.data.forEach(function(x){return _this7.add(x);});}else {this.add(root.data);}if(root.included){root.included.forEach(function(x){return _this7.add(x);});}}},{key:"remove",value:function remove(type,id){var _this8=this;if(type){if(this._types[type]){if(id){(function(){var resource=_this8._data[type][id];if(resource){_this8._remove(resource);if(_this8._resourceListeners["removed"][type] && _this8._resourceListeners["removed"][type][id]){_this8._resourceListeners["removed"][type][id].forEach(function(x){return x[0].call(x[1],resource);});}if(_this8._collectionListeners["removed"][type]){_this8._collectionListeners["removed"][type].forEach(function(x){return x[0].call(x[1],resource);});}}})();}else {Object.keys(this._data[type]).forEach(function(id){return _this8.remove(type,id);});}}else {throw new TypeError("Unknown type '" + type + "'");}}else {throw new TypeError("You must provide a type to remove");}}},{key:"_addField",value:function _addField(object,resource,definition,fieldName){var _this9=this;var field=definition[fieldName];var newValue=field.deserialize.call(this,object,fieldName);if(typeof newValue !== "undefined"){if(field.type === "has-one"){if(resource[fieldName]){this._removeInverseRelationship(resource,fieldName,resource[fieldName],field);}if(newValue){this._addInverseRelationship(resource,fieldName,newValue,field);}}else if(field.type === "has-many"){resource[fieldName].forEach(function(r){if(resource[fieldName].indexOf(r) !== -1){_this9._removeInverseRelationship(resource,fieldName,r,field);}});newValue.forEach(function(r){_this9._addInverseRelationship(resource,fieldName,r,field);});}resource[fieldName] = newValue;}}},{key:"_addInverseRelationship",value:function _addInverseRelationship(sourceResource,sourceFieldName,targetResource,sourceField){var targetDefinition=this._types[targetResource.type];var sourceDefinition=this._types[sourceResource.type];if(targetDefinition){var targetFieldName=[sourceField.inverse].concat(sourceDefinition._names).find(function(x){return targetDefinition[x];});var targetField=targetDefinition && targetDefinition[targetFieldName];targetResource._dependents.push({type:sourceResource.type,id:sourceResource.id,fieldName:sourceFieldName});if(targetField){if(targetField.type === "has-one"){sourceResource._dependents.push({type:targetResource.type,id:targetResource.id,fieldName:targetFieldName});targetResource[targetFieldName] = sourceResource;}else if(targetField.type === "has-many"){sourceResource._dependents.push({type:targetResource.type,id:targetResource.id,fieldName:targetFieldName});if(targetResource[targetFieldName].indexOf(sourceResource) === -1){targetResource[targetFieldName].push(sourceResource);}}else if(targetField.type === "attr"){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is an attribute ('" + targetFieldName + "')");}}else if(sourceField.inverse){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is missing ('" + sourceField.inverse + "')");}}}},{key:"_remove",value:function _remove(resource){var _this10=this;resource._dependents.forEach(function(dependent){var dependentResource=_this10._data[dependent.type][dependent.id];switch(_this10._types[dependent.type][dependent.fieldName].type){case "has-one":{dependentResource[dependent.fieldName] = null;break;}case "has-many":{var index=dependentResource[dependent.fieldName].indexOf(resource);if(index !== -1){dependentResource[dependent.fieldName].splice(index,1);}break;}default:{break;}}dependentResource._dependents = dependentResource._dependents.filter(function(d){return !(d.type === resource.type && d.id === resource.id);});});delete this._data[resource.type][resource.id];}},{key:"_removeInverseRelationship",value:function _removeInverseRelationship(sourceResource,sourceFieldName,targetResource,sourceField){var targetDefinition=this._types[targetResource.type];var targetFieldName=sourceField.inverse || sourceResource.type;var targetField=targetDefinition && targetDefinition[targetFieldName];targetResource._dependents = targetResource._dependents.filter(function(r){return !(r.type === sourceResource.type && r.id === sourceResource.id && r.fieldName === sourceFieldName);});if(targetField){if(targetField.type === "has-one"){sourceResource._dependents = sourceResource._dependents.filter(function(r){return !(r.type === targetResource.type && r.id === targetResource.id && r.fieldName === targetFieldName);});targetResource[targetFieldName] = null;}else if(targetField.type === "has-many"){sourceResource._dependents = sourceResource._dependents.filter(function(r){return !(r.type === targetResource.type && r.id === targetResource.id && r.fieldName === targetFieldName);});targetResource[targetFieldName] = targetResource[targetFieldName].filter(function(r){return r !== sourceResource;});}else if(targetField.type === "attr"){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is an attribute ('" + targetFieldName + "')");}}else if(sourceField.inverse){throw new Error("The the inverse relationship for '" + sourceFieldName + "' is missing ('" + sourceField.inverse + "')");}}}]);return Store;})();module.exports = Store;}); diff --git a/docs/v0.4.1/ast/source/src/store.js.json b/docs/v0.4.1/ast/source/src/store.js.json new file mode 100644 index 0000000..7f50f93 --- /dev/null +++ b/docs/v0.4.1/ast/source/src/store.js.json @@ -0,0 +1,37411 @@ +{ + "type": "Program", + "body": [ + { + "type": "ImportDeclaration", + "specifiers": [], + "source": { + "type": "Literal", + "value": "array.prototype.find", + "raw": "\"array.prototype.find\"", + "range": [ + 7, + 29 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 29 + } + } + }, + "range": [ + 0, + 30 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + } + }, + { + "type": "ExportDefaultDeclaration", + "declaration": { + "type": "ClassDeclaration", + "id": { + "type": "Identifier", + "name": "Store", + "range": [ + 53, + 58 + ], + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 26 + } + } + }, + "superClass": null, + "body": { + "type": "ClassBody", + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "attr", + "range": [ + 396, + 400 + ], + "loc": { + "start": { + "line": 14, + "column": 9 + }, + "end": { + "line": 14, + "column": 13 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "name", + "range": [ + 401, + 405 + ], + "loc": { + "start": { + "line": 14, + "column": 14 + }, + "end": { + "line": 14, + "column": 18 + } + } + }, + { + "type": "Identifier", + "name": "options", + "range": [ + 407, + 414 + ], + "loc": { + "start": { + "line": 14, + "column": 20 + }, + "end": { + "line": 14, + "column": 27 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "Identifier", + "name": "name", + "range": [ + 426, + 430 + ], + "loc": { + "start": { + "line": 15, + "column": 8 + }, + "end": { + "line": 15, + "column": 12 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "UnaryExpression", + "operator": "typeof", + "argument": { + "type": "Identifier", + "name": "name", + "range": [ + 441, + 445 + ], + "loc": { + "start": { + "line": 15, + "column": 23 + }, + "end": { + "line": 15, + "column": 27 + } + } + }, + "prefix": true, + "range": [ + 434, + 445 + ], + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 27 + } + } + }, + "right": { + "type": "Literal", + "value": "object", + "raw": "'object'", + "range": [ + 450, + 458 + ], + "loc": { + "start": { + "line": 15, + "column": 32 + }, + "end": { + "line": 15, + "column": 40 + } + } + }, + "range": [ + 434, + 458 + ], + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 40 + } + } + }, + "range": [ + 426, + 458 + ], + "loc": { + "start": { + "line": 15, + "column": 8 + }, + "end": { + "line": 15, + "column": 40 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "Store", + "range": [ + 475, + 480 + ], + "loc": { + "start": { + "line": 16, + "column": 13 + }, + "end": { + "line": 16, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "attr", + "range": [ + 481, + 485 + ], + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 23 + } + } + }, + "range": [ + 475, + 485 + ], + "loc": { + "start": { + "line": 16, + "column": 13 + }, + "end": { + "line": 16, + "column": 23 + } + } + }, + "arguments": [ + { + "type": "Literal", + "value": null, + "raw": "null", + "range": [ + 486, + 490 + ], + "loc": { + "start": { + "line": 16, + "column": 24 + }, + "end": { + "line": 16, + "column": 28 + } + } + }, + { + "type": "Identifier", + "name": "name", + "range": [ + 492, + 496 + ], + "loc": { + "start": { + "line": 16, + "column": 30 + }, + "end": { + "line": 16, + "column": 34 + } + } + } + ], + "range": [ + 475, + 497 + ], + "loc": { + "start": { + "line": 16, + "column": 13 + }, + "end": { + "line": 16, + "column": 35 + } + } + }, + "range": [ + 468, + 498 + ], + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 36 + } + } + } + ], + "range": [ + 460, + 504 + ], + "loc": { + "start": { + "line": 15, + "column": 42 + }, + "end": { + "line": 17, + "column": 5 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "type", + "range": [ + 535, + 539 + ], + "loc": { + "start": { + "line": 19, + "column": 8 + }, + "end": { + "line": 19, + "column": 12 + } + } + }, + "value": { + "type": "Literal", + "value": "attr", + "raw": "\"attr\"", + "range": [ + 541, + 547 + ], + "loc": { + "start": { + "line": 19, + "column": 14 + }, + "end": { + "line": 19, + "column": 20 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 535, + 547 + ], + "loc": { + "start": { + "line": 19, + "column": 8 + }, + "end": { + "line": 19, + "column": 20 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "default", + "range": [ + 557, + 564 + ], + "loc": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 15 + } + } + }, + "value": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "Identifier", + "name": "options", + "range": [ + 566, + 573 + ], + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 24 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "options", + "range": [ + 577, + 584 + ], + "loc": { + "start": { + "line": 20, + "column": 28 + }, + "end": { + "line": 20, + "column": 35 + } + } + }, + "property": { + "type": "Identifier", + "name": "default", + "range": [ + 585, + 592 + ], + "loc": { + "start": { + "line": 20, + "column": 36 + }, + "end": { + "line": 20, + "column": 43 + } + } + }, + "range": [ + 577, + 592 + ], + "loc": { + "start": { + "line": 20, + "column": 28 + }, + "end": { + "line": 20, + "column": 43 + } + } + }, + "range": [ + 566, + 592 + ], + "loc": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 43 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 557, + 592 + ], + "loc": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 43 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "deserialize", + "range": [ + 602, + 613 + ], + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 21, + "column": 19 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "data", + "range": [ + 625, + 629 + ], + "loc": { + "start": { + "line": 21, + "column": 31 + }, + "end": { + "line": 21, + "column": 35 + } + } + }, + { + "type": "Identifier", + "name": "key", + "range": [ + 631, + 634 + ], + "loc": { + "start": { + "line": 21, + "column": 37 + }, + "end": { + "line": 21, + "column": 40 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 655, + 659 + ], + "loc": { + "start": { + "line": 22, + "column": 17 + }, + "end": { + "line": 22, + "column": 21 + } + } + }, + "property": { + "type": "Identifier", + "name": "attributes", + "range": [ + 660, + 670 + ], + "loc": { + "start": { + "line": 22, + "column": 22 + }, + "end": { + "line": 22, + "column": 32 + } + } + }, + "range": [ + 655, + 670 + ], + "loc": { + "start": { + "line": 22, + "column": 17 + }, + "end": { + "line": 22, + "column": 32 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 674, + 678 + ], + "loc": { + "start": { + "line": 22, + "column": 36 + }, + "end": { + "line": 22, + "column": 40 + } + } + }, + "property": { + "type": "Identifier", + "name": "attributes", + "range": [ + 679, + 689 + ], + "loc": { + "start": { + "line": 22, + "column": 41 + }, + "end": { + "line": 22, + "column": 51 + } + } + }, + "range": [ + 674, + 689 + ], + "loc": { + "start": { + "line": 22, + "column": 36 + }, + "end": { + "line": 22, + "column": 51 + } + } + }, + "property": { + "type": "LogicalExpression", + "operator": "||", + "left": { + "type": "Identifier", + "name": "name", + "range": [ + 690, + 694 + ], + "loc": { + "start": { + "line": 22, + "column": 52 + }, + "end": { + "line": 22, + "column": 56 + } + } + }, + "right": { + "type": "Identifier", + "name": "key", + "range": [ + 698, + 701 + ], + "loc": { + "start": { + "line": 22, + "column": 60 + }, + "end": { + "line": 22, + "column": 63 + } + } + }, + "range": [ + 690, + 701 + ], + "loc": { + "start": { + "line": 22, + "column": 52 + }, + "end": { + "line": 22, + "column": 63 + } + } + }, + "range": [ + 674, + 702 + ], + "loc": { + "start": { + "line": 22, + "column": 36 + }, + "end": { + "line": 22, + "column": 64 + } + } + }, + "range": [ + 655, + 702 + ], + "loc": { + "start": { + "line": 22, + "column": 17 + }, + "end": { + "line": 22, + "column": 64 + } + } + }, + "range": [ + 648, + 703 + ], + "loc": { + "start": { + "line": 22, + "column": 10 + }, + "end": { + "line": 22, + "column": 65 + } + } + } + ], + "range": [ + 636, + 713 + ], + "loc": { + "start": { + "line": 21, + "column": 42 + }, + "end": { + "line": 23, + "column": 9 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 615, + 713 + ], + "loc": { + "start": { + "line": 21, + "column": 21 + }, + "end": { + "line": 23, + "column": 9 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 602, + 713 + ], + "loc": { + "start": { + "line": 21, + "column": 8 + }, + "end": { + "line": 23, + "column": 9 + } + } + } + ], + "range": [ + 525, + 721 + ], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 24, + "column": 7 + } + } + }, + "range": [ + 518, + 722 + ], + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 24, + "column": 8 + } + } + } + ], + "range": [ + 510, + 728 + ], + "loc": { + "start": { + "line": 17, + "column": 11 + }, + "end": { + "line": 25, + "column": 5 + } + } + }, + "range": [ + 422, + 728 + ], + "loc": { + "start": { + "line": 15, + "column": 4 + }, + "end": { + "line": 25, + "column": 5 + } + } + } + ], + "range": [ + 416, + 732 + ], + "loc": { + "start": { + "line": 14, + "column": 29 + }, + "end": { + "line": 26, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 400, + 732 + ], + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 26, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 389, + 732 + ], + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 26, + "column": 3 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": "*\n * Creates a field definition for an attribute.\n *\n * @since 0.1.0\n * @param {string} [name] - Name of the property to map this field from.\n * @param {Object} [options] - An options object.\n * @param {string} [options.default] - Default value for this field.\n * @return {Object} - Field definition.\n ", + "range": [ + 64, + 386 + ], + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 13, + "column": 5 + } + } + } + ], + "trailingComments": [ + { + "type": "Block", + "value": "*\n * Creates a field definition for an has-one relationship.\n *\n * @since 0.1.0\n * @param {string} [name] - Name of the property to map this field from.\n * @param {Object} [options] - An options object.\n * @param {string} [options.inverse] - Name of the inverse relationship.\n * @return {Object} - Field definition.\n ", + "range": [ + 736, + 1073 + ], + "loc": { + "start": { + "line": 28, + "column": 2 + }, + "end": { + "line": 36, + "column": 5 + } + } + } + ], + "static": true + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "hasOne", + "range": [ + 1083, + 1089 + ], + "loc": { + "start": { + "line": 37, + "column": 9 + }, + "end": { + "line": 37, + "column": 15 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "name", + "range": [ + 1090, + 1094 + ], + "loc": { + "start": { + "line": 37, + "column": 16 + }, + "end": { + "line": 37, + "column": 20 + } + } + }, + { + "type": "Identifier", + "name": "options", + "range": [ + 1096, + 1103 + ], + "loc": { + "start": { + "line": 37, + "column": 22 + }, + "end": { + "line": 37, + "column": 29 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "Identifier", + "name": "name", + "range": [ + 1115, + 1119 + ], + "loc": { + "start": { + "line": 38, + "column": 8 + }, + "end": { + "line": 38, + "column": 12 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "UnaryExpression", + "operator": "typeof", + "argument": { + "type": "Identifier", + "name": "name", + "range": [ + 1130, + 1134 + ], + "loc": { + "start": { + "line": 38, + "column": 23 + }, + "end": { + "line": 38, + "column": 27 + } + } + }, + "prefix": true, + "range": [ + 1123, + 1134 + ], + "loc": { + "start": { + "line": 38, + "column": 16 + }, + "end": { + "line": 38, + "column": 27 + } + } + }, + "right": { + "type": "Literal", + "value": "object", + "raw": "'object'", + "range": [ + 1139, + 1147 + ], + "loc": { + "start": { + "line": 38, + "column": 32 + }, + "end": { + "line": 38, + "column": 40 + } + } + }, + "range": [ + 1123, + 1147 + ], + "loc": { + "start": { + "line": 38, + "column": 16 + }, + "end": { + "line": 38, + "column": 40 + } + } + }, + "range": [ + 1115, + 1147 + ], + "loc": { + "start": { + "line": 38, + "column": 8 + }, + "end": { + "line": 38, + "column": 40 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "Store", + "range": [ + 1164, + 1169 + ], + "loc": { + "start": { + "line": 39, + "column": 13 + }, + "end": { + "line": 39, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "hasOne", + "range": [ + 1170, + 1176 + ], + "loc": { + "start": { + "line": 39, + "column": 19 + }, + "end": { + "line": 39, + "column": 25 + } + } + }, + "range": [ + 1164, + 1176 + ], + "loc": { + "start": { + "line": 39, + "column": 13 + }, + "end": { + "line": 39, + "column": 25 + } + } + }, + "arguments": [ + { + "type": "Literal", + "value": null, + "raw": "null", + "range": [ + 1177, + 1181 + ], + "loc": { + "start": { + "line": 39, + "column": 26 + }, + "end": { + "line": 39, + "column": 30 + } + } + }, + { + "type": "Identifier", + "name": "name", + "range": [ + 1183, + 1187 + ], + "loc": { + "start": { + "line": 39, + "column": 32 + }, + "end": { + "line": 39, + "column": 36 + } + } + } + ], + "range": [ + 1164, + 1188 + ], + "loc": { + "start": { + "line": 39, + "column": 13 + }, + "end": { + "line": 39, + "column": 37 + } + } + }, + "range": [ + 1157, + 1189 + ], + "loc": { + "start": { + "line": 39, + "column": 6 + }, + "end": { + "line": 39, + "column": 38 + } + } + } + ], + "range": [ + 1149, + 1195 + ], + "loc": { + "start": { + "line": 38, + "column": 42 + }, + "end": { + "line": 40, + "column": 5 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "type", + "range": [ + 1226, + 1230 + ], + "loc": { + "start": { + "line": 42, + "column": 8 + }, + "end": { + "line": 42, + "column": 12 + } + } + }, + "value": { + "type": "Literal", + "value": "has-one", + "raw": "\"has-one\"", + "range": [ + 1232, + 1241 + ], + "loc": { + "start": { + "line": 42, + "column": 14 + }, + "end": { + "line": 42, + "column": 23 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 1226, + 1241 + ], + "loc": { + "start": { + "line": 42, + "column": 8 + }, + "end": { + "line": 42, + "column": 23 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "inverse", + "range": [ + 1251, + 1258 + ], + "loc": { + "start": { + "line": 43, + "column": 8 + }, + "end": { + "line": 43, + "column": 15 + } + } + }, + "value": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "Identifier", + "name": "options", + "range": [ + 1260, + 1267 + ], + "loc": { + "start": { + "line": 43, + "column": 17 + }, + "end": { + "line": 43, + "column": 24 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "options", + "range": [ + 1271, + 1278 + ], + "loc": { + "start": { + "line": 43, + "column": 28 + }, + "end": { + "line": 43, + "column": 35 + } + } + }, + "property": { + "type": "Identifier", + "name": "inverse", + "range": [ + 1279, + 1286 + ], + "loc": { + "start": { + "line": 43, + "column": 36 + }, + "end": { + "line": 43, + "column": 43 + } + } + }, + "range": [ + 1271, + 1286 + ], + "loc": { + "start": { + "line": 43, + "column": 28 + }, + "end": { + "line": 43, + "column": 43 + } + } + }, + "range": [ + 1260, + 1286 + ], + "loc": { + "start": { + "line": 43, + "column": 17 + }, + "end": { + "line": 43, + "column": 43 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 1251, + 1286 + ], + "loc": { + "start": { + "line": 43, + "column": 8 + }, + "end": { + "line": 43, + "column": 43 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "deserialize", + "range": [ + 1296, + 1307 + ], + "loc": { + "start": { + "line": 44, + "column": 8 + }, + "end": { + "line": 44, + "column": 19 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "data", + "range": [ + 1319, + 1323 + ], + "loc": { + "start": { + "line": 44, + "column": 31 + }, + "end": { + "line": 44, + "column": 35 + } + } + }, + { + "type": "Identifier", + "name": "key", + "range": [ + 1325, + 1328 + ], + "loc": { + "start": { + "line": 44, + "column": 37 + }, + "end": { + "line": 44, + "column": 40 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", + "name": "name", + "range": [ + 1342, + 1346 + ], + "loc": { + "start": { + "line": 45, + "column": 10 + }, + "end": { + "line": 45, + "column": 14 + } + } + }, + "right": { + "type": "LogicalExpression", + "operator": "||", + "left": { + "type": "Identifier", + "name": "name", + "range": [ + 1349, + 1353 + ], + "loc": { + "start": { + "line": 45, + "column": 17 + }, + "end": { + "line": 45, + "column": 21 + } + } + }, + "right": { + "type": "Identifier", + "name": "key", + "range": [ + 1357, + 1360 + ], + "loc": { + "start": { + "line": 45, + "column": 25 + }, + "end": { + "line": 45, + "column": 28 + } + } + }, + "range": [ + 1349, + 1360 + ], + "loc": { + "start": { + "line": 45, + "column": 17 + }, + "end": { + "line": 45, + "column": 28 + } + } + }, + "range": [ + 1342, + 1360 + ], + "loc": { + "start": { + "line": 45, + "column": 10 + }, + "end": { + "line": 45, + "column": 28 + } + } + }, + "range": [ + 1342, + 1361 + ], + "loc": { + "start": { + "line": 45, + "column": 10 + }, + "end": { + "line": 45, + "column": 29 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 1376, + 1380 + ], + "loc": { + "start": { + "line": 46, + "column": 14 + }, + "end": { + "line": 46, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "relationships", + "range": [ + 1381, + 1394 + ], + "loc": { + "start": { + "line": 46, + "column": 19 + }, + "end": { + "line": 46, + "column": 32 + } + } + }, + "range": [ + 1376, + 1394 + ], + "loc": { + "start": { + "line": 46, + "column": 14 + }, + "end": { + "line": 46, + "column": 32 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 1398, + 1402 + ], + "loc": { + "start": { + "line": 46, + "column": 36 + }, + "end": { + "line": 46, + "column": 40 + } + } + }, + "property": { + "type": "Identifier", + "name": "relationships", + "range": [ + 1403, + 1416 + ], + "loc": { + "start": { + "line": 46, + "column": 41 + }, + "end": { + "line": 46, + "column": 54 + } + } + }, + "range": [ + 1398, + 1416 + ], + "loc": { + "start": { + "line": 46, + "column": 36 + }, + "end": { + "line": 46, + "column": 54 + } + } + }, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 1417, + 1421 + ], + "loc": { + "start": { + "line": 46, + "column": 55 + }, + "end": { + "line": 46, + "column": 59 + } + } + }, + "range": [ + 1398, + 1422 + ], + "loc": { + "start": { + "line": 46, + "column": 36 + }, + "end": { + "line": 46, + "column": 60 + } + } + }, + "range": [ + 1376, + 1422 + ], + "loc": { + "start": { + "line": 46, + "column": 14 + }, + "end": { + "line": 46, + "column": 60 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 1442, + 1446 + ], + "loc": { + "start": { + "line": 47, + "column": 16 + }, + "end": { + "line": 47, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "relationships", + "range": [ + 1447, + 1460 + ], + "loc": { + "start": { + "line": 47, + "column": 21 + }, + "end": { + "line": 47, + "column": 34 + } + } + }, + "range": [ + 1442, + 1460 + ], + "loc": { + "start": { + "line": 47, + "column": 16 + }, + "end": { + "line": 47, + "column": 34 + } + } + }, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 1461, + 1465 + ], + "loc": { + "start": { + "line": 47, + "column": 35 + }, + "end": { + "line": 47, + "column": 39 + } + } + }, + "range": [ + 1442, + 1466 + ], + "loc": { + "start": { + "line": 47, + "column": 16 + }, + "end": { + "line": 47, + "column": 40 + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "range": [ + 1467, + 1471 + ], + "loc": { + "start": { + "line": 47, + "column": 41 + }, + "end": { + "line": 47, + "column": 45 + } + } + }, + "range": [ + 1442, + 1471 + ], + "loc": { + "start": { + "line": 47, + "column": 16 + }, + "end": { + "line": 47, + "column": 45 + } + } + }, + "right": { + "type": "Literal", + "value": null, + "raw": "null", + "range": [ + 1476, + 1480 + ], + "loc": { + "start": { + "line": 47, + "column": 50 + }, + "end": { + "line": 47, + "column": 54 + } + } + }, + "range": [ + 1442, + 1480 + ], + "loc": { + "start": { + "line": 47, + "column": 16 + }, + "end": { + "line": 47, + "column": 54 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "Literal", + "value": null, + "raw": "null", + "range": [ + 1505, + 1509 + ], + "loc": { + "start": { + "line": 48, + "column": 21 + }, + "end": { + "line": 48, + "column": 25 + } + } + }, + "range": [ + 1498, + 1510 + ], + "loc": { + "start": { + "line": 48, + "column": 14 + }, + "end": { + "line": 48, + "column": 26 + } + } + } + ], + "range": [ + 1482, + 1524 + ], + "loc": { + "start": { + "line": 47, + "column": 56 + }, + "end": { + "line": 49, + "column": 13 + } + } + }, + "alternate": { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 1534, + 1538 + ], + "loc": { + "start": { + "line": 49, + "column": 23 + }, + "end": { + "line": 49, + "column": 27 + } + } + }, + "property": { + "type": "Identifier", + "name": "relationships", + "range": [ + 1539, + 1552 + ], + "loc": { + "start": { + "line": 49, + "column": 28 + }, + "end": { + "line": 49, + "column": 41 + } + } + }, + "range": [ + 1534, + 1552 + ], + "loc": { + "start": { + "line": 49, + "column": 23 + }, + "end": { + "line": 49, + "column": 41 + } + } + }, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 1553, + 1557 + ], + "loc": { + "start": { + "line": 49, + "column": 42 + }, + "end": { + "line": 49, + "column": 46 + } + } + }, + "range": [ + 1534, + 1558 + ], + "loc": { + "start": { + "line": 49, + "column": 23 + }, + "end": { + "line": 49, + "column": 47 + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "range": [ + 1559, + 1563 + ], + "loc": { + "start": { + "line": 49, + "column": 48 + }, + "end": { + "line": 49, + "column": 52 + } + } + }, + "range": [ + 1534, + 1563 + ], + "loc": { + "start": { + "line": 49, + "column": 23 + }, + "end": { + "line": 49, + "column": 52 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 1588, + 1592 + ], + "loc": { + "start": { + "line": 50, + "column": 21 + }, + "end": { + "line": 50, + "column": 25 + } + } + }, + "property": { + "type": "Identifier", + "name": "find", + "range": [ + 1593, + 1597 + ], + "loc": { + "start": { + "line": 50, + "column": 26 + }, + "end": { + "line": 50, + "column": 30 + } + } + }, + "range": [ + 1588, + 1597 + ], + "loc": { + "start": { + "line": 50, + "column": 21 + }, + "end": { + "line": 50, + "column": 30 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 1598, + 1602 + ], + "loc": { + "start": { + "line": 50, + "column": 31 + }, + "end": { + "line": 50, + "column": 35 + } + } + }, + "property": { + "type": "Identifier", + "name": "relationships", + "range": [ + 1603, + 1616 + ], + "loc": { + "start": { + "line": 50, + "column": 36 + }, + "end": { + "line": 50, + "column": 49 + } + } + }, + "range": [ + 1598, + 1616 + ], + "loc": { + "start": { + "line": 50, + "column": 31 + }, + "end": { + "line": 50, + "column": 49 + } + } + }, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 1617, + 1621 + ], + "loc": { + "start": { + "line": 50, + "column": 50 + }, + "end": { + "line": 50, + "column": 54 + } + } + }, + "range": [ + 1598, + 1622 + ], + "loc": { + "start": { + "line": 50, + "column": 31 + }, + "end": { + "line": 50, + "column": 55 + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "range": [ + 1623, + 1627 + ], + "loc": { + "start": { + "line": 50, + "column": 56 + }, + "end": { + "line": 50, + "column": 60 + } + } + }, + "range": [ + 1598, + 1627 + ], + "loc": { + "start": { + "line": 50, + "column": 31 + }, + "end": { + "line": 50, + "column": 60 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 1628, + 1632 + ], + "loc": { + "start": { + "line": 50, + "column": 61 + }, + "end": { + "line": 50, + "column": 65 + } + } + }, + "range": [ + 1598, + 1632 + ], + "loc": { + "start": { + "line": 50, + "column": 31 + }, + "end": { + "line": 50, + "column": 65 + } + } + }, + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 1634, + 1638 + ], + "loc": { + "start": { + "line": 50, + "column": 67 + }, + "end": { + "line": 50, + "column": 71 + } + } + }, + "property": { + "type": "Identifier", + "name": "relationships", + "range": [ + 1639, + 1652 + ], + "loc": { + "start": { + "line": 50, + "column": 72 + }, + "end": { + "line": 50, + "column": 85 + } + } + }, + "range": [ + 1634, + 1652 + ], + "loc": { + "start": { + "line": 50, + "column": 67 + }, + "end": { + "line": 50, + "column": 85 + } + } + }, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 1653, + 1657 + ], + "loc": { + "start": { + "line": 50, + "column": 86 + }, + "end": { + "line": 50, + "column": 90 + } + } + }, + "range": [ + 1634, + 1658 + ], + "loc": { + "start": { + "line": 50, + "column": 67 + }, + "end": { + "line": 50, + "column": 91 + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "range": [ + 1659, + 1663 + ], + "loc": { + "start": { + "line": 50, + "column": 92 + }, + "end": { + "line": 50, + "column": 96 + } + } + }, + "range": [ + 1634, + 1663 + ], + "loc": { + "start": { + "line": 50, + "column": 67 + }, + "end": { + "line": 50, + "column": 96 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 1664, + 1666 + ], + "loc": { + "start": { + "line": 50, + "column": 97 + }, + "end": { + "line": 50, + "column": 99 + } + } + }, + "range": [ + 1634, + 1666 + ], + "loc": { + "start": { + "line": 50, + "column": 67 + }, + "end": { + "line": 50, + "column": 99 + } + } + } + ], + "range": [ + 1588, + 1667 + ], + "loc": { + "start": { + "line": 50, + "column": 21 + }, + "end": { + "line": 50, + "column": 100 + } + } + }, + "range": [ + 1581, + 1668 + ], + "loc": { + "start": { + "line": 50, + "column": 14 + }, + "end": { + "line": 50, + "column": 101 + } + } + } + ], + "range": [ + 1565, + 1682 + ], + "loc": { + "start": { + "line": 49, + "column": 54 + }, + "end": { + "line": 51, + "column": 13 + } + } + }, + "alternate": null, + "range": [ + 1530, + 1682 + ], + "loc": { + "start": { + "line": 49, + "column": 19 + }, + "end": { + "line": 51, + "column": 13 + } + } + }, + "range": [ + 1438, + 1682 + ], + "loc": { + "start": { + "line": 47, + "column": 12 + }, + "end": { + "line": 51, + "column": 13 + } + } + } + ], + "range": [ + 1424, + 1694 + ], + "loc": { + "start": { + "line": 46, + "column": 62 + }, + "end": { + "line": 52, + "column": 11 + } + } + }, + "alternate": null, + "range": [ + 1372, + 1694 + ], + "loc": { + "start": { + "line": 46, + "column": 10 + }, + "end": { + "line": 52, + "column": 11 + } + } + } + ], + "range": [ + 1330, + 1704 + ], + "loc": { + "start": { + "line": 44, + "column": 42 + }, + "end": { + "line": 53, + "column": 9 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 1309, + 1704 + ], + "loc": { + "start": { + "line": 44, + "column": 21 + }, + "end": { + "line": 53, + "column": 9 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 1296, + 1704 + ], + "loc": { + "start": { + "line": 44, + "column": 8 + }, + "end": { + "line": 53, + "column": 9 + } + } + } + ], + "range": [ + 1216, + 1712 + ], + "loc": { + "start": { + "line": 41, + "column": 13 + }, + "end": { + "line": 54, + "column": 7 + } + } + }, + "range": [ + 1209, + 1713 + ], + "loc": { + "start": { + "line": 41, + "column": 6 + }, + "end": { + "line": 54, + "column": 8 + } + } + } + ], + "range": [ + 1201, + 1719 + ], + "loc": { + "start": { + "line": 40, + "column": 11 + }, + "end": { + "line": 55, + "column": 5 + } + } + }, + "range": [ + 1111, + 1719 + ], + "loc": { + "start": { + "line": 38, + "column": 4 + }, + "end": { + "line": 55, + "column": 5 + } + } + } + ], + "range": [ + 1105, + 1723 + ], + "loc": { + "start": { + "line": 37, + "column": 31 + }, + "end": { + "line": 56, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 1089, + 1723 + ], + "loc": { + "start": { + "line": 37, + "column": 15 + }, + "end": { + "line": 56, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 1076, + 1723 + ], + "loc": { + "start": { + "line": 37, + "column": 2 + }, + "end": { + "line": 56, + "column": 3 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": "*\n * Creates a field definition for an has-one relationship.\n *\n * @since 0.1.0\n * @param {string} [name] - Name of the property to map this field from.\n * @param {Object} [options] - An options object.\n * @param {string} [options.inverse] - Name of the inverse relationship.\n * @return {Object} - Field definition.\n ", + "range": [ + 736, + 1073 + ], + "loc": { + "start": { + "line": 28, + "column": 2 + }, + "end": { + "line": 36, + "column": 5 + } + } + } + ], + "trailingComments": [ + { + "type": "Block", + "value": "*\n * Creates a field definition for an has-many relationship.\n *\n * @since 0.1.0\n * @param {string} [name] - Name of the property to map this field from.\n * @param {Object} [options] - An options object.\n * @param {string} [options.inverse] - Name of the inverse relationship.\n * @return {Object} - Field definition.\n ", + "range": [ + 1727, + 2065 + ], + "loc": { + "start": { + "line": 58, + "column": 2 + }, + "end": { + "line": 66, + "column": 5 + } + } + } + ], + "static": true + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "hasMany", + "range": [ + 2075, + 2082 + ], + "loc": { + "start": { + "line": 67, + "column": 9 + }, + "end": { + "line": 67, + "column": 16 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "name", + "range": [ + 2083, + 2087 + ], + "loc": { + "start": { + "line": 67, + "column": 17 + }, + "end": { + "line": 67, + "column": 21 + } + } + }, + { + "type": "Identifier", + "name": "options", + "range": [ + 2089, + 2096 + ], + "loc": { + "start": { + "line": 67, + "column": 23 + }, + "end": { + "line": 67, + "column": 30 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "Identifier", + "name": "name", + "range": [ + 2108, + 2112 + ], + "loc": { + "start": { + "line": 68, + "column": 8 + }, + "end": { + "line": 68, + "column": 12 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "UnaryExpression", + "operator": "typeof", + "argument": { + "type": "Identifier", + "name": "name", + "range": [ + 2123, + 2127 + ], + "loc": { + "start": { + "line": 68, + "column": 23 + }, + "end": { + "line": 68, + "column": 27 + } + } + }, + "prefix": true, + "range": [ + 2116, + 2127 + ], + "loc": { + "start": { + "line": 68, + "column": 16 + }, + "end": { + "line": 68, + "column": 27 + } + } + }, + "right": { + "type": "Literal", + "value": "object", + "raw": "'object'", + "range": [ + 2132, + 2140 + ], + "loc": { + "start": { + "line": 68, + "column": 32 + }, + "end": { + "line": 68, + "column": 40 + } + } + }, + "range": [ + 2116, + 2140 + ], + "loc": { + "start": { + "line": 68, + "column": 16 + }, + "end": { + "line": 68, + "column": 40 + } + } + }, + "range": [ + 2108, + 2140 + ], + "loc": { + "start": { + "line": 68, + "column": 8 + }, + "end": { + "line": 68, + "column": 40 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "Store", + "range": [ + 2157, + 2162 + ], + "loc": { + "start": { + "line": 69, + "column": 13 + }, + "end": { + "line": 69, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "hasMany", + "range": [ + 2163, + 2170 + ], + "loc": { + "start": { + "line": 69, + "column": 19 + }, + "end": { + "line": 69, + "column": 26 + } + } + }, + "range": [ + 2157, + 2170 + ], + "loc": { + "start": { + "line": 69, + "column": 13 + }, + "end": { + "line": 69, + "column": 26 + } + } + }, + "arguments": [ + { + "type": "Literal", + "value": null, + "raw": "null", + "range": [ + 2171, + 2175 + ], + "loc": { + "start": { + "line": 69, + "column": 27 + }, + "end": { + "line": 69, + "column": 31 + } + } + }, + { + "type": "Identifier", + "name": "name", + "range": [ + 2177, + 2181 + ], + "loc": { + "start": { + "line": 69, + "column": 33 + }, + "end": { + "line": 69, + "column": 37 + } + } + } + ], + "range": [ + 2157, + 2182 + ], + "loc": { + "start": { + "line": 69, + "column": 13 + }, + "end": { + "line": 69, + "column": 38 + } + } + }, + "range": [ + 2150, + 2183 + ], + "loc": { + "start": { + "line": 69, + "column": 6 + }, + "end": { + "line": 69, + "column": 39 + } + } + } + ], + "range": [ + 2142, + 2189 + ], + "loc": { + "start": { + "line": 68, + "column": 42 + }, + "end": { + "line": 70, + "column": 5 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "type", + "range": [ + 2220, + 2224 + ], + "loc": { + "start": { + "line": 72, + "column": 8 + }, + "end": { + "line": 72, + "column": 12 + } + } + }, + "value": { + "type": "Literal", + "value": "has-many", + "raw": "\"has-many\"", + "range": [ + 2226, + 2236 + ], + "loc": { + "start": { + "line": 72, + "column": 14 + }, + "end": { + "line": 72, + "column": 24 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 2220, + 2236 + ], + "loc": { + "start": { + "line": 72, + "column": 8 + }, + "end": { + "line": 72, + "column": 24 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "default", + "range": [ + 2246, + 2253 + ], + "loc": { + "start": { + "line": 73, + "column": 8 + }, + "end": { + "line": 73, + "column": 15 + } + } + }, + "value": { + "type": "ArrayExpression", + "elements": [], + "range": [ + 2255, + 2257 + ], + "loc": { + "start": { + "line": 73, + "column": 17 + }, + "end": { + "line": 73, + "column": 19 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 2246, + 2257 + ], + "loc": { + "start": { + "line": 73, + "column": 8 + }, + "end": { + "line": 73, + "column": 19 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "inverse", + "range": [ + 2267, + 2274 + ], + "loc": { + "start": { + "line": 74, + "column": 8 + }, + "end": { + "line": 74, + "column": 15 + } + } + }, + "value": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "Identifier", + "name": "options", + "range": [ + 2276, + 2283 + ], + "loc": { + "start": { + "line": 74, + "column": 17 + }, + "end": { + "line": 74, + "column": 24 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "options", + "range": [ + 2287, + 2294 + ], + "loc": { + "start": { + "line": 74, + "column": 28 + }, + "end": { + "line": 74, + "column": 35 + } + } + }, + "property": { + "type": "Identifier", + "name": "inverse", + "range": [ + 2295, + 2302 + ], + "loc": { + "start": { + "line": 74, + "column": 36 + }, + "end": { + "line": 74, + "column": 43 + } + } + }, + "range": [ + 2287, + 2302 + ], + "loc": { + "start": { + "line": 74, + "column": 28 + }, + "end": { + "line": 74, + "column": 43 + } + } + }, + "range": [ + 2276, + 2302 + ], + "loc": { + "start": { + "line": 74, + "column": 17 + }, + "end": { + "line": 74, + "column": 43 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 2267, + 2302 + ], + "loc": { + "start": { + "line": 74, + "column": 8 + }, + "end": { + "line": 74, + "column": 43 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "deserialize", + "range": [ + 2312, + 2323 + ], + "loc": { + "start": { + "line": 75, + "column": 8 + }, + "end": { + "line": 75, + "column": 19 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "data", + "range": [ + 2335, + 2339 + ], + "loc": { + "start": { + "line": 75, + "column": 31 + }, + "end": { + "line": 75, + "column": 35 + } + } + }, + { + "type": "Identifier", + "name": "key", + "range": [ + 2341, + 2344 + ], + "loc": { + "start": { + "line": 75, + "column": 37 + }, + "end": { + "line": 75, + "column": 40 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", + "name": "name", + "range": [ + 2358, + 2362 + ], + "loc": { + "start": { + "line": 76, + "column": 10 + }, + "end": { + "line": 76, + "column": 14 + } + } + }, + "right": { + "type": "LogicalExpression", + "operator": "||", + "left": { + "type": "Identifier", + "name": "name", + "range": [ + 2365, + 2369 + ], + "loc": { + "start": { + "line": 76, + "column": 17 + }, + "end": { + "line": 76, + "column": 21 + } + } + }, + "right": { + "type": "Identifier", + "name": "key", + "range": [ + 2373, + 2376 + ], + "loc": { + "start": { + "line": 76, + "column": 25 + }, + "end": { + "line": 76, + "column": 28 + } + } + }, + "range": [ + 2365, + 2376 + ], + "loc": { + "start": { + "line": 76, + "column": 17 + }, + "end": { + "line": 76, + "column": 28 + } + } + }, + "range": [ + 2358, + 2376 + ], + "loc": { + "start": { + "line": 76, + "column": 10 + }, + "end": { + "line": 76, + "column": 28 + } + } + }, + "range": [ + 2358, + 2377 + ], + "loc": { + "start": { + "line": 76, + "column": 10 + }, + "end": { + "line": 76, + "column": 29 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 2392, + 2396 + ], + "loc": { + "start": { + "line": 77, + "column": 14 + }, + "end": { + "line": 77, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "relationships", + "range": [ + 2397, + 2410 + ], + "loc": { + "start": { + "line": 77, + "column": 19 + }, + "end": { + "line": 77, + "column": 32 + } + } + }, + "range": [ + 2392, + 2410 + ], + "loc": { + "start": { + "line": 77, + "column": 14 + }, + "end": { + "line": 77, + "column": 32 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 2414, + 2418 + ], + "loc": { + "start": { + "line": 77, + "column": 36 + }, + "end": { + "line": 77, + "column": 40 + } + } + }, + "property": { + "type": "Identifier", + "name": "relationships", + "range": [ + 2419, + 2432 + ], + "loc": { + "start": { + "line": 77, + "column": 41 + }, + "end": { + "line": 77, + "column": 54 + } + } + }, + "range": [ + 2414, + 2432 + ], + "loc": { + "start": { + "line": 77, + "column": 36 + }, + "end": { + "line": 77, + "column": 54 + } + } + }, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 2433, + 2437 + ], + "loc": { + "start": { + "line": 77, + "column": 55 + }, + "end": { + "line": 77, + "column": 59 + } + } + }, + "range": [ + 2414, + 2438 + ], + "loc": { + "start": { + "line": 77, + "column": 36 + }, + "end": { + "line": 77, + "column": 60 + } + } + }, + "range": [ + 2392, + 2438 + ], + "loc": { + "start": { + "line": 77, + "column": 14 + }, + "end": { + "line": 77, + "column": 60 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 2458, + 2462 + ], + "loc": { + "start": { + "line": 78, + "column": 16 + }, + "end": { + "line": 78, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "relationships", + "range": [ + 2463, + 2476 + ], + "loc": { + "start": { + "line": 78, + "column": 21 + }, + "end": { + "line": 78, + "column": 34 + } + } + }, + "range": [ + 2458, + 2476 + ], + "loc": { + "start": { + "line": 78, + "column": 16 + }, + "end": { + "line": 78, + "column": 34 + } + } + }, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 2477, + 2481 + ], + "loc": { + "start": { + "line": 78, + "column": 35 + }, + "end": { + "line": 78, + "column": 39 + } + } + }, + "range": [ + 2458, + 2482 + ], + "loc": { + "start": { + "line": 78, + "column": 16 + }, + "end": { + "line": 78, + "column": 40 + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "range": [ + 2483, + 2487 + ], + "loc": { + "start": { + "line": 78, + "column": 41 + }, + "end": { + "line": 78, + "column": 45 + } + } + }, + "range": [ + 2458, + 2487 + ], + "loc": { + "start": { + "line": 78, + "column": 16 + }, + "end": { + "line": 78, + "column": 45 + } + } + }, + "right": { + "type": "Literal", + "value": null, + "raw": "null", + "range": [ + 2492, + 2496 + ], + "loc": { + "start": { + "line": 78, + "column": 50 + }, + "end": { + "line": 78, + "column": 54 + } + } + }, + "range": [ + 2458, + 2496 + ], + "loc": { + "start": { + "line": 78, + "column": 16 + }, + "end": { + "line": 78, + "column": 54 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrayExpression", + "elements": [], + "range": [ + 2521, + 2523 + ], + "loc": { + "start": { + "line": 79, + "column": 21 + }, + "end": { + "line": 79, + "column": 23 + } + } + }, + "range": [ + 2514, + 2524 + ], + "loc": { + "start": { + "line": 79, + "column": 14 + }, + "end": { + "line": 79, + "column": 24 + } + } + } + ], + "range": [ + 2498, + 2538 + ], + "loc": { + "start": { + "line": 78, + "column": 56 + }, + "end": { + "line": 80, + "column": 13 + } + } + }, + "alternate": { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 2548, + 2552 + ], + "loc": { + "start": { + "line": 80, + "column": 23 + }, + "end": { + "line": 80, + "column": 27 + } + } + }, + "property": { + "type": "Identifier", + "name": "relationships", + "range": [ + 2553, + 2566 + ], + "loc": { + "start": { + "line": 80, + "column": 28 + }, + "end": { + "line": 80, + "column": 41 + } + } + }, + "range": [ + 2548, + 2566 + ], + "loc": { + "start": { + "line": 80, + "column": 23 + }, + "end": { + "line": 80, + "column": 41 + } + } + }, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 2567, + 2571 + ], + "loc": { + "start": { + "line": 80, + "column": 42 + }, + "end": { + "line": 80, + "column": 46 + } + } + }, + "range": [ + 2548, + 2572 + ], + "loc": { + "start": { + "line": 80, + "column": 23 + }, + "end": { + "line": 80, + "column": 47 + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "range": [ + 2573, + 2577 + ], + "loc": { + "start": { + "line": 80, + "column": 48 + }, + "end": { + "line": 80, + "column": 52 + } + } + }, + "range": [ + 2548, + 2577 + ], + "loc": { + "start": { + "line": 80, + "column": 23 + }, + "end": { + "line": 80, + "column": 52 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "data", + "range": [ + 2602, + 2606 + ], + "loc": { + "start": { + "line": 81, + "column": 21 + }, + "end": { + "line": 81, + "column": 25 + } + } + }, + "property": { + "type": "Identifier", + "name": "relationships", + "range": [ + 2607, + 2620 + ], + "loc": { + "start": { + "line": 81, + "column": 26 + }, + "end": { + "line": 81, + "column": 39 + } + } + }, + "range": [ + 2602, + 2620 + ], + "loc": { + "start": { + "line": 81, + "column": 21 + }, + "end": { + "line": 81, + "column": 39 + } + } + }, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 2621, + 2625 + ], + "loc": { + "start": { + "line": 81, + "column": 40 + }, + "end": { + "line": 81, + "column": 44 + } + } + }, + "range": [ + 2602, + 2626 + ], + "loc": { + "start": { + "line": 81, + "column": 21 + }, + "end": { + "line": 81, + "column": 45 + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "range": [ + 2627, + 2631 + ], + "loc": { + "start": { + "line": 81, + "column": 46 + }, + "end": { + "line": 81, + "column": 50 + } + } + }, + "range": [ + 2602, + 2631 + ], + "loc": { + "start": { + "line": 81, + "column": 21 + }, + "end": { + "line": 81, + "column": 50 + } + } + }, + "property": { + "type": "Identifier", + "name": "map", + "range": [ + 2632, + 2635 + ], + "loc": { + "start": { + "line": 81, + "column": 51 + }, + "end": { + "line": 81, + "column": 54 + } + } + }, + "range": [ + 2602, + 2635 + ], + "loc": { + "start": { + "line": 81, + "column": 21 + }, + "end": { + "line": 81, + "column": 54 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "c", + "range": [ + 2637, + 2638 + ], + "loc": { + "start": { + "line": 81, + "column": 56 + }, + "end": { + "line": 81, + "column": 57 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 2668, + 2672 + ], + "loc": { + "start": { + "line": 82, + "column": 23 + }, + "end": { + "line": 82, + "column": 27 + } + } + }, + "property": { + "type": "Identifier", + "name": "find", + "range": [ + 2673, + 2677 + ], + "loc": { + "start": { + "line": 82, + "column": 28 + }, + "end": { + "line": 82, + "column": 32 + } + } + }, + "range": [ + 2668, + 2677 + ], + "loc": { + "start": { + "line": 82, + "column": 23 + }, + "end": { + "line": 82, + "column": 32 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "c", + "range": [ + 2678, + 2679 + ], + "loc": { + "start": { + "line": 82, + "column": 33 + }, + "end": { + "line": 82, + "column": 34 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 2680, + 2684 + ], + "loc": { + "start": { + "line": 82, + "column": 35 + }, + "end": { + "line": 82, + "column": 39 + } + } + }, + "range": [ + 2678, + 2684 + ], + "loc": { + "start": { + "line": 82, + "column": 33 + }, + "end": { + "line": 82, + "column": 39 + } + } + }, + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "c", + "range": [ + 2686, + 2687 + ], + "loc": { + "start": { + "line": 82, + "column": 41 + }, + "end": { + "line": 82, + "column": 42 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 2688, + 2690 + ], + "loc": { + "start": { + "line": 82, + "column": 43 + }, + "end": { + "line": 82, + "column": 45 + } + } + }, + "range": [ + 2686, + 2690 + ], + "loc": { + "start": { + "line": 82, + "column": 41 + }, + "end": { + "line": 82, + "column": 45 + } + } + } + ], + "range": [ + 2668, + 2691 + ], + "loc": { + "start": { + "line": 82, + "column": 23 + }, + "end": { + "line": 82, + "column": 46 + } + } + }, + "range": [ + 2661, + 2692 + ], + "loc": { + "start": { + "line": 82, + "column": 16 + }, + "end": { + "line": 82, + "column": 47 + } + } + } + ], + "range": [ + 2643, + 2708 + ], + "loc": { + "start": { + "line": 81, + "column": 62 + }, + "end": { + "line": 83, + "column": 15 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 2636, + 2708 + ], + "loc": { + "start": { + "line": 81, + "column": 55 + }, + "end": { + "line": 83, + "column": 15 + } + } + } + ], + "range": [ + 2602, + 2709 + ], + "loc": { + "start": { + "line": 81, + "column": 21 + }, + "end": { + "line": 83, + "column": 16 + } + } + }, + "range": [ + 2595, + 2710 + ], + "loc": { + "start": { + "line": 81, + "column": 14 + }, + "end": { + "line": 83, + "column": 17 + } + } + } + ], + "range": [ + 2579, + 2724 + ], + "loc": { + "start": { + "line": 80, + "column": 54 + }, + "end": { + "line": 84, + "column": 13 + } + } + }, + "alternate": null, + "range": [ + 2544, + 2724 + ], + "loc": { + "start": { + "line": 80, + "column": 19 + }, + "end": { + "line": 84, + "column": 13 + } + } + }, + "range": [ + 2454, + 2724 + ], + "loc": { + "start": { + "line": 78, + "column": 12 + }, + "end": { + "line": 84, + "column": 13 + } + } + } + ], + "range": [ + 2440, + 2736 + ], + "loc": { + "start": { + "line": 77, + "column": 62 + }, + "end": { + "line": 85, + "column": 11 + } + } + }, + "alternate": null, + "range": [ + 2388, + 2736 + ], + "loc": { + "start": { + "line": 77, + "column": 10 + }, + "end": { + "line": 85, + "column": 11 + } + } + } + ], + "range": [ + 2346, + 2746 + ], + "loc": { + "start": { + "line": 75, + "column": 42 + }, + "end": { + "line": 86, + "column": 9 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 2325, + 2746 + ], + "loc": { + "start": { + "line": 75, + "column": 21 + }, + "end": { + "line": 86, + "column": 9 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 2312, + 2746 + ], + "loc": { + "start": { + "line": 75, + "column": 8 + }, + "end": { + "line": 86, + "column": 9 + } + } + } + ], + "range": [ + 2210, + 2754 + ], + "loc": { + "start": { + "line": 71, + "column": 13 + }, + "end": { + "line": 87, + "column": 7 + } + } + }, + "range": [ + 2203, + 2755 + ], + "loc": { + "start": { + "line": 71, + "column": 6 + }, + "end": { + "line": 87, + "column": 8 + } + } + } + ], + "range": [ + 2195, + 2761 + ], + "loc": { + "start": { + "line": 70, + "column": 11 + }, + "end": { + "line": 88, + "column": 5 + } + } + }, + "range": [ + 2104, + 2761 + ], + "loc": { + "start": { + "line": 68, + "column": 4 + }, + "end": { + "line": 88, + "column": 5 + } + } + } + ], + "range": [ + 2098, + 2765 + ], + "loc": { + "start": { + "line": 67, + "column": 32 + }, + "end": { + "line": 89, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 2082, + 2765 + ], + "loc": { + "start": { + "line": 67, + "column": 16 + }, + "end": { + "line": 89, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 2068, + 2765 + ], + "loc": { + "start": { + "line": 67, + "column": 2 + }, + "end": { + "line": 89, + "column": 3 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": "*\n * Creates a field definition for an has-many relationship.\n *\n * @since 0.1.0\n * @param {string} [name] - Name of the property to map this field from.\n * @param {Object} [options] - An options object.\n * @param {string} [options.inverse] - Name of the inverse relationship.\n * @return {Object} - Field definition.\n ", + "range": [ + 1727, + 2065 + ], + "loc": { + "start": { + "line": 58, + "column": 2 + }, + "end": { + "line": 66, + "column": 5 + } + } + } + ], + "static": true + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "range": [ + 2769, + 2780 + ], + "loc": { + "start": { + "line": 91, + "column": 2 + }, + "end": { + "line": 91, + "column": 13 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 2789, + 2793 + ], + "loc": { + "start": { + "line": 92, + "column": 4 + }, + "end": { + "line": 92, + "column": 8 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 2794, + 2814 + ], + "loc": { + "start": { + "line": 92, + "column": 9 + }, + "end": { + "line": 92, + "column": 29 + } + } + }, + "range": [ + 2789, + 2814 + ], + "loc": { + "start": { + "line": 92, + "column": 4 + }, + "end": { + "line": 92, + "column": 29 + } + } + }, + "right": { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "key": { + "type": "Literal", + "value": "added", + "raw": "\"added\"", + "range": [ + 2819, + 2826 + ], + "loc": { + "start": { + "line": 92, + "column": 34 + }, + "end": { + "line": 92, + "column": 41 + } + } + }, + "value": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 2828, + 2830 + ], + "loc": { + "start": { + "line": 92, + "column": 43 + }, + "end": { + "line": 92, + "column": 45 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 2819, + 2830 + ], + "loc": { + "start": { + "line": 92, + "column": 34 + }, + "end": { + "line": 92, + "column": 45 + } + } + }, + { + "type": "Property", + "key": { + "type": "Literal", + "value": "updated", + "raw": "\"updated\"", + "range": [ + 2832, + 2841 + ], + "loc": { + "start": { + "line": 92, + "column": 47 + }, + "end": { + "line": 92, + "column": 56 + } + } + }, + "value": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 2843, + 2845 + ], + "loc": { + "start": { + "line": 92, + "column": 58 + }, + "end": { + "line": 92, + "column": 60 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 2832, + 2845 + ], + "loc": { + "start": { + "line": 92, + "column": 47 + }, + "end": { + "line": 92, + "column": 60 + } + } + }, + { + "type": "Property", + "key": { + "type": "Literal", + "value": "removed", + "raw": "\"removed\"", + "range": [ + 2847, + 2856 + ], + "loc": { + "start": { + "line": 92, + "column": 62 + }, + "end": { + "line": 92, + "column": 71 + } + } + }, + "value": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 2858, + 2860 + ], + "loc": { + "start": { + "line": 92, + "column": 73 + }, + "end": { + "line": 92, + "column": 75 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 2847, + 2860 + ], + "loc": { + "start": { + "line": 92, + "column": 62 + }, + "end": { + "line": 92, + "column": 75 + } + } + } + ], + "range": [ + 2817, + 2862 + ], + "loc": { + "start": { + "line": 92, + "column": 32 + }, + "end": { + "line": 92, + "column": 77 + } + } + }, + "range": [ + 2789, + 2862 + ], + "loc": { + "start": { + "line": 92, + "column": 4 + }, + "end": { + "line": 92, + "column": 77 + } + } + }, + "range": [ + 2789, + 2863 + ], + "loc": { + "start": { + "line": 92, + "column": 4 + }, + "end": { + "line": 92, + "column": 78 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 2868, + 2872 + ], + "loc": { + "start": { + "line": 93, + "column": 4 + }, + "end": { + "line": 93, + "column": 8 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 2873, + 2878 + ], + "loc": { + "start": { + "line": 93, + "column": 9 + }, + "end": { + "line": 93, + "column": 14 + } + } + }, + "range": [ + 2868, + 2878 + ], + "loc": { + "start": { + "line": 93, + "column": 4 + }, + "end": { + "line": 93, + "column": 14 + } + } + }, + "right": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 2881, + 2883 + ], + "loc": { + "start": { + "line": 93, + "column": 17 + }, + "end": { + "line": 93, + "column": 19 + } + } + }, + "range": [ + 2868, + 2883 + ], + "loc": { + "start": { + "line": 93, + "column": 4 + }, + "end": { + "line": 93, + "column": 19 + } + } + }, + "range": [ + 2868, + 2884 + ], + "loc": { + "start": { + "line": 93, + "column": 4 + }, + "end": { + "line": 93, + "column": 20 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 2889, + 2893 + ], + "loc": { + "start": { + "line": 94, + "column": 4 + }, + "end": { + "line": 94, + "column": 8 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 2894, + 2912 + ], + "loc": { + "start": { + "line": 94, + "column": 9 + }, + "end": { + "line": 94, + "column": 27 + } + } + }, + "range": [ + 2889, + 2912 + ], + "loc": { + "start": { + "line": 94, + "column": 4 + }, + "end": { + "line": 94, + "column": 27 + } + } + }, + "right": { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "key": { + "type": "Literal", + "value": "added", + "raw": "\"added\"", + "range": [ + 2917, + 2924 + ], + "loc": { + "start": { + "line": 94, + "column": 32 + }, + "end": { + "line": 94, + "column": 39 + } + } + }, + "value": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 2926, + 2928 + ], + "loc": { + "start": { + "line": 94, + "column": 41 + }, + "end": { + "line": 94, + "column": 43 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 2917, + 2928 + ], + "loc": { + "start": { + "line": 94, + "column": 32 + }, + "end": { + "line": 94, + "column": 43 + } + } + }, + { + "type": "Property", + "key": { + "type": "Literal", + "value": "updated", + "raw": "\"updated\"", + "range": [ + 2930, + 2939 + ], + "loc": { + "start": { + "line": 94, + "column": 45 + }, + "end": { + "line": 94, + "column": 54 + } + } + }, + "value": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 2941, + 2943 + ], + "loc": { + "start": { + "line": 94, + "column": 56 + }, + "end": { + "line": 94, + "column": 58 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 2930, + 2943 + ], + "loc": { + "start": { + "line": 94, + "column": 45 + }, + "end": { + "line": 94, + "column": 58 + } + } + }, + { + "type": "Property", + "key": { + "type": "Literal", + "value": "removed", + "raw": "\"removed\"", + "range": [ + 2945, + 2954 + ], + "loc": { + "start": { + "line": 94, + "column": 60 + }, + "end": { + "line": 94, + "column": 69 + } + } + }, + "value": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 2956, + 2958 + ], + "loc": { + "start": { + "line": 94, + "column": 71 + }, + "end": { + "line": 94, + "column": 73 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 2945, + 2958 + ], + "loc": { + "start": { + "line": 94, + "column": 60 + }, + "end": { + "line": 94, + "column": 73 + } + } + } + ], + "range": [ + 2915, + 2960 + ], + "loc": { + "start": { + "line": 94, + "column": 30 + }, + "end": { + "line": 94, + "column": 75 + } + } + }, + "range": [ + 2889, + 2960 + ], + "loc": { + "start": { + "line": 94, + "column": 4 + }, + "end": { + "line": 94, + "column": 75 + } + } + }, + "range": [ + 2889, + 2961 + ], + "loc": { + "start": { + "line": 94, + "column": 4 + }, + "end": { + "line": 94, + "column": 76 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 2966, + 2970 + ], + "loc": { + "start": { + "line": 95, + "column": 4 + }, + "end": { + "line": 95, + "column": 8 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 2971, + 2977 + ], + "loc": { + "start": { + "line": 95, + "column": 9 + }, + "end": { + "line": 95, + "column": 15 + } + } + }, + "range": [ + 2966, + 2977 + ], + "loc": { + "start": { + "line": 95, + "column": 4 + }, + "end": { + "line": 95, + "column": 15 + } + } + }, + "right": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 2980, + 2982 + ], + "loc": { + "start": { + "line": 95, + "column": 18 + }, + "end": { + "line": 95, + "column": 20 + } + } + }, + "range": [ + 2966, + 2982 + ], + "loc": { + "start": { + "line": 95, + "column": 4 + }, + "end": { + "line": 95, + "column": 20 + } + } + }, + "range": [ + 2966, + 2983 + ], + "loc": { + "start": { + "line": 95, + "column": 4 + }, + "end": { + "line": 95, + "column": 21 + } + } + } + ], + "range": [ + 2783, + 2987 + ], + "loc": { + "start": { + "line": 91, + "column": 16 + }, + "end": { + "line": 96, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 2780, + 2987 + ], + "loc": { + "start": { + "line": 91, + "column": 13 + }, + "end": { + "line": 96, + "column": 3 + } + } + }, + "kind": "constructor", + "computed": false, + "range": [ + 2769, + 2987 + ], + "loc": { + "start": { + "line": 91, + "column": 2 + }, + "end": { + "line": 96, + "column": 3 + } + }, + "trailingComments": [ + { + "type": "Block", + "value": "*\n * Add an individual resource to the store. This is used internally by the\n * `push()` method.\n *\n * @since 0.1.0\n * @param {!Object} object - Resource Object to add. See:\n http://jsonapi.org/format/#document-resource-objects\n * @return {undefined} - Nothing.\n ", + "range": [ + 2991, + 3283 + ], + "loc": { + "start": { + "line": 98, + "column": 2 + }, + "end": { + "line": 106, + "column": 5 + } + } + } + ], + "static": false + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "add", + "range": [ + 3286, + 3289 + ], + "loc": { + "start": { + "line": 107, + "column": 2 + }, + "end": { + "line": 107, + "column": 5 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "object", + "range": [ + 3290, + 3296 + ], + "loc": { + "start": { + "line": 107, + "column": 6 + }, + "end": { + "line": 107, + "column": 12 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "object", + "range": [ + 3308, + 3314 + ], + "loc": { + "start": { + "line": 108, + "column": 8 + }, + "end": { + "line": 108, + "column": 14 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3328, + 3334 + ], + "loc": { + "start": { + "line": 109, + "column": 10 + }, + "end": { + "line": 109, + "column": 16 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 3335, + 3339 + ], + "loc": { + "start": { + "line": 109, + "column": 17 + }, + "end": { + "line": 109, + "column": 21 + } + } + }, + "range": [ + 3328, + 3339 + ], + "loc": { + "start": { + "line": 109, + "column": 10 + }, + "end": { + "line": 109, + "column": 21 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3343, + 3349 + ], + "loc": { + "start": { + "line": 109, + "column": 25 + }, + "end": { + "line": 109, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 3350, + 3352 + ], + "loc": { + "start": { + "line": 109, + "column": 32 + }, + "end": { + "line": 109, + "column": 34 + } + } + }, + "range": [ + 3343, + 3352 + ], + "loc": { + "start": { + "line": 109, + "column": 25 + }, + "end": { + "line": 109, + "column": 34 + } + } + }, + "range": [ + 3328, + 3352 + ], + "loc": { + "start": { + "line": 109, + "column": 10 + }, + "end": { + "line": 109, + "column": 34 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "event", + "range": [ + 3368, + 3373 + ], + "loc": { + "start": { + "line": 110, + "column": 12 + }, + "end": { + "line": 110, + "column": 17 + } + } + }, + "init": { + "type": "ConditionalExpression", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 3376, + 3380 + ], + "loc": { + "start": { + "line": 110, + "column": 20 + }, + "end": { + "line": 110, + "column": 24 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 3381, + 3386 + ], + "loc": { + "start": { + "line": 110, + "column": 25 + }, + "end": { + "line": 110, + "column": 30 + } + } + }, + "range": [ + 3376, + 3386 + ], + "loc": { + "start": { + "line": 110, + "column": 20 + }, + "end": { + "line": 110, + "column": 30 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3387, + 3393 + ], + "loc": { + "start": { + "line": 110, + "column": 31 + }, + "end": { + "line": 110, + "column": 37 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 3394, + 3398 + ], + "loc": { + "start": { + "line": 110, + "column": 38 + }, + "end": { + "line": 110, + "column": 42 + } + } + }, + "range": [ + 3387, + 3398 + ], + "loc": { + "start": { + "line": 110, + "column": 31 + }, + "end": { + "line": 110, + "column": 42 + } + } + }, + "range": [ + 3376, + 3399 + ], + "loc": { + "start": { + "line": 110, + "column": 20 + }, + "end": { + "line": 110, + "column": 43 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 3403, + 3407 + ], + "loc": { + "start": { + "line": 110, + "column": 47 + }, + "end": { + "line": 110, + "column": 51 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 3408, + 3413 + ], + "loc": { + "start": { + "line": 110, + "column": 52 + }, + "end": { + "line": 110, + "column": 57 + } + } + }, + "range": [ + 3403, + 3413 + ], + "loc": { + "start": { + "line": 110, + "column": 47 + }, + "end": { + "line": 110, + "column": 57 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3414, + 3420 + ], + "loc": { + "start": { + "line": 110, + "column": 58 + }, + "end": { + "line": 110, + "column": 64 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 3421, + 3425 + ], + "loc": { + "start": { + "line": 110, + "column": 65 + }, + "end": { + "line": 110, + "column": 69 + } + } + }, + "range": [ + 3414, + 3425 + ], + "loc": { + "start": { + "line": 110, + "column": 58 + }, + "end": { + "line": 110, + "column": 69 + } + } + }, + "range": [ + 3403, + 3426 + ], + "loc": { + "start": { + "line": 110, + "column": 47 + }, + "end": { + "line": 110, + "column": 70 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3427, + 3433 + ], + "loc": { + "start": { + "line": 110, + "column": 71 + }, + "end": { + "line": 110, + "column": 77 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 3434, + 3436 + ], + "loc": { + "start": { + "line": 110, + "column": 78 + }, + "end": { + "line": 110, + "column": 80 + } + } + }, + "range": [ + 3427, + 3436 + ], + "loc": { + "start": { + "line": 110, + "column": 71 + }, + "end": { + "line": 110, + "column": 80 + } + } + }, + "range": [ + 3403, + 3437 + ], + "loc": { + "start": { + "line": 110, + "column": 47 + }, + "end": { + "line": 110, + "column": 81 + } + } + }, + "range": [ + 3376, + 3437 + ], + "loc": { + "start": { + "line": 110, + "column": 20 + }, + "end": { + "line": 110, + "column": 81 + } + } + }, + "consequent": { + "type": "Literal", + "value": "updated", + "raw": "\"updated\"", + "range": [ + 3440, + 3449 + ], + "loc": { + "start": { + "line": 110, + "column": 84 + }, + "end": { + "line": 110, + "column": 93 + } + } + }, + "alternate": { + "type": "Literal", + "value": "added", + "raw": "\"added\"", + "range": [ + 3452, + 3459 + ], + "loc": { + "start": { + "line": 110, + "column": 96 + }, + "end": { + "line": 110, + "column": 103 + } + } + }, + "range": [ + 3376, + 3459 + ], + "loc": { + "start": { + "line": 110, + "column": 20 + }, + "end": { + "line": 110, + "column": 103 + } + } + }, + "range": [ + 3368, + 3459 + ], + "loc": { + "start": { + "line": 110, + "column": 12 + }, + "end": { + "line": 110, + "column": 103 + } + } + } + ], + "kind": "let", + "range": [ + 3364, + 3460 + ], + "loc": { + "start": { + "line": 110, + "column": 8 + }, + "end": { + "line": 110, + "column": 104 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "resource", + "range": [ + 3473, + 3481 + ], + "loc": { + "start": { + "line": 111, + "column": 12 + }, + "end": { + "line": 111, + "column": 20 + } + } + }, + "init": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 3484, + 3488 + ], + "loc": { + "start": { + "line": 111, + "column": 23 + }, + "end": { + "line": 111, + "column": 27 + } + } + }, + "property": { + "type": "Identifier", + "name": "find", + "range": [ + 3489, + 3493 + ], + "loc": { + "start": { + "line": 111, + "column": 28 + }, + "end": { + "line": 111, + "column": 32 + } + } + }, + "range": [ + 3484, + 3493 + ], + "loc": { + "start": { + "line": 111, + "column": 23 + }, + "end": { + "line": 111, + "column": 32 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3494, + 3500 + ], + "loc": { + "start": { + "line": 111, + "column": 33 + }, + "end": { + "line": 111, + "column": 39 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 3501, + 3505 + ], + "loc": { + "start": { + "line": 111, + "column": 40 + }, + "end": { + "line": 111, + "column": 44 + } + } + }, + "range": [ + 3494, + 3505 + ], + "loc": { + "start": { + "line": 111, + "column": 33 + }, + "end": { + "line": 111, + "column": 44 + } + } + }, + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3507, + 3513 + ], + "loc": { + "start": { + "line": 111, + "column": 46 + }, + "end": { + "line": 111, + "column": 52 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 3514, + 3516 + ], + "loc": { + "start": { + "line": 111, + "column": 53 + }, + "end": { + "line": 111, + "column": 55 + } + } + }, + "range": [ + 3507, + 3516 + ], + "loc": { + "start": { + "line": 111, + "column": 46 + }, + "end": { + "line": 111, + "column": 55 + } + } + } + ], + "range": [ + 3484, + 3517 + ], + "loc": { + "start": { + "line": 111, + "column": 23 + }, + "end": { + "line": 111, + "column": 56 + } + } + }, + "range": [ + 3473, + 3517 + ], + "loc": { + "start": { + "line": 111, + "column": 12 + }, + "end": { + "line": 111, + "column": 56 + } + } + } + ], + "kind": "let", + "range": [ + 3469, + 3518 + ], + "loc": { + "start": { + "line": 111, + "column": 8 + }, + "end": { + "line": 111, + "column": 57 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "definition", + "range": [ + 3531, + 3541 + ], + "loc": { + "start": { + "line": 112, + "column": 12 + }, + "end": { + "line": 112, + "column": 22 + } + } + }, + "init": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 3544, + 3548 + ], + "loc": { + "start": { + "line": 112, + "column": 25 + }, + "end": { + "line": 112, + "column": 29 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 3549, + 3555 + ], + "loc": { + "start": { + "line": 112, + "column": 30 + }, + "end": { + "line": 112, + "column": 36 + } + } + }, + "range": [ + 3544, + 3555 + ], + "loc": { + "start": { + "line": 112, + "column": 25 + }, + "end": { + "line": 112, + "column": 36 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3556, + 3562 + ], + "loc": { + "start": { + "line": 112, + "column": 37 + }, + "end": { + "line": 112, + "column": 43 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 3563, + 3567 + ], + "loc": { + "start": { + "line": 112, + "column": 44 + }, + "end": { + "line": 112, + "column": 48 + } + } + }, + "range": [ + 3556, + 3567 + ], + "loc": { + "start": { + "line": 112, + "column": 37 + }, + "end": { + "line": 112, + "column": 48 + } + } + }, + "range": [ + 3544, + 3568 + ], + "loc": { + "start": { + "line": 112, + "column": 25 + }, + "end": { + "line": 112, + "column": 49 + } + } + }, + "range": [ + 3531, + 3568 + ], + "loc": { + "start": { + "line": 112, + "column": 12 + }, + "end": { + "line": 112, + "column": 49 + } + } + } + ], + "kind": "let", + "range": [ + 3527, + 3569 + ], + "loc": { + "start": { + "line": 112, + "column": 8 + }, + "end": { + "line": 112, + "column": 50 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "Object", + "range": [ + 3578, + 3584 + ], + "loc": { + "start": { + "line": 113, + "column": 8 + }, + "end": { + "line": 113, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "keys", + "range": [ + 3585, + 3589 + ], + "loc": { + "start": { + "line": 113, + "column": 15 + }, + "end": { + "line": 113, + "column": 19 + } + } + }, + "range": [ + 3578, + 3589 + ], + "loc": { + "start": { + "line": 113, + "column": 8 + }, + "end": { + "line": 113, + "column": 19 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "definition", + "range": [ + 3590, + 3600 + ], + "loc": { + "start": { + "line": 113, + "column": 20 + }, + "end": { + "line": 113, + "column": 30 + } + } + } + ], + "range": [ + 3578, + 3601 + ], + "loc": { + "start": { + "line": 113, + "column": 8 + }, + "end": { + "line": 113, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 3602, + 3609 + ], + "loc": { + "start": { + "line": 113, + "column": 32 + }, + "end": { + "line": 113, + "column": 39 + } + } + }, + "range": [ + 3578, + 3609 + ], + "loc": { + "start": { + "line": 113, + "column": 8 + }, + "end": { + "line": 113, + "column": 39 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "fieldName", + "range": [ + 3610, + 3619 + ], + "loc": { + "start": { + "line": 113, + "column": 40 + }, + "end": { + "line": 113, + "column": 49 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "!==", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 3639, + 3648 + ], + "loc": { + "start": { + "line": 114, + "column": 14 + }, + "end": { + "line": 114, + "column": 23 + } + } + }, + "property": { + "type": "Literal", + "value": 0, + "raw": "0", + "range": [ + 3649, + 3650 + ], + "loc": { + "start": { + "line": 114, + "column": 24 + }, + "end": { + "line": 114, + "column": 25 + } + } + }, + "range": [ + 3639, + 3651 + ], + "loc": { + "start": { + "line": 114, + "column": 14 + }, + "end": { + "line": 114, + "column": 26 + } + } + }, + "right": { + "type": "Literal", + "value": "_", + "raw": "\"_\"", + "range": [ + 3656, + 3659 + ], + "loc": { + "start": { + "line": 114, + "column": 31 + }, + "end": { + "line": 114, + "column": 34 + } + } + }, + "range": [ + 3639, + 3659 + ], + "loc": { + "start": { + "line": 114, + "column": 14 + }, + "end": { + "line": 114, + "column": 34 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 3675, + 3679 + ], + "loc": { + "start": { + "line": 115, + "column": 12 + }, + "end": { + "line": 115, + "column": 16 + } + } + }, + "property": { + "type": "Identifier", + "name": "_addField", + "range": [ + 3680, + 3689 + ], + "loc": { + "start": { + "line": 115, + "column": 17 + }, + "end": { + "line": 115, + "column": 26 + } + } + }, + "range": [ + 3675, + 3689 + ], + "loc": { + "start": { + "line": 115, + "column": 12 + }, + "end": { + "line": 115, + "column": 26 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "object", + "range": [ + 3690, + 3696 + ], + "loc": { + "start": { + "line": 115, + "column": 27 + }, + "end": { + "line": 115, + "column": 33 + } + } + }, + { + "type": "Identifier", + "name": "resource", + "range": [ + 3698, + 3706 + ], + "loc": { + "start": { + "line": 115, + "column": 35 + }, + "end": { + "line": 115, + "column": 43 + } + } + }, + { + "type": "Identifier", + "name": "definition", + "range": [ + 3708, + 3718 + ], + "loc": { + "start": { + "line": 115, + "column": 45 + }, + "end": { + "line": 115, + "column": 55 + } + } + }, + { + "type": "Identifier", + "name": "fieldName", + "range": [ + 3720, + 3729 + ], + "loc": { + "start": { + "line": 115, + "column": 57 + }, + "end": { + "line": 115, + "column": 66 + } + } + } + ], + "range": [ + 3675, + 3730 + ], + "loc": { + "start": { + "line": 115, + "column": 12 + }, + "end": { + "line": 115, + "column": 67 + } + } + }, + "range": [ + 3675, + 3731 + ], + "loc": { + "start": { + "line": 115, + "column": 12 + }, + "end": { + "line": 115, + "column": 68 + } + } + } + ], + "range": [ + 3661, + 3743 + ], + "loc": { + "start": { + "line": 114, + "column": 36 + }, + "end": { + "line": 116, + "column": 11 + } + } + }, + "alternate": null, + "range": [ + 3635, + 3743 + ], + "loc": { + "start": { + "line": 114, + "column": 10 + }, + "end": { + "line": 116, + "column": 11 + } + } + } + ], + "range": [ + 3623, + 3753 + ], + "loc": { + "start": { + "line": 113, + "column": 53 + }, + "end": { + "line": 117, + "column": 9 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 3610, + 3753 + ], + "loc": { + "start": { + "line": 113, + "column": 40 + }, + "end": { + "line": 117, + "column": 9 + } + } + } + ], + "range": [ + 3578, + 3754 + ], + "loc": { + "start": { + "line": 113, + "column": 8 + }, + "end": { + "line": 117, + "column": 10 + } + } + }, + "range": [ + 3578, + 3755 + ], + "loc": { + "start": { + "line": 113, + "column": 8 + }, + "end": { + "line": 117, + "column": 11 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 3768, + 3772 + ], + "loc": { + "start": { + "line": 118, + "column": 12 + }, + "end": { + "line": 118, + "column": 16 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 3773, + 3791 + ], + "loc": { + "start": { + "line": 118, + "column": 17 + }, + "end": { + "line": 118, + "column": 35 + } + } + }, + "range": [ + 3768, + 3791 + ], + "loc": { + "start": { + "line": 118, + "column": 12 + }, + "end": { + "line": 118, + "column": 35 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 3792, + 3797 + ], + "loc": { + "start": { + "line": 118, + "column": 36 + }, + "end": { + "line": 118, + "column": 41 + } + } + }, + "range": [ + 3768, + 3798 + ], + "loc": { + "start": { + "line": 118, + "column": 12 + }, + "end": { + "line": 118, + "column": 42 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3799, + 3805 + ], + "loc": { + "start": { + "line": 118, + "column": 43 + }, + "end": { + "line": 118, + "column": 49 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 3806, + 3810 + ], + "loc": { + "start": { + "line": 118, + "column": 50 + }, + "end": { + "line": 118, + "column": 54 + } + } + }, + "range": [ + 3799, + 3810 + ], + "loc": { + "start": { + "line": 118, + "column": 43 + }, + "end": { + "line": 118, + "column": 54 + } + } + }, + "range": [ + 3768, + 3811 + ], + "loc": { + "start": { + "line": 118, + "column": 12 + }, + "end": { + "line": 118, + "column": 55 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 3815, + 3819 + ], + "loc": { + "start": { + "line": 118, + "column": 59 + }, + "end": { + "line": 118, + "column": 63 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 3820, + 3838 + ], + "loc": { + "start": { + "line": 118, + "column": 64 + }, + "end": { + "line": 118, + "column": 82 + } + } + }, + "range": [ + 3815, + 3838 + ], + "loc": { + "start": { + "line": 118, + "column": 59 + }, + "end": { + "line": 118, + "column": 82 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 3839, + 3844 + ], + "loc": { + "start": { + "line": 118, + "column": 83 + }, + "end": { + "line": 118, + "column": 88 + } + } + }, + "range": [ + 3815, + 3845 + ], + "loc": { + "start": { + "line": 118, + "column": 59 + }, + "end": { + "line": 118, + "column": 89 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3846, + 3852 + ], + "loc": { + "start": { + "line": 118, + "column": 90 + }, + "end": { + "line": 118, + "column": 96 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 3853, + 3857 + ], + "loc": { + "start": { + "line": 118, + "column": 97 + }, + "end": { + "line": 118, + "column": 101 + } + } + }, + "range": [ + 3846, + 3857 + ], + "loc": { + "start": { + "line": 118, + "column": 90 + }, + "end": { + "line": 118, + "column": 101 + } + } + }, + "range": [ + 3815, + 3858 + ], + "loc": { + "start": { + "line": 118, + "column": 59 + }, + "end": { + "line": 118, + "column": 102 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3859, + 3865 + ], + "loc": { + "start": { + "line": 118, + "column": 103 + }, + "end": { + "line": 118, + "column": 109 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 3866, + 3868 + ], + "loc": { + "start": { + "line": 118, + "column": 110 + }, + "end": { + "line": 118, + "column": 112 + } + } + }, + "range": [ + 3859, + 3868 + ], + "loc": { + "start": { + "line": 118, + "column": 103 + }, + "end": { + "line": 118, + "column": 112 + } + } + }, + "range": [ + 3815, + 3869 + ], + "loc": { + "start": { + "line": 118, + "column": 59 + }, + "end": { + "line": 118, + "column": 113 + } + } + }, + "range": [ + 3768, + 3869 + ], + "loc": { + "start": { + "line": 118, + "column": 12 + }, + "end": { + "line": 118, + "column": 113 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 3884, + 3888 + ], + "loc": { + "start": { + "line": 119, + "column": 11 + }, + "end": { + "line": 119, + "column": 15 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 3889, + 3907 + ], + "loc": { + "start": { + "line": 119, + "column": 16 + }, + "end": { + "line": 119, + "column": 34 + } + } + }, + "range": [ + 3884, + 3907 + ], + "loc": { + "start": { + "line": 119, + "column": 11 + }, + "end": { + "line": 119, + "column": 34 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 3908, + 3913 + ], + "loc": { + "start": { + "line": 119, + "column": 35 + }, + "end": { + "line": 119, + "column": 40 + } + } + }, + "range": [ + 3884, + 3914 + ], + "loc": { + "start": { + "line": 119, + "column": 11 + }, + "end": { + "line": 119, + "column": 41 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3915, + 3921 + ], + "loc": { + "start": { + "line": 119, + "column": 42 + }, + "end": { + "line": 119, + "column": 48 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 3922, + 3926 + ], + "loc": { + "start": { + "line": 119, + "column": 49 + }, + "end": { + "line": 119, + "column": 53 + } + } + }, + "range": [ + 3915, + 3926 + ], + "loc": { + "start": { + "line": 119, + "column": 42 + }, + "end": { + "line": 119, + "column": 53 + } + } + }, + "range": [ + 3884, + 3927 + ], + "loc": { + "start": { + "line": 119, + "column": 11 + }, + "end": { + "line": 119, + "column": 54 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 3928, + 3934 + ], + "loc": { + "start": { + "line": 119, + "column": 55 + }, + "end": { + "line": 119, + "column": 61 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 3935, + 3937 + ], + "loc": { + "start": { + "line": 119, + "column": 62 + }, + "end": { + "line": 119, + "column": 64 + } + } + }, + "range": [ + 3928, + 3937 + ], + "loc": { + "start": { + "line": 119, + "column": 55 + }, + "end": { + "line": 119, + "column": 64 + } + } + }, + "range": [ + 3884, + 3938 + ], + "loc": { + "start": { + "line": 119, + "column": 11 + }, + "end": { + "line": 119, + "column": 65 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 3939, + 3946 + ], + "loc": { + "start": { + "line": 119, + "column": 66 + }, + "end": { + "line": 119, + "column": 73 + } + } + }, + "range": [ + 3884, + 3946 + ], + "loc": { + "start": { + "line": 119, + "column": 11 + }, + "end": { + "line": 119, + "column": 73 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 3947, + 3948 + ], + "loc": { + "start": { + "line": 119, + "column": 74 + }, + "end": { + "line": 119, + "column": 75 + } + } + } + ], + "body": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 3952, + 3953 + ], + "loc": { + "start": { + "line": 119, + "column": 79 + }, + "end": { + "line": 119, + "column": 80 + } + } + }, + "property": { + "type": "Literal", + "value": 0, + "raw": "0", + "range": [ + 3954, + 3955 + ], + "loc": { + "start": { + "line": 119, + "column": 81 + }, + "end": { + "line": 119, + "column": 82 + } + } + }, + "range": [ + 3952, + 3956 + ], + "loc": { + "start": { + "line": 119, + "column": 79 + }, + "end": { + "line": 119, + "column": 83 + } + } + }, + "property": { + "type": "Identifier", + "name": "call", + "range": [ + 3957, + 3961 + ], + "loc": { + "start": { + "line": 119, + "column": 84 + }, + "end": { + "line": 119, + "column": 88 + } + } + }, + "range": [ + 3952, + 3961 + ], + "loc": { + "start": { + "line": 119, + "column": 79 + }, + "end": { + "line": 119, + "column": 88 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 3962, + 3963 + ], + "loc": { + "start": { + "line": 119, + "column": 89 + }, + "end": { + "line": 119, + "column": 90 + } + } + }, + "property": { + "type": "Literal", + "value": 1, + "raw": "1", + "range": [ + 3964, + 3965 + ], + "loc": { + "start": { + "line": 119, + "column": 91 + }, + "end": { + "line": 119, + "column": 92 + } + } + }, + "range": [ + 3962, + 3966 + ], + "loc": { + "start": { + "line": 119, + "column": 89 + }, + "end": { + "line": 119, + "column": 93 + } + } + }, + { + "type": "Identifier", + "name": "resource", + "range": [ + 3968, + 3976 + ], + "loc": { + "start": { + "line": 119, + "column": 95 + }, + "end": { + "line": 119, + "column": 103 + } + } + } + ], + "range": [ + 3952, + 3977 + ], + "loc": { + "start": { + "line": 119, + "column": 79 + }, + "end": { + "line": 119, + "column": 104 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 3947, + 3977 + ], + "loc": { + "start": { + "line": 119, + "column": 74 + }, + "end": { + "line": 119, + "column": 104 + } + } + } + ], + "range": [ + 3884, + 3978 + ], + "loc": { + "start": { + "line": 119, + "column": 11 + }, + "end": { + "line": 119, + "column": 105 + } + } + }, + "range": [ + 3884, + 3979 + ], + "loc": { + "start": { + "line": 119, + "column": 11 + }, + "end": { + "line": 119, + "column": 106 + } + } + } + ], + "range": [ + 3871, + 3989 + ], + "loc": { + "start": { + "line": 118, + "column": 115 + }, + "end": { + "line": 120, + "column": 9 + } + } + }, + "alternate": null, + "range": [ + 3764, + 3989 + ], + "loc": { + "start": { + "line": 118, + "column": 8 + }, + "end": { + "line": 120, + "column": 9 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 4002, + 4006 + ], + "loc": { + "start": { + "line": 121, + "column": 12 + }, + "end": { + "line": 121, + "column": 16 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 4007, + 4027 + ], + "loc": { + "start": { + "line": 121, + "column": 17 + }, + "end": { + "line": 121, + "column": 37 + } + } + }, + "range": [ + 4002, + 4027 + ], + "loc": { + "start": { + "line": 121, + "column": 12 + }, + "end": { + "line": 121, + "column": 37 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 4028, + 4033 + ], + "loc": { + "start": { + "line": 121, + "column": 38 + }, + "end": { + "line": 121, + "column": 43 + } + } + }, + "range": [ + 4002, + 4034 + ], + "loc": { + "start": { + "line": 121, + "column": 12 + }, + "end": { + "line": 121, + "column": 44 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 4035, + 4041 + ], + "loc": { + "start": { + "line": 121, + "column": 45 + }, + "end": { + "line": 121, + "column": 51 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 4042, + 4046 + ], + "loc": { + "start": { + "line": 121, + "column": 52 + }, + "end": { + "line": 121, + "column": 56 + } + } + }, + "range": [ + 4035, + 4046 + ], + "loc": { + "start": { + "line": 121, + "column": 45 + }, + "end": { + "line": 121, + "column": 56 + } + } + }, + "range": [ + 4002, + 4047 + ], + "loc": { + "start": { + "line": 121, + "column": 12 + }, + "end": { + "line": 121, + "column": 57 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 4061, + 4065 + ], + "loc": { + "start": { + "line": 122, + "column": 10 + }, + "end": { + "line": 122, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 4066, + 4086 + ], + "loc": { + "start": { + "line": 122, + "column": 15 + }, + "end": { + "line": 122, + "column": 35 + } + } + }, + "range": [ + 4061, + 4086 + ], + "loc": { + "start": { + "line": 122, + "column": 10 + }, + "end": { + "line": 122, + "column": 35 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 4087, + 4092 + ], + "loc": { + "start": { + "line": 122, + "column": 36 + }, + "end": { + "line": 122, + "column": 41 + } + } + }, + "range": [ + 4061, + 4093 + ], + "loc": { + "start": { + "line": 122, + "column": 10 + }, + "end": { + "line": 122, + "column": 42 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "object", + "range": [ + 4094, + 4100 + ], + "loc": { + "start": { + "line": 122, + "column": 43 + }, + "end": { + "line": 122, + "column": 49 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 4101, + 4105 + ], + "loc": { + "start": { + "line": 122, + "column": 50 + }, + "end": { + "line": 122, + "column": 54 + } + } + }, + "range": [ + 4094, + 4105 + ], + "loc": { + "start": { + "line": 122, + "column": 43 + }, + "end": { + "line": 122, + "column": 54 + } + } + }, + "range": [ + 4061, + 4106 + ], + "loc": { + "start": { + "line": 122, + "column": 10 + }, + "end": { + "line": 122, + "column": 55 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 4107, + 4114 + ], + "loc": { + "start": { + "line": 122, + "column": 56 + }, + "end": { + "line": 122, + "column": 63 + } + } + }, + "range": [ + 4061, + 4114 + ], + "loc": { + "start": { + "line": 122, + "column": 10 + }, + "end": { + "line": 122, + "column": 63 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 4115, + 4116 + ], + "loc": { + "start": { + "line": 122, + "column": 64 + }, + "end": { + "line": 122, + "column": 65 + } + } + } + ], + "body": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 4120, + 4121 + ], + "loc": { + "start": { + "line": 122, + "column": 69 + }, + "end": { + "line": 122, + "column": 70 + } + } + }, + "property": { + "type": "Literal", + "value": 0, + "raw": "0", + "range": [ + 4122, + 4123 + ], + "loc": { + "start": { + "line": 122, + "column": 71 + }, + "end": { + "line": 122, + "column": 72 + } + } + }, + "range": [ + 4120, + 4124 + ], + "loc": { + "start": { + "line": 122, + "column": 69 + }, + "end": { + "line": 122, + "column": 73 + } + } + }, + "property": { + "type": "Identifier", + "name": "call", + "range": [ + 4125, + 4129 + ], + "loc": { + "start": { + "line": 122, + "column": 74 + }, + "end": { + "line": 122, + "column": 78 + } + } + }, + "range": [ + 4120, + 4129 + ], + "loc": { + "start": { + "line": 122, + "column": 69 + }, + "end": { + "line": 122, + "column": 78 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 4130, + 4131 + ], + "loc": { + "start": { + "line": 122, + "column": 79 + }, + "end": { + "line": 122, + "column": 80 + } + } + }, + "property": { + "type": "Literal", + "value": 1, + "raw": "1", + "range": [ + 4132, + 4133 + ], + "loc": { + "start": { + "line": 122, + "column": 81 + }, + "end": { + "line": 122, + "column": 82 + } + } + }, + "range": [ + 4130, + 4134 + ], + "loc": { + "start": { + "line": 122, + "column": 79 + }, + "end": { + "line": 122, + "column": 83 + } + } + }, + { + "type": "Identifier", + "name": "resource", + "range": [ + 4136, + 4144 + ], + "loc": { + "start": { + "line": 122, + "column": 85 + }, + "end": { + "line": 122, + "column": 93 + } + } + } + ], + "range": [ + 4120, + 4145 + ], + "loc": { + "start": { + "line": 122, + "column": 69 + }, + "end": { + "line": 122, + "column": 94 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 4115, + 4145 + ], + "loc": { + "start": { + "line": 122, + "column": 64 + }, + "end": { + "line": 122, + "column": 94 + } + } + } + ], + "range": [ + 4061, + 4146 + ], + "loc": { + "start": { + "line": 122, + "column": 10 + }, + "end": { + "line": 122, + "column": 95 + } + } + }, + "range": [ + 4061, + 4147 + ], + "loc": { + "start": { + "line": 122, + "column": 10 + }, + "end": { + "line": 122, + "column": 96 + } + } + } + ], + "range": [ + 4049, + 4157 + ], + "loc": { + "start": { + "line": 121, + "column": 59 + }, + "end": { + "line": 123, + "column": 9 + } + } + }, + "alternate": null, + "range": [ + 3998, + 4157 + ], + "loc": { + "start": { + "line": 121, + "column": 8 + }, + "end": { + "line": 123, + "column": 9 + } + } + } + ], + "range": [ + 3354, + 4165 + ], + "loc": { + "start": { + "line": 109, + "column": 36 + }, + "end": { + "line": 124, + "column": 7 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "TypeError", + "range": [ + 4191, + 4200 + ], + "loc": { + "start": { + "line": 125, + "column": 18 + }, + "end": { + "line": 125, + "column": 27 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "The data must have a type and id", + "cooked": "The data must have a type and id" + }, + "tail": true, + "range": [ + 4201, + 4235 + ], + "loc": { + "start": { + "line": 125, + "column": 28 + }, + "end": { + "line": 125, + "column": 62 + } + } + } + ], + "expressions": [], + "range": [ + 4201, + 4235 + ], + "loc": { + "start": { + "line": 125, + "column": 28 + }, + "end": { + "line": 125, + "column": 62 + } + } + } + ], + "range": [ + 4187, + 4236 + ], + "loc": { + "start": { + "line": 125, + "column": 14 + }, + "end": { + "line": 125, + "column": 63 + } + } + }, + "range": [ + 4181, + 4237 + ], + "loc": { + "start": { + "line": 125, + "column": 8 + }, + "end": { + "line": 125, + "column": 64 + } + } + } + ], + "range": [ + 4171, + 4245 + ], + "loc": { + "start": { + "line": 124, + "column": 13 + }, + "end": { + "line": 126, + "column": 7 + } + } + }, + "range": [ + 3324, + 4245 + ], + "loc": { + "start": { + "line": 109, + "column": 6 + }, + "end": { + "line": 126, + "column": 7 + } + } + } + ], + "range": [ + 3316, + 4251 + ], + "loc": { + "start": { + "line": 108, + "column": 16 + }, + "end": { + "line": 127, + "column": 5 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "TypeError", + "range": [ + 4275, + 4284 + ], + "loc": { + "start": { + "line": 128, + "column": 16 + }, + "end": { + "line": 128, + "column": 25 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "You must provide data to add", + "cooked": "You must provide data to add" + }, + "tail": true, + "range": [ + 4285, + 4315 + ], + "loc": { + "start": { + "line": 128, + "column": 26 + }, + "end": { + "line": 128, + "column": 56 + } + } + } + ], + "expressions": [], + "range": [ + 4285, + 4315 + ], + "loc": { + "start": { + "line": 128, + "column": 26 + }, + "end": { + "line": 128, + "column": 56 + } + } + } + ], + "range": [ + 4271, + 4316 + ], + "loc": { + "start": { + "line": 128, + "column": 12 + }, + "end": { + "line": 128, + "column": 57 + } + } + }, + "range": [ + 4265, + 4317 + ], + "loc": { + "start": { + "line": 128, + "column": 6 + }, + "end": { + "line": 128, + "column": 58 + } + } + } + ], + "range": [ + 4257, + 4323 + ], + "loc": { + "start": { + "line": 127, + "column": 11 + }, + "end": { + "line": 129, + "column": 5 + } + } + }, + "range": [ + 3304, + 4323 + ], + "loc": { + "start": { + "line": 108, + "column": 4 + }, + "end": { + "line": 129, + "column": 5 + } + } + } + ], + "range": [ + 3298, + 4327 + ], + "loc": { + "start": { + "line": 107, + "column": 14 + }, + "end": { + "line": 130, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 3289, + 4327 + ], + "loc": { + "start": { + "line": 107, + "column": 5 + }, + "end": { + "line": 130, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 3286, + 4327 + ], + "loc": { + "start": { + "line": 107, + "column": 2 + }, + "end": { + "line": 130, + "column": 3 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": "*\n * Add an individual resource to the store. This is used internally by the\n * `push()` method.\n *\n * @since 0.1.0\n * @param {!Object} object - Resource Object to add. See:\n http://jsonapi.org/format/#document-resource-objects\n * @return {undefined} - Nothing.\n ", + "range": [ + 2991, + 3283 + ], + "loc": { + "start": { + "line": 98, + "column": 2 + }, + "end": { + "line": 106, + "column": 5 + } + } + } + ], + "trailingComments": [ + { + "type": "Block", + "value": "*\n * Defines a type of resource.\n *\n * @since 0.2.0\n * @param {!string|string[]} names - Name(s) of the resource.\n * @param {!Object} definition - The resource's definition.\n * @return {undefined} - Nothing.\n ", + "range": [ + 4331, + 4558 + ], + "loc": { + "start": { + "line": 132, + "column": 2 + }, + "end": { + "line": 139, + "column": 5 + } + } + } + ], + "static": false + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "define", + "range": [ + 4561, + 4567 + ], + "loc": { + "start": { + "line": 140, + "column": 2 + }, + "end": { + "line": 140, + "column": 8 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "names", + "range": [ + 4568, + 4573 + ], + "loc": { + "start": { + "line": 140, + "column": 9 + }, + "end": { + "line": 140, + "column": 14 + } + } + }, + { + "type": "Identifier", + "name": "definition", + "range": [ + 4575, + 4585 + ], + "loc": { + "start": { + "line": 140, + "column": 16 + }, + "end": { + "line": 140, + "column": 26 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", + "name": "names", + "range": [ + 4593, + 4598 + ], + "loc": { + "start": { + "line": 141, + "column": 4 + }, + "end": { + "line": 141, + "column": 9 + } + } + }, + "right": { + "type": "ConditionalExpression", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "names", + "range": [ + 4602, + 4607 + ], + "loc": { + "start": { + "line": 141, + "column": 13 + }, + "end": { + "line": 141, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "constructor", + "range": [ + 4608, + 4619 + ], + "loc": { + "start": { + "line": 141, + "column": 19 + }, + "end": { + "line": 141, + "column": 30 + } + } + }, + "range": [ + 4602, + 4619 + ], + "loc": { + "start": { + "line": 141, + "column": 13 + }, + "end": { + "line": 141, + "column": 30 + } + } + }, + "right": { + "type": "Identifier", + "name": "Array", + "range": [ + 4624, + 4629 + ], + "loc": { + "start": { + "line": 141, + "column": 35 + }, + "end": { + "line": 141, + "column": 40 + } + } + }, + "range": [ + 4602, + 4629 + ], + "loc": { + "start": { + "line": 141, + "column": 13 + }, + "end": { + "line": 141, + "column": 40 + } + } + }, + "consequent": { + "type": "Identifier", + "name": "names", + "range": [ + 4633, + 4638 + ], + "loc": { + "start": { + "line": 141, + "column": 44 + }, + "end": { + "line": 141, + "column": 49 + } + } + }, + "alternate": { + "type": "ArrayExpression", + "elements": [ + { + "type": "Identifier", + "name": "names", + "range": [ + 4643, + 4648 + ], + "loc": { + "start": { + "line": 141, + "column": 54 + }, + "end": { + "line": 141, + "column": 59 + } + } + } + ], + "range": [ + 4641, + 4650 + ], + "loc": { + "start": { + "line": 141, + "column": 52 + }, + "end": { + "line": 141, + "column": 61 + } + } + }, + "range": [ + 4601, + 4650 + ], + "loc": { + "start": { + "line": 141, + "column": 12 + }, + "end": { + "line": 141, + "column": 61 + } + } + }, + "range": [ + 4593, + 4650 + ], + "loc": { + "start": { + "line": 141, + "column": 4 + }, + "end": { + "line": 141, + "column": 61 + } + } + }, + "range": [ + 4593, + 4651 + ], + "loc": { + "start": { + "line": 141, + "column": 4 + }, + "end": { + "line": 141, + "column": 62 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "definition", + "range": [ + 4656, + 4666 + ], + "loc": { + "start": { + "line": 142, + "column": 4 + }, + "end": { + "line": 142, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "_names", + "range": [ + 4667, + 4673 + ], + "loc": { + "start": { + "line": 142, + "column": 15 + }, + "end": { + "line": 142, + "column": 21 + } + } + }, + "range": [ + 4656, + 4673 + ], + "loc": { + "start": { + "line": 142, + "column": 4 + }, + "end": { + "line": 142, + "column": 21 + } + } + }, + "right": { + "type": "Identifier", + "name": "names", + "range": [ + 4676, + 4681 + ], + "loc": { + "start": { + "line": 142, + "column": 24 + }, + "end": { + "line": 142, + "column": 29 + } + } + }, + "range": [ + 4656, + 4681 + ], + "loc": { + "start": { + "line": 142, + "column": 4 + }, + "end": { + "line": 142, + "column": 29 + } + } + }, + "range": [ + 4656, + 4682 + ], + "loc": { + "start": { + "line": 142, + "column": 4 + }, + "end": { + "line": 142, + "column": 30 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "names", + "range": [ + 4687, + 4692 + ], + "loc": { + "start": { + "line": 143, + "column": 4 + }, + "end": { + "line": 143, + "column": 9 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 4693, + 4700 + ], + "loc": { + "start": { + "line": 143, + "column": 10 + }, + "end": { + "line": 143, + "column": 17 + } + } + }, + "range": [ + 4687, + 4700 + ], + "loc": { + "start": { + "line": 143, + "column": 4 + }, + "end": { + "line": 143, + "column": 17 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "name", + "range": [ + 4701, + 4705 + ], + "loc": { + "start": { + "line": 143, + "column": 18 + }, + "end": { + "line": 143, + "column": 22 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "UnaryExpression", + "operator": "!", + "argument": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 4722, + 4726 + ], + "loc": { + "start": { + "line": 144, + "column": 11 + }, + "end": { + "line": 144, + "column": 15 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 4727, + 4733 + ], + "loc": { + "start": { + "line": 144, + "column": 16 + }, + "end": { + "line": 144, + "column": 22 + } + } + }, + "range": [ + 4722, + 4733 + ], + "loc": { + "start": { + "line": 144, + "column": 11 + }, + "end": { + "line": 144, + "column": 22 + } + } + }, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 4734, + 4738 + ], + "loc": { + "start": { + "line": 144, + "column": 23 + }, + "end": { + "line": 144, + "column": 27 + } + } + }, + "range": [ + 4722, + 4739 + ], + "loc": { + "start": { + "line": 144, + "column": 11 + }, + "end": { + "line": 144, + "column": 28 + } + } + }, + "prefix": true, + "range": [ + 4721, + 4739 + ], + "loc": { + "start": { + "line": 144, + "column": 10 + }, + "end": { + "line": 144, + "column": 28 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 4751, + 4755 + ], + "loc": { + "start": { + "line": 145, + "column": 8 + }, + "end": { + "line": 145, + "column": 12 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 4756, + 4762 + ], + "loc": { + "start": { + "line": 145, + "column": 13 + }, + "end": { + "line": 145, + "column": 19 + } + } + }, + "range": [ + 4751, + 4762 + ], + "loc": { + "start": { + "line": 145, + "column": 8 + }, + "end": { + "line": 145, + "column": 19 + } + } + }, + "property": { + "type": "Identifier", + "name": "name", + "range": [ + 4763, + 4767 + ], + "loc": { + "start": { + "line": 145, + "column": 20 + }, + "end": { + "line": 145, + "column": 24 + } + } + }, + "range": [ + 4751, + 4768 + ], + "loc": { + "start": { + "line": 145, + "column": 8 + }, + "end": { + "line": 145, + "column": 25 + } + } + }, + "right": { + "type": "Identifier", + "name": "definition", + "range": [ + 4771, + 4781 + ], + "loc": { + "start": { + "line": 145, + "column": 28 + }, + "end": { + "line": 145, + "column": 38 + } + } + }, + "range": [ + 4751, + 4781 + ], + "loc": { + "start": { + "line": 145, + "column": 8 + }, + "end": { + "line": 145, + "column": 38 + } + } + }, + "range": [ + 4751, + 4782 + ], + "loc": { + "start": { + "line": 145, + "column": 8 + }, + "end": { + "line": 145, + "column": 39 + } + } + } + ], + "range": [ + 4741, + 4790 + ], + "loc": { + "start": { + "line": 144, + "column": 30 + }, + "end": { + "line": 146, + "column": 7 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "Error", + "range": [ + 4816, + 4821 + ], + "loc": { + "start": { + "line": 147, + "column": 18 + }, + "end": { + "line": 147, + "column": 23 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "The type '", + "cooked": "The type '" + }, + "tail": false, + "range": [ + 4822, + 4835 + ], + "loc": { + "start": { + "line": 147, + "column": 24 + }, + "end": { + "line": 147, + "column": 37 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "' has already been defined.", + "cooked": "' has already been defined." + }, + "tail": true, + "range": [ + 4839, + 4868 + ], + "loc": { + "start": { + "line": 147, + "column": 41 + }, + "end": { + "line": 147, + "column": 70 + } + } + } + ], + "expressions": [ + { + "type": "Identifier", + "name": "name", + "range": [ + 4835, + 4839 + ], + "loc": { + "start": { + "line": 147, + "column": 37 + }, + "end": { + "line": 147, + "column": 41 + } + } + } + ], + "range": [ + 4822, + 4868 + ], + "loc": { + "start": { + "line": 147, + "column": 24 + }, + "end": { + "line": 147, + "column": 70 + } + } + } + ], + "range": [ + 4812, + 4869 + ], + "loc": { + "start": { + "line": 147, + "column": 14 + }, + "end": { + "line": 147, + "column": 71 + } + } + }, + "range": [ + 4806, + 4870 + ], + "loc": { + "start": { + "line": 147, + "column": 8 + }, + "end": { + "line": 147, + "column": 72 + } + } + } + ], + "range": [ + 4796, + 4878 + ], + "loc": { + "start": { + "line": 146, + "column": 13 + }, + "end": { + "line": 148, + "column": 7 + } + } + }, + "range": [ + 4717, + 4878 + ], + "loc": { + "start": { + "line": 144, + "column": 6 + }, + "end": { + "line": 148, + "column": 7 + } + } + } + ], + "range": [ + 4709, + 4884 + ], + "loc": { + "start": { + "line": 143, + "column": 26 + }, + "end": { + "line": 149, + "column": 5 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 4701, + 4884 + ], + "loc": { + "start": { + "line": 143, + "column": 18 + }, + "end": { + "line": 149, + "column": 5 + } + } + } + ], + "range": [ + 4687, + 4885 + ], + "loc": { + "start": { + "line": 143, + "column": 4 + }, + "end": { + "line": 149, + "column": 6 + } + } + }, + "range": [ + 4687, + 4886 + ], + "loc": { + "start": { + "line": 143, + "column": 4 + }, + "end": { + "line": 149, + "column": 7 + } + } + } + ], + "range": [ + 4587, + 4890 + ], + "loc": { + "start": { + "line": 140, + "column": 28 + }, + "end": { + "line": 150, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 4567, + 4890 + ], + "loc": { + "start": { + "line": 140, + "column": 8 + }, + "end": { + "line": 150, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 4561, + 4890 + ], + "loc": { + "start": { + "line": 140, + "column": 2 + }, + "end": { + "line": 150, + "column": 3 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": "*\n * Defines a type of resource.\n *\n * @since 0.2.0\n * @param {!string|string[]} names - Name(s) of the resource.\n * @param {!Object} definition - The resource's definition.\n * @return {undefined} - Nothing.\n ", + "range": [ + 4331, + 4558 + ], + "loc": { + "start": { + "line": 132, + "column": 2 + }, + "end": { + "line": 139, + "column": 5 + } + } + } + ], + "trailingComments": [ + { + "type": "Block", + "value": "*\n * Find a resource or entire collection of resources.\n *\n * NOTE: If the resource hasn't been loaded via an add() or push() call it\n * will be automatically created when find is called.\n *\n * @since 0.1.0\n * @param {!string} type - Type of the resource(s) to find.\n * @param {string} [id] - The id of the resource to find. If omitted all\n * resources of the type will be returned.\n * @return {Object|Object[]} - Either the resource or an array of resources.\n ", + "range": [ + 4894, + 5404 + ], + "loc": { + "start": { + "line": 152, + "column": 2 + }, + "end": { + "line": 163, + "column": 5 + } + } + } + ], + "static": false + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "find", + "range": [ + 5407, + 5411 + ], + "loc": { + "start": { + "line": 164, + "column": 2 + }, + "end": { + "line": 164, + "column": 6 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "type", + "range": [ + 5412, + 5416 + ], + "loc": { + "start": { + "line": 164, + "column": 7 + }, + "end": { + "line": 164, + "column": 11 + } + } + }, + { + "type": "Identifier", + "name": "id", + "range": [ + 5418, + 5420 + ], + "loc": { + "start": { + "line": 164, + "column": 13 + }, + "end": { + "line": 164, + "column": 15 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "type", + "range": [ + 5432, + 5436 + ], + "loc": { + "start": { + "line": 165, + "column": 8 + }, + "end": { + "line": 165, + "column": 12 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "definition", + "range": [ + 5450, + 5460 + ], + "loc": { + "start": { + "line": 166, + "column": 10 + }, + "end": { + "line": 166, + "column": 20 + } + } + }, + "init": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 5463, + 5467 + ], + "loc": { + "start": { + "line": 166, + "column": 23 + }, + "end": { + "line": 166, + "column": 27 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 5468, + 5474 + ], + "loc": { + "start": { + "line": 166, + "column": 28 + }, + "end": { + "line": 166, + "column": 34 + } + } + }, + "range": [ + 5463, + 5474 + ], + "loc": { + "start": { + "line": 166, + "column": 23 + }, + "end": { + "line": 166, + "column": 34 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 5475, + 5479 + ], + "loc": { + "start": { + "line": 166, + "column": 35 + }, + "end": { + "line": 166, + "column": 39 + } + } + }, + "range": [ + 5463, + 5480 + ], + "loc": { + "start": { + "line": 166, + "column": 23 + }, + "end": { + "line": 166, + "column": 40 + } + } + }, + "range": [ + 5450, + 5480 + ], + "loc": { + "start": { + "line": 166, + "column": 10 + }, + "end": { + "line": 166, + "column": 40 + } + } + } + ], + "kind": "let", + "range": [ + 5446, + 5481 + ], + "loc": { + "start": { + "line": 166, + "column": 6 + }, + "end": { + "line": 166, + "column": 41 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "definition", + "range": [ + 5492, + 5502 + ], + "loc": { + "start": { + "line": 167, + "column": 10 + }, + "end": { + "line": 167, + "column": 20 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "UnaryExpression", + "operator": "!", + "argument": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 5519, + 5523 + ], + "loc": { + "start": { + "line": 168, + "column": 13 + }, + "end": { + "line": 168, + "column": 17 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 5524, + 5529 + ], + "loc": { + "start": { + "line": 168, + "column": 18 + }, + "end": { + "line": 168, + "column": 23 + } + } + }, + "range": [ + 5519, + 5529 + ], + "loc": { + "start": { + "line": 168, + "column": 13 + }, + "end": { + "line": 168, + "column": 23 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 5530, + 5534 + ], + "loc": { + "start": { + "line": 168, + "column": 24 + }, + "end": { + "line": 168, + "column": 28 + } + } + }, + "range": [ + 5519, + 5535 + ], + "loc": { + "start": { + "line": 168, + "column": 13 + }, + "end": { + "line": 168, + "column": 29 + } + } + }, + "prefix": true, + "range": [ + 5518, + 5535 + ], + "loc": { + "start": { + "line": 168, + "column": 12 + }, + "end": { + "line": 168, + "column": 29 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "collection", + "range": [ + 5553, + 5563 + ], + "loc": { + "start": { + "line": 169, + "column": 14 + }, + "end": { + "line": 169, + "column": 24 + } + } + }, + "init": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 5566, + 5568 + ], + "loc": { + "start": { + "line": 169, + "column": 27 + }, + "end": { + "line": 169, + "column": 29 + } + } + }, + "range": [ + 5553, + 5568 + ], + "loc": { + "start": { + "line": 169, + "column": 14 + }, + "end": { + "line": 169, + "column": 29 + } + } + } + ], + "kind": "let", + "range": [ + 5549, + 5569 + ], + "loc": { + "start": { + "line": 169, + "column": 10 + }, + "end": { + "line": 169, + "column": 30 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "definition", + "range": [ + 5580, + 5590 + ], + "loc": { + "start": { + "line": 170, + "column": 10 + }, + "end": { + "line": 170, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "_names", + "range": [ + 5591, + 5597 + ], + "loc": { + "start": { + "line": 170, + "column": 21 + }, + "end": { + "line": 170, + "column": 27 + } + } + }, + "range": [ + 5580, + 5597 + ], + "loc": { + "start": { + "line": 170, + "column": 10 + }, + "end": { + "line": 170, + "column": 27 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 5598, + 5605 + ], + "loc": { + "start": { + "line": 170, + "column": 28 + }, + "end": { + "line": 170, + "column": 35 + } + } + }, + "range": [ + 5580, + 5605 + ], + "loc": { + "start": { + "line": 170, + "column": 10 + }, + "end": { + "line": 170, + "column": 35 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "t", + "range": [ + 5606, + 5607 + ], + "loc": { + "start": { + "line": 170, + "column": 36 + }, + "end": { + "line": 170, + "column": 37 + } + } + } + ], + "body": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 5611, + 5615 + ], + "loc": { + "start": { + "line": 170, + "column": 41 + }, + "end": { + "line": 170, + "column": 45 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 5616, + 5621 + ], + "loc": { + "start": { + "line": 170, + "column": 46 + }, + "end": { + "line": 170, + "column": 51 + } + } + }, + "range": [ + 5611, + 5621 + ], + "loc": { + "start": { + "line": 170, + "column": 41 + }, + "end": { + "line": 170, + "column": 51 + } + } + }, + "property": { + "type": "Identifier", + "name": "t", + "range": [ + 5622, + 5623 + ], + "loc": { + "start": { + "line": 170, + "column": 52 + }, + "end": { + "line": 170, + "column": 53 + } + } + }, + "range": [ + 5611, + 5624 + ], + "loc": { + "start": { + "line": 170, + "column": 41 + }, + "end": { + "line": 170, + "column": 54 + } + } + }, + "right": { + "type": "Identifier", + "name": "collection", + "range": [ + 5627, + 5637 + ], + "loc": { + "start": { + "line": 170, + "column": 57 + }, + "end": { + "line": 170, + "column": 67 + } + } + }, + "range": [ + 5611, + 5637 + ], + "loc": { + "start": { + "line": 170, + "column": 41 + }, + "end": { + "line": 170, + "column": 67 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 5606, + 5637 + ], + "loc": { + "start": { + "line": 170, + "column": 36 + }, + "end": { + "line": 170, + "column": 67 + } + } + } + ], + "range": [ + 5580, + 5638 + ], + "loc": { + "start": { + "line": 170, + "column": 10 + }, + "end": { + "line": 170, + "column": 68 + } + } + }, + "range": [ + 5580, + 5639 + ], + "loc": { + "start": { + "line": 170, + "column": 10 + }, + "end": { + "line": 170, + "column": 69 + } + } + } + ], + "range": [ + 5537, + 5649 + ], + "loc": { + "start": { + "line": 168, + "column": 31 + }, + "end": { + "line": 171, + "column": 9 + } + } + }, + "alternate": null, + "range": [ + 5514, + 5649 + ], + "loc": { + "start": { + "line": 168, + "column": 8 + }, + "end": { + "line": 171, + "column": 9 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "id", + "range": [ + 5662, + 5664 + ], + "loc": { + "start": { + "line": 172, + "column": 12 + }, + "end": { + "line": 172, + "column": 14 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "UnaryExpression", + "operator": "!", + "argument": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 5683, + 5687 + ], + "loc": { + "start": { + "line": 173, + "column": 15 + }, + "end": { + "line": 173, + "column": 19 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 5688, + 5693 + ], + "loc": { + "start": { + "line": 173, + "column": 20 + }, + "end": { + "line": 173, + "column": 25 + } + } + }, + "range": [ + 5683, + 5693 + ], + "loc": { + "start": { + "line": 173, + "column": 15 + }, + "end": { + "line": 173, + "column": 25 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 5694, + 5698 + ], + "loc": { + "start": { + "line": 173, + "column": 26 + }, + "end": { + "line": 173, + "column": 30 + } + } + }, + "range": [ + 5683, + 5699 + ], + "loc": { + "start": { + "line": 173, + "column": 15 + }, + "end": { + "line": 173, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 5700, + 5702 + ], + "loc": { + "start": { + "line": 173, + "column": 32 + }, + "end": { + "line": 173, + "column": 34 + } + } + }, + "range": [ + 5683, + 5703 + ], + "loc": { + "start": { + "line": 173, + "column": 15 + }, + "end": { + "line": 173, + "column": 35 + } + } + }, + "prefix": true, + "range": [ + 5682, + 5703 + ], + "loc": { + "start": { + "line": 173, + "column": 14 + }, + "end": { + "line": 173, + "column": 35 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 5719, + 5723 + ], + "loc": { + "start": { + "line": 174, + "column": 12 + }, + "end": { + "line": 174, + "column": 16 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 5724, + 5729 + ], + "loc": { + "start": { + "line": 174, + "column": 17 + }, + "end": { + "line": 174, + "column": 22 + } + } + }, + "range": [ + 5719, + 5729 + ], + "loc": { + "start": { + "line": 174, + "column": 12 + }, + "end": { + "line": 174, + "column": 22 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 5730, + 5734 + ], + "loc": { + "start": { + "line": 174, + "column": 23 + }, + "end": { + "line": 174, + "column": 27 + } + } + }, + "range": [ + 5719, + 5735 + ], + "loc": { + "start": { + "line": 174, + "column": 12 + }, + "end": { + "line": 174, + "column": 28 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 5736, + 5738 + ], + "loc": { + "start": { + "line": 174, + "column": 29 + }, + "end": { + "line": 174, + "column": 31 + } + } + }, + "range": [ + 5719, + 5739 + ], + "loc": { + "start": { + "line": 174, + "column": 12 + }, + "end": { + "line": 174, + "column": 32 + } + } + }, + "right": { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 5758, + 5769 + ], + "loc": { + "start": { + "line": 175, + "column": 14 + }, + "end": { + "line": 175, + "column": 25 + } + } + }, + "value": { + "type": "ArrayExpression", + "elements": [], + "range": [ + 5771, + 5773 + ], + "loc": { + "start": { + "line": 175, + "column": 27 + }, + "end": { + "line": 175, + "column": 29 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 5758, + 5773 + ], + "loc": { + "start": { + "line": 175, + "column": 14 + }, + "end": { + "line": 175, + "column": 29 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "type", + "range": [ + 5789, + 5793 + ], + "loc": { + "start": { + "line": 176, + "column": 14 + }, + "end": { + "line": 176, + "column": 18 + } + } + }, + "value": { + "type": "Identifier", + "name": "type", + "range": [ + 5795, + 5799 + ], + "loc": { + "start": { + "line": 176, + "column": 20 + }, + "end": { + "line": 176, + "column": 24 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 5789, + 5799 + ], + "loc": { + "start": { + "line": 176, + "column": 14 + }, + "end": { + "line": 176, + "column": 24 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "id", + "range": [ + 5815, + 5817 + ], + "loc": { + "start": { + "line": 177, + "column": 14 + }, + "end": { + "line": 177, + "column": 16 + } + } + }, + "value": { + "type": "Identifier", + "name": "id", + "range": [ + 5819, + 5821 + ], + "loc": { + "start": { + "line": 177, + "column": 18 + }, + "end": { + "line": 177, + "column": 20 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 5815, + 5821 + ], + "loc": { + "start": { + "line": 177, + "column": 14 + }, + "end": { + "line": 177, + "column": 20 + } + } + } + ], + "range": [ + 5742, + 5835 + ], + "loc": { + "start": { + "line": 174, + "column": 35 + }, + "end": { + "line": 178, + "column": 13 + } + } + }, + "range": [ + 5719, + 5835 + ], + "loc": { + "start": { + "line": 174, + "column": 12 + }, + "end": { + "line": 178, + "column": 13 + } + } + }, + "range": [ + 5719, + 5836 + ], + "loc": { + "start": { + "line": 174, + "column": 12 + }, + "end": { + "line": 178, + "column": 14 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "Object", + "range": [ + 5849, + 5855 + ], + "loc": { + "start": { + "line": 179, + "column": 12 + }, + "end": { + "line": 179, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "keys", + "range": [ + 5856, + 5860 + ], + "loc": { + "start": { + "line": 179, + "column": 19 + }, + "end": { + "line": 179, + "column": 23 + } + } + }, + "range": [ + 5849, + 5860 + ], + "loc": { + "start": { + "line": 179, + "column": 12 + }, + "end": { + "line": 179, + "column": 23 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "definition", + "range": [ + 5861, + 5871 + ], + "loc": { + "start": { + "line": 179, + "column": 24 + }, + "end": { + "line": 179, + "column": 34 + } + } + } + ], + "range": [ + 5849, + 5872 + ], + "loc": { + "start": { + "line": 179, + "column": 12 + }, + "end": { + "line": 179, + "column": 35 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 5873, + 5880 + ], + "loc": { + "start": { + "line": 179, + "column": 36 + }, + "end": { + "line": 179, + "column": 43 + } + } + }, + "range": [ + 5849, + 5880 + ], + "loc": { + "start": { + "line": 179, + "column": 12 + }, + "end": { + "line": 179, + "column": 43 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "key", + "range": [ + 5881, + 5884 + ], + "loc": { + "start": { + "line": 179, + "column": 44 + }, + "end": { + "line": 179, + "column": 47 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "!==", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "key", + "range": [ + 5908, + 5911 + ], + "loc": { + "start": { + "line": 180, + "column": 18 + }, + "end": { + "line": 180, + "column": 21 + } + } + }, + "property": { + "type": "Literal", + "value": 0, + "raw": "0", + "range": [ + 5912, + 5913 + ], + "loc": { + "start": { + "line": 180, + "column": 22 + }, + "end": { + "line": 180, + "column": 23 + } + } + }, + "range": [ + 5908, + 5914 + ], + "loc": { + "start": { + "line": 180, + "column": 18 + }, + "end": { + "line": 180, + "column": 24 + } + } + }, + "right": { + "type": "Literal", + "value": "_", + "raw": "\"_\"", + "range": [ + 5919, + 5922 + ], + "loc": { + "start": { + "line": 180, + "column": 29 + }, + "end": { + "line": 180, + "column": 32 + } + } + }, + "range": [ + 5908, + 5922 + ], + "loc": { + "start": { + "line": 180, + "column": 18 + }, + "end": { + "line": 180, + "column": 32 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 5942, + 5946 + ], + "loc": { + "start": { + "line": 181, + "column": 16 + }, + "end": { + "line": 181, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 5947, + 5952 + ], + "loc": { + "start": { + "line": 181, + "column": 21 + }, + "end": { + "line": 181, + "column": 26 + } + } + }, + "range": [ + 5942, + 5952 + ], + "loc": { + "start": { + "line": 181, + "column": 16 + }, + "end": { + "line": 181, + "column": 26 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 5953, + 5957 + ], + "loc": { + "start": { + "line": 181, + "column": 27 + }, + "end": { + "line": 181, + "column": 31 + } + } + }, + "range": [ + 5942, + 5958 + ], + "loc": { + "start": { + "line": 181, + "column": 16 + }, + "end": { + "line": 181, + "column": 32 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 5959, + 5961 + ], + "loc": { + "start": { + "line": 181, + "column": 33 + }, + "end": { + "line": 181, + "column": 35 + } + } + }, + "range": [ + 5942, + 5962 + ], + "loc": { + "start": { + "line": 181, + "column": 16 + }, + "end": { + "line": 181, + "column": 36 + } + } + }, + "property": { + "type": "Identifier", + "name": "key", + "range": [ + 5963, + 5966 + ], + "loc": { + "start": { + "line": 181, + "column": 37 + }, + "end": { + "line": 181, + "column": 40 + } + } + }, + "range": [ + 5942, + 5967 + ], + "loc": { + "start": { + "line": 181, + "column": 16 + }, + "end": { + "line": 181, + "column": 41 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "definition", + "range": [ + 5970, + 5980 + ], + "loc": { + "start": { + "line": 181, + "column": 44 + }, + "end": { + "line": 181, + "column": 54 + } + } + }, + "property": { + "type": "Identifier", + "name": "key", + "range": [ + 5981, + 5984 + ], + "loc": { + "start": { + "line": 181, + "column": 55 + }, + "end": { + "line": 181, + "column": 58 + } + } + }, + "range": [ + 5970, + 5985 + ], + "loc": { + "start": { + "line": 181, + "column": 44 + }, + "end": { + "line": 181, + "column": 59 + } + } + }, + "property": { + "type": "Identifier", + "name": "default", + "range": [ + 5986, + 5993 + ], + "loc": { + "start": { + "line": 181, + "column": 60 + }, + "end": { + "line": 181, + "column": 67 + } + } + }, + "range": [ + 5970, + 5993 + ], + "loc": { + "start": { + "line": 181, + "column": 44 + }, + "end": { + "line": 181, + "column": 67 + } + } + }, + "range": [ + 5942, + 5993 + ], + "loc": { + "start": { + "line": 181, + "column": 16 + }, + "end": { + "line": 181, + "column": 67 + } + } + }, + "range": [ + 5942, + 5994 + ], + "loc": { + "start": { + "line": 181, + "column": 16 + }, + "end": { + "line": 181, + "column": 68 + } + } + } + ], + "range": [ + 5924, + 6010 + ], + "loc": { + "start": { + "line": 180, + "column": 34 + }, + "end": { + "line": 182, + "column": 15 + } + } + }, + "alternate": null, + "range": [ + 5904, + 6010 + ], + "loc": { + "start": { + "line": 180, + "column": 14 + }, + "end": { + "line": 182, + "column": 15 + } + } + } + ], + "range": [ + 5888, + 6024 + ], + "loc": { + "start": { + "line": 179, + "column": 51 + }, + "end": { + "line": 183, + "column": 13 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 5881, + 6024 + ], + "loc": { + "start": { + "line": 179, + "column": 44 + }, + "end": { + "line": 183, + "column": 13 + } + } + } + ], + "range": [ + 5849, + 6025 + ], + "loc": { + "start": { + "line": 179, + "column": 12 + }, + "end": { + "line": 183, + "column": 14 + } + } + }, + "range": [ + 5849, + 6026 + ], + "loc": { + "start": { + "line": 179, + "column": 12 + }, + "end": { + "line": 183, + "column": 15 + } + } + } + ], + "range": [ + 5705, + 6038 + ], + "loc": { + "start": { + "line": 173, + "column": 37 + }, + "end": { + "line": 184, + "column": 11 + } + } + }, + "alternate": null, + "range": [ + 5678, + 6038 + ], + "loc": { + "start": { + "line": 173, + "column": 10 + }, + "end": { + "line": 184, + "column": 11 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 6056, + 6060 + ], + "loc": { + "start": { + "line": 185, + "column": 17 + }, + "end": { + "line": 185, + "column": 21 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 6061, + 6066 + ], + "loc": { + "start": { + "line": 185, + "column": 22 + }, + "end": { + "line": 185, + "column": 27 + } + } + }, + "range": [ + 6056, + 6066 + ], + "loc": { + "start": { + "line": 185, + "column": 17 + }, + "end": { + "line": 185, + "column": 27 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 6067, + 6071 + ], + "loc": { + "start": { + "line": 185, + "column": 28 + }, + "end": { + "line": 185, + "column": 32 + } + } + }, + "range": [ + 6056, + 6072 + ], + "loc": { + "start": { + "line": 185, + "column": 17 + }, + "end": { + "line": 185, + "column": 33 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 6073, + 6075 + ], + "loc": { + "start": { + "line": 185, + "column": 34 + }, + "end": { + "line": 185, + "column": 36 + } + } + }, + "range": [ + 6056, + 6076 + ], + "loc": { + "start": { + "line": 185, + "column": 17 + }, + "end": { + "line": 185, + "column": 37 + } + } + }, + "range": [ + 6049, + 6077 + ], + "loc": { + "start": { + "line": 185, + "column": 10 + }, + "end": { + "line": 185, + "column": 38 + } + } + } + ], + "range": [ + 5666, + 6087 + ], + "loc": { + "start": { + "line": 172, + "column": 16 + }, + "end": { + "line": 186, + "column": 9 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "Object", + "range": [ + 6112, + 6118 + ], + "loc": { + "start": { + "line": 187, + "column": 17 + }, + "end": { + "line": 187, + "column": 23 + } + } + }, + "property": { + "type": "Identifier", + "name": "keys", + "range": [ + 6119, + 6123 + ], + "loc": { + "start": { + "line": 187, + "column": 24 + }, + "end": { + "line": 187, + "column": 28 + } + } + }, + "range": [ + 6112, + 6123 + ], + "loc": { + "start": { + "line": 187, + "column": 17 + }, + "end": { + "line": 187, + "column": 28 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 6124, + 6128 + ], + "loc": { + "start": { + "line": 187, + "column": 29 + }, + "end": { + "line": 187, + "column": 33 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 6129, + 6134 + ], + "loc": { + "start": { + "line": 187, + "column": 34 + }, + "end": { + "line": 187, + "column": 39 + } + } + }, + "range": [ + 6124, + 6134 + ], + "loc": { + "start": { + "line": 187, + "column": 29 + }, + "end": { + "line": 187, + "column": 39 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 6135, + 6139 + ], + "loc": { + "start": { + "line": 187, + "column": 40 + }, + "end": { + "line": 187, + "column": 44 + } + } + }, + "range": [ + 6124, + 6140 + ], + "loc": { + "start": { + "line": 187, + "column": 29 + }, + "end": { + "line": 187, + "column": 45 + } + } + } + ], + "range": [ + 6112, + 6141 + ], + "loc": { + "start": { + "line": 187, + "column": 17 + }, + "end": { + "line": 187, + "column": 46 + } + } + }, + "property": { + "type": "Identifier", + "name": "map", + "range": [ + 6142, + 6145 + ], + "loc": { + "start": { + "line": 187, + "column": 47 + }, + "end": { + "line": 187, + "column": 50 + } + } + }, + "range": [ + 6112, + 6145 + ], + "loc": { + "start": { + "line": 187, + "column": 17 + }, + "end": { + "line": 187, + "column": 50 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 6146, + 6147 + ], + "loc": { + "start": { + "line": 187, + "column": 51 + }, + "end": { + "line": 187, + "column": 52 + } + } + } + ], + "body": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 6151, + 6155 + ], + "loc": { + "start": { + "line": 187, + "column": 56 + }, + "end": { + "line": 187, + "column": 60 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 6156, + 6161 + ], + "loc": { + "start": { + "line": 187, + "column": 61 + }, + "end": { + "line": 187, + "column": 66 + } + } + }, + "range": [ + 6151, + 6161 + ], + "loc": { + "start": { + "line": 187, + "column": 56 + }, + "end": { + "line": 187, + "column": 66 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 6162, + 6166 + ], + "loc": { + "start": { + "line": 187, + "column": 67 + }, + "end": { + "line": 187, + "column": 71 + } + } + }, + "range": [ + 6151, + 6167 + ], + "loc": { + "start": { + "line": 187, + "column": 56 + }, + "end": { + "line": 187, + "column": 72 + } + } + }, + "property": { + "type": "Identifier", + "name": "x", + "range": [ + 6168, + 6169 + ], + "loc": { + "start": { + "line": 187, + "column": 73 + }, + "end": { + "line": 187, + "column": 74 + } + } + }, + "range": [ + 6151, + 6170 + ], + "loc": { + "start": { + "line": 187, + "column": 56 + }, + "end": { + "line": 187, + "column": 75 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 6146, + 6170 + ], + "loc": { + "start": { + "line": 187, + "column": 51 + }, + "end": { + "line": 187, + "column": 75 + } + } + } + ], + "range": [ + 6112, + 6171 + ], + "loc": { + "start": { + "line": 187, + "column": 17 + }, + "end": { + "line": 187, + "column": 76 + } + } + }, + "range": [ + 6105, + 6172 + ], + "loc": { + "start": { + "line": 187, + "column": 10 + }, + "end": { + "line": 187, + "column": 77 + } + } + } + ], + "range": [ + 6093, + 6182 + ], + "loc": { + "start": { + "line": 186, + "column": 15 + }, + "end": { + "line": 188, + "column": 9 + } + } + }, + "range": [ + 5658, + 6182 + ], + "loc": { + "start": { + "line": 172, + "column": 8 + }, + "end": { + "line": 188, + "column": 9 + } + } + } + ], + "range": [ + 5504, + 6190 + ], + "loc": { + "start": { + "line": 167, + "column": 22 + }, + "end": { + "line": 189, + "column": 7 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "TypeError", + "range": [ + 6216, + 6225 + ], + "loc": { + "start": { + "line": 190, + "column": 18 + }, + "end": { + "line": 190, + "column": 27 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "Unknown type '", + "cooked": "Unknown type '" + }, + "tail": false, + "range": [ + 6226, + 6243 + ], + "loc": { + "start": { + "line": 190, + "column": 28 + }, + "end": { + "line": 190, + "column": 45 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "'", + "cooked": "'" + }, + "tail": true, + "range": [ + 6247, + 6250 + ], + "loc": { + "start": { + "line": 190, + "column": 49 + }, + "end": { + "line": 190, + "column": 52 + } + } + } + ], + "expressions": [ + { + "type": "Identifier", + "name": "type", + "range": [ + 6243, + 6247 + ], + "loc": { + "start": { + "line": 190, + "column": 45 + }, + "end": { + "line": 190, + "column": 49 + } + } + } + ], + "range": [ + 6226, + 6250 + ], + "loc": { + "start": { + "line": 190, + "column": 28 + }, + "end": { + "line": 190, + "column": 52 + } + } + } + ], + "range": [ + 6212, + 6251 + ], + "loc": { + "start": { + "line": 190, + "column": 14 + }, + "end": { + "line": 190, + "column": 53 + } + } + }, + "range": [ + 6206, + 6252 + ], + "loc": { + "start": { + "line": 190, + "column": 8 + }, + "end": { + "line": 190, + "column": 54 + } + } + } + ], + "range": [ + 6196, + 6260 + ], + "loc": { + "start": { + "line": 189, + "column": 13 + }, + "end": { + "line": 191, + "column": 7 + } + } + }, + "range": [ + 5488, + 6260 + ], + "loc": { + "start": { + "line": 167, + "column": 6 + }, + "end": { + "line": 191, + "column": 7 + } + } + } + ], + "range": [ + 5438, + 6266 + ], + "loc": { + "start": { + "line": 165, + "column": 14 + }, + "end": { + "line": 192, + "column": 5 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "TypeError", + "range": [ + 6290, + 6299 + ], + "loc": { + "start": { + "line": 193, + "column": 16 + }, + "end": { + "line": 193, + "column": 25 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "You must provide a type", + "cooked": "You must provide a type" + }, + "tail": true, + "range": [ + 6300, + 6325 + ], + "loc": { + "start": { + "line": 193, + "column": 26 + }, + "end": { + "line": 193, + "column": 51 + } + } + } + ], + "expressions": [], + "range": [ + 6300, + 6325 + ], + "loc": { + "start": { + "line": 193, + "column": 26 + }, + "end": { + "line": 193, + "column": 51 + } + } + } + ], + "range": [ + 6286, + 6326 + ], + "loc": { + "start": { + "line": 193, + "column": 12 + }, + "end": { + "line": 193, + "column": 52 + } + } + }, + "range": [ + 6280, + 6327 + ], + "loc": { + "start": { + "line": 193, + "column": 6 + }, + "end": { + "line": 193, + "column": 53 + } + } + } + ], + "range": [ + 6272, + 6333 + ], + "loc": { + "start": { + "line": 192, + "column": 11 + }, + "end": { + "line": 194, + "column": 5 + } + } + }, + "range": [ + 5428, + 6333 + ], + "loc": { + "start": { + "line": 165, + "column": 4 + }, + "end": { + "line": 194, + "column": 5 + } + } + } + ], + "range": [ + 5422, + 6337 + ], + "loc": { + "start": { + "line": 164, + "column": 17 + }, + "end": { + "line": 195, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 5411, + 6337 + ], + "loc": { + "start": { + "line": 164, + "column": 6 + }, + "end": { + "line": 195, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 5407, + 6337 + ], + "loc": { + "start": { + "line": 164, + "column": 2 + }, + "end": { + "line": 195, + "column": 3 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": "*\n * Find a resource or entire collection of resources.\n *\n * NOTE: If the resource hasn't been loaded via an add() or push() call it\n * will be automatically created when find is called.\n *\n * @since 0.1.0\n * @param {!string} type - Type of the resource(s) to find.\n * @param {string} [id] - The id of the resource to find. If omitted all\n * resources of the type will be returned.\n * @return {Object|Object[]} - Either the resource or an array of resources.\n ", + "range": [ + 4894, + 5404 + ], + "loc": { + "start": { + "line": 152, + "column": 2 + }, + "end": { + "line": 163, + "column": 5 + } + } + } + ], + "trailingComments": [ + { + "type": "Block", + "value": "*\n * Unregister an event listener that was registered with on().\n *\n * @since 0.4.0\n * @param {string} event - Name of the event.\n * @param {string} type - Name of resource to originally passed to on().\n * @param {string} [id] - ID of the resource to originally passed to on().\n * @param {function} callback - Function originally passed to on().\n * @return {undefined} - Nothing.\n ", + "range": [ + 6341, + 6744 + ], + "loc": { + "start": { + "line": 197, + "column": 2 + }, + "end": { + "line": 206, + "column": 5 + } + } + } + ], + "static": false + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "off", + "range": [ + 6747, + 6750 + ], + "loc": { + "start": { + "line": 207, + "column": 2 + }, + "end": { + "line": 207, + "column": 5 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "event", + "range": [ + 6751, + 6756 + ], + "loc": { + "start": { + "line": 207, + "column": 6 + }, + "end": { + "line": 207, + "column": 11 + } + } + }, + { + "type": "Identifier", + "name": "type", + "range": [ + 6758, + 6762 + ], + "loc": { + "start": { + "line": 207, + "column": 13 + }, + "end": { + "line": 207, + "column": 17 + } + } + }, + { + "type": "Identifier", + "name": "id", + "range": [ + 6764, + 6766 + ], + "loc": { + "start": { + "line": 207, + "column": 19 + }, + "end": { + "line": 207, + "column": 21 + } + } + }, + { + "type": "Identifier", + "name": "callback", + "range": [ + 6768, + 6776 + ], + "loc": { + "start": { + "line": 207, + "column": 23 + }, + "end": { + "line": 207, + "column": 31 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 6788, + 6792 + ], + "loc": { + "start": { + "line": 208, + "column": 8 + }, + "end": { + "line": 208, + "column": 12 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 6793, + 6811 + ], + "loc": { + "start": { + "line": 208, + "column": 13 + }, + "end": { + "line": 208, + "column": 31 + } + } + }, + "range": [ + 6788, + 6811 + ], + "loc": { + "start": { + "line": 208, + "column": 8 + }, + "end": { + "line": 208, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 6812, + 6817 + ], + "loc": { + "start": { + "line": 208, + "column": 32 + }, + "end": { + "line": 208, + "column": 37 + } + } + }, + "range": [ + 6788, + 6818 + ], + "loc": { + "start": { + "line": 208, + "column": 8 + }, + "end": { + "line": 208, + "column": 38 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 6822, + 6826 + ], + "loc": { + "start": { + "line": 208, + "column": 42 + }, + "end": { + "line": 208, + "column": 46 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 6827, + 6847 + ], + "loc": { + "start": { + "line": 208, + "column": 47 + }, + "end": { + "line": 208, + "column": 67 + } + } + }, + "range": [ + 6822, + 6847 + ], + "loc": { + "start": { + "line": 208, + "column": 42 + }, + "end": { + "line": 208, + "column": 67 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 6848, + 6853 + ], + "loc": { + "start": { + "line": 208, + "column": 68 + }, + "end": { + "line": 208, + "column": 73 + } + } + }, + "range": [ + 6822, + 6854 + ], + "loc": { + "start": { + "line": 208, + "column": 42 + }, + "end": { + "line": 208, + "column": 74 + } + } + }, + "range": [ + 6788, + 6854 + ], + "loc": { + "start": { + "line": 208, + "column": 8 + }, + "end": { + "line": 208, + "column": 74 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 6868, + 6872 + ], + "loc": { + "start": { + "line": 209, + "column": 10 + }, + "end": { + "line": 209, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 6873, + 6879 + ], + "loc": { + "start": { + "line": 209, + "column": 15 + }, + "end": { + "line": 209, + "column": 21 + } + } + }, + "range": [ + 6868, + 6879 + ], + "loc": { + "start": { + "line": 209, + "column": 10 + }, + "end": { + "line": 209, + "column": 21 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 6880, + 6884 + ], + "loc": { + "start": { + "line": 209, + "column": 22 + }, + "end": { + "line": 209, + "column": 26 + } + } + }, + "range": [ + 6868, + 6885 + ], + "loc": { + "start": { + "line": 209, + "column": 10 + }, + "end": { + "line": 209, + "column": 27 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "Identifier", + "name": "id", + "range": [ + 6901, + 6903 + ], + "loc": { + "start": { + "line": 210, + "column": 12 + }, + "end": { + "line": 210, + "column": 14 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 6908, + 6910 + ], + "loc": { + "start": { + "line": 210, + "column": 19 + }, + "end": { + "line": 210, + "column": 21 + } + } + }, + "property": { + "type": "Identifier", + "name": "toString", + "range": [ + 6912, + 6920 + ], + "loc": { + "start": { + "line": 210, + "column": 23 + }, + "end": { + "line": 210, + "column": 31 + } + } + }, + "range": [ + 6907, + 6920 + ], + "loc": { + "start": { + "line": 210, + "column": 18 + }, + "end": { + "line": 210, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "name": "call", + "range": [ + 6921, + 6925 + ], + "loc": { + "start": { + "line": 210, + "column": 32 + }, + "end": { + "line": 210, + "column": 36 + } + } + }, + "range": [ + 6907, + 6925 + ], + "loc": { + "start": { + "line": 210, + "column": 18 + }, + "end": { + "line": 210, + "column": 36 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "id", + "range": [ + 6926, + 6928 + ], + "loc": { + "start": { + "line": 210, + "column": 37 + }, + "end": { + "line": 210, + "column": 39 + } + } + } + ], + "range": [ + 6907, + 6929 + ], + "loc": { + "start": { + "line": 210, + "column": 18 + }, + "end": { + "line": 210, + "column": 40 + } + } + }, + "right": { + "type": "Literal", + "value": "[object Function]", + "raw": "'[object Function]'", + "range": [ + 6934, + 6953 + ], + "loc": { + "start": { + "line": 210, + "column": 45 + }, + "end": { + "line": 210, + "column": 64 + } + } + }, + "range": [ + 6907, + 6953 + ], + "loc": { + "start": { + "line": 210, + "column": 18 + }, + "end": { + "line": 210, + "column": 64 + } + } + }, + "range": [ + 6901, + 6953 + ], + "loc": { + "start": { + "line": 210, + "column": 12 + }, + "end": { + "line": 210, + "column": 64 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 6967, + 6971 + ], + "loc": { + "start": { + "line": 211, + "column": 10 + }, + "end": { + "line": 211, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "off", + "range": [ + 6972, + 6975 + ], + "loc": { + "start": { + "line": 211, + "column": 15 + }, + "end": { + "line": 211, + "column": 18 + } + } + }, + "range": [ + 6967, + 6975 + ], + "loc": { + "start": { + "line": 211, + "column": 10 + }, + "end": { + "line": 211, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "call", + "range": [ + 6976, + 6980 + ], + "loc": { + "start": { + "line": 211, + "column": 19 + }, + "end": { + "line": 211, + "column": 23 + } + } + }, + "range": [ + 6967, + 6980 + ], + "loc": { + "start": { + "line": 211, + "column": 10 + }, + "end": { + "line": 211, + "column": 23 + } + } + }, + "arguments": [ + { + "type": "ThisExpression", + "range": [ + 6981, + 6985 + ], + "loc": { + "start": { + "line": 211, + "column": 24 + }, + "end": { + "line": 211, + "column": 28 + } + } + }, + { + "type": "Identifier", + "name": "event", + "range": [ + 6987, + 6992 + ], + "loc": { + "start": { + "line": 211, + "column": 30 + }, + "end": { + "line": 211, + "column": 35 + } + } + }, + { + "type": "Identifier", + "name": "type", + "range": [ + 6994, + 6998 + ], + "loc": { + "start": { + "line": 211, + "column": 37 + }, + "end": { + "line": 211, + "column": 41 + } + } + }, + { + "type": "Literal", + "value": null, + "raw": "null", + "range": [ + 7000, + 7004 + ], + "loc": { + "start": { + "line": 211, + "column": 43 + }, + "end": { + "line": 211, + "column": 47 + } + } + }, + { + "type": "Identifier", + "name": "id", + "range": [ + 7006, + 7008 + ], + "loc": { + "start": { + "line": 211, + "column": 49 + }, + "end": { + "line": 211, + "column": 51 + } + } + }, + { + "type": "Identifier", + "name": "callback", + "range": [ + 7010, + 7018 + ], + "loc": { + "start": { + "line": 211, + "column": 53 + }, + "end": { + "line": 211, + "column": 61 + } + } + } + ], + "range": [ + 6967, + 7019 + ], + "loc": { + "start": { + "line": 211, + "column": 10 + }, + "end": { + "line": 211, + "column": 62 + } + } + }, + "range": [ + 6967, + 7020 + ], + "loc": { + "start": { + "line": 211, + "column": 10 + }, + "end": { + "line": 211, + "column": 63 + } + } + } + ], + "range": [ + 6955, + 7030 + ], + "loc": { + "start": { + "line": 210, + "column": 66 + }, + "end": { + "line": 212, + "column": 9 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 7168, + 7172 + ], + "loc": { + "start": { + "line": 214, + "column": 10 + }, + "end": { + "line": 214, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 7173, + 7179 + ], + "loc": { + "start": { + "line": 214, + "column": 15 + }, + "end": { + "line": 214, + "column": 21 + } + } + }, + "range": [ + 7168, + 7179 + ], + "loc": { + "start": { + "line": 214, + "column": 10 + }, + "end": { + "line": 214, + "column": 21 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 7180, + 7184 + ], + "loc": { + "start": { + "line": 214, + "column": 22 + }, + "end": { + "line": 214, + "column": 26 + } + } + }, + "range": [ + 7168, + 7185 + ], + "loc": { + "start": { + "line": 214, + "column": 10 + }, + "end": { + "line": 214, + "column": 27 + } + } + }, + "property": { + "type": "Identifier", + "name": "_names", + "range": [ + 7186, + 7192 + ], + "loc": { + "start": { + "line": 214, + "column": 28 + }, + "end": { + "line": 214, + "column": 34 + } + } + }, + "range": [ + 7168, + 7192 + ], + "loc": { + "start": { + "line": 214, + "column": 10 + }, + "end": { + "line": 214, + "column": 34 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 7193, + 7200 + ], + "loc": { + "start": { + "line": 214, + "column": 35 + }, + "end": { + "line": 214, + "column": 42 + } + } + }, + "range": [ + 7168, + 7200 + ], + "loc": { + "start": { + "line": 214, + "column": 10 + }, + "end": { + "line": 214, + "column": 42 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "type", + "range": [ + 7201, + 7205 + ], + "loc": { + "start": { + "line": 214, + "column": 43 + }, + "end": { + "line": 214, + "column": 47 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "id", + "range": [ + 7227, + 7229 + ], + "loc": { + "start": { + "line": 215, + "column": 16 + }, + "end": { + "line": 215, + "column": 18 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 7251, + 7255 + ], + "loc": { + "start": { + "line": 216, + "column": 18 + }, + "end": { + "line": 216, + "column": 22 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 7256, + 7274 + ], + "loc": { + "start": { + "line": 216, + "column": 23 + }, + "end": { + "line": 216, + "column": 41 + } + } + }, + "range": [ + 7251, + 7274 + ], + "loc": { + "start": { + "line": 216, + "column": 18 + }, + "end": { + "line": 216, + "column": 41 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 7275, + 7280 + ], + "loc": { + "start": { + "line": 216, + "column": 42 + }, + "end": { + "line": 216, + "column": 47 + } + } + }, + "range": [ + 7251, + 7281 + ], + "loc": { + "start": { + "line": 216, + "column": 18 + }, + "end": { + "line": 216, + "column": 48 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 7282, + 7286 + ], + "loc": { + "start": { + "line": 216, + "column": 49 + }, + "end": { + "line": 216, + "column": 53 + } + } + }, + "range": [ + 7251, + 7287 + ], + "loc": { + "start": { + "line": 216, + "column": 18 + }, + "end": { + "line": 216, + "column": 54 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 7291, + 7295 + ], + "loc": { + "start": { + "line": 216, + "column": 58 + }, + "end": { + "line": 216, + "column": 62 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 7296, + 7314 + ], + "loc": { + "start": { + "line": 216, + "column": 63 + }, + "end": { + "line": 216, + "column": 81 + } + } + }, + "range": [ + 7291, + 7314 + ], + "loc": { + "start": { + "line": 216, + "column": 58 + }, + "end": { + "line": 216, + "column": 81 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 7315, + 7320 + ], + "loc": { + "start": { + "line": 216, + "column": 82 + }, + "end": { + "line": 216, + "column": 87 + } + } + }, + "range": [ + 7291, + 7321 + ], + "loc": { + "start": { + "line": 216, + "column": 58 + }, + "end": { + "line": 216, + "column": 88 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 7322, + 7326 + ], + "loc": { + "start": { + "line": 216, + "column": 89 + }, + "end": { + "line": 216, + "column": 93 + } + } + }, + "range": [ + 7291, + 7327 + ], + "loc": { + "start": { + "line": 216, + "column": 58 + }, + "end": { + "line": 216, + "column": 94 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 7328, + 7330 + ], + "loc": { + "start": { + "line": 216, + "column": 95 + }, + "end": { + "line": 216, + "column": 97 + } + } + }, + "range": [ + 7291, + 7331 + ], + "loc": { + "start": { + "line": 216, + "column": 58 + }, + "end": { + "line": 216, + "column": 98 + } + } + }, + "range": [ + 7251, + 7331 + ], + "loc": { + "start": { + "line": 216, + "column": 18 + }, + "end": { + "line": 216, + "column": 98 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 7351, + 7355 + ], + "loc": { + "start": { + "line": 217, + "column": 16 + }, + "end": { + "line": 217, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 7356, + 7374 + ], + "loc": { + "start": { + "line": 217, + "column": 21 + }, + "end": { + "line": 217, + "column": 39 + } + } + }, + "range": [ + 7351, + 7374 + ], + "loc": { + "start": { + "line": 217, + "column": 16 + }, + "end": { + "line": 217, + "column": 39 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 7375, + 7380 + ], + "loc": { + "start": { + "line": 217, + "column": 40 + }, + "end": { + "line": 217, + "column": 45 + } + } + }, + "range": [ + 7351, + 7381 + ], + "loc": { + "start": { + "line": 217, + "column": 16 + }, + "end": { + "line": 217, + "column": 46 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 7382, + 7386 + ], + "loc": { + "start": { + "line": 217, + "column": 47 + }, + "end": { + "line": 217, + "column": 51 + } + } + }, + "range": [ + 7351, + 7387 + ], + "loc": { + "start": { + "line": 217, + "column": 16 + }, + "end": { + "line": 217, + "column": 52 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 7388, + 7390 + ], + "loc": { + "start": { + "line": 217, + "column": 53 + }, + "end": { + "line": 217, + "column": 55 + } + } + }, + "range": [ + 7351, + 7391 + ], + "loc": { + "start": { + "line": 217, + "column": 16 + }, + "end": { + "line": 217, + "column": 56 + } + } + }, + "right": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 7394, + 7398 + ], + "loc": { + "start": { + "line": 217, + "column": 59 + }, + "end": { + "line": 217, + "column": 63 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 7399, + 7417 + ], + "loc": { + "start": { + "line": 217, + "column": 64 + }, + "end": { + "line": 217, + "column": 82 + } + } + }, + "range": [ + 7394, + 7417 + ], + "loc": { + "start": { + "line": 217, + "column": 59 + }, + "end": { + "line": 217, + "column": 82 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 7418, + 7423 + ], + "loc": { + "start": { + "line": 217, + "column": 83 + }, + "end": { + "line": 217, + "column": 88 + } + } + }, + "range": [ + 7394, + 7424 + ], + "loc": { + "start": { + "line": 217, + "column": 59 + }, + "end": { + "line": 217, + "column": 89 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 7425, + 7429 + ], + "loc": { + "start": { + "line": 217, + "column": 90 + }, + "end": { + "line": 217, + "column": 94 + } + } + }, + "range": [ + 7394, + 7430 + ], + "loc": { + "start": { + "line": 217, + "column": 59 + }, + "end": { + "line": 217, + "column": 95 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 7431, + 7433 + ], + "loc": { + "start": { + "line": 217, + "column": 96 + }, + "end": { + "line": 217, + "column": 98 + } + } + }, + "range": [ + 7394, + 7434 + ], + "loc": { + "start": { + "line": 217, + "column": 59 + }, + "end": { + "line": 217, + "column": 99 + } + } + }, + "property": { + "type": "Identifier", + "name": "filter", + "range": [ + 7435, + 7441 + ], + "loc": { + "start": { + "line": 217, + "column": 100 + }, + "end": { + "line": 217, + "column": 106 + } + } + }, + "range": [ + 7394, + 7441 + ], + "loc": { + "start": { + "line": 217, + "column": 59 + }, + "end": { + "line": 217, + "column": 106 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 7442, + 7443 + ], + "loc": { + "start": { + "line": 217, + "column": 107 + }, + "end": { + "line": 217, + "column": 108 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "BinaryExpression", + "operator": "!==", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 7474, + 7475 + ], + "loc": { + "start": { + "line": 218, + "column": 25 + }, + "end": { + "line": 218, + "column": 26 + } + } + }, + "property": { + "type": "Literal", + "value": 0, + "raw": "0", + "range": [ + 7476, + 7477 + ], + "loc": { + "start": { + "line": 218, + "column": 27 + }, + "end": { + "line": 218, + "column": 28 + } + } + }, + "range": [ + 7474, + 7478 + ], + "loc": { + "start": { + "line": 218, + "column": 25 + }, + "end": { + "line": 218, + "column": 29 + } + } + }, + "right": { + "type": "Identifier", + "name": "callback", + "range": [ + 7483, + 7491 + ], + "loc": { + "start": { + "line": 218, + "column": 34 + }, + "end": { + "line": 218, + "column": 42 + } + } + }, + "range": [ + 7474, + 7491 + ], + "loc": { + "start": { + "line": 218, + "column": 25 + }, + "end": { + "line": 218, + "column": 42 + } + } + }, + "range": [ + 7467, + 7492 + ], + "loc": { + "start": { + "line": 218, + "column": 18 + }, + "end": { + "line": 218, + "column": 43 + } + } + } + ], + "range": [ + 7447, + 7510 + ], + "loc": { + "start": { + "line": 217, + "column": 112 + }, + "end": { + "line": 219, + "column": 17 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 7442, + 7510 + ], + "loc": { + "start": { + "line": 217, + "column": 107 + }, + "end": { + "line": 219, + "column": 17 + } + } + } + ], + "range": [ + 7394, + 7511 + ], + "loc": { + "start": { + "line": 217, + "column": 59 + }, + "end": { + "line": 219, + "column": 18 + } + } + }, + "range": [ + 7351, + 7511 + ], + "loc": { + "start": { + "line": 217, + "column": 16 + }, + "end": { + "line": 219, + "column": 18 + } + } + }, + "range": [ + 7351, + 7512 + ], + "loc": { + "start": { + "line": 217, + "column": 16 + }, + "end": { + "line": 219, + "column": 19 + } + } + } + ], + "range": [ + 7333, + 7528 + ], + "loc": { + "start": { + "line": 216, + "column": 100 + }, + "end": { + "line": 220, + "column": 15 + } + } + }, + "alternate": null, + "range": [ + 7247, + 7528 + ], + "loc": { + "start": { + "line": 216, + "column": 14 + }, + "end": { + "line": 220, + "column": 15 + } + } + } + ], + "range": [ + 7231, + 7542 + ], + "loc": { + "start": { + "line": 215, + "column": 20 + }, + "end": { + "line": 221, + "column": 13 + } + } + }, + "alternate": { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 7552, + 7556 + ], + "loc": { + "start": { + "line": 221, + "column": 23 + }, + "end": { + "line": 221, + "column": 27 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 7557, + 7577 + ], + "loc": { + "start": { + "line": 221, + "column": 28 + }, + "end": { + "line": 221, + "column": 48 + } + } + }, + "range": [ + 7552, + 7577 + ], + "loc": { + "start": { + "line": 221, + "column": 23 + }, + "end": { + "line": 221, + "column": 48 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 7578, + 7583 + ], + "loc": { + "start": { + "line": 221, + "column": 49 + }, + "end": { + "line": 221, + "column": 54 + } + } + }, + "range": [ + 7552, + 7584 + ], + "loc": { + "start": { + "line": 221, + "column": 23 + }, + "end": { + "line": 221, + "column": 55 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 7585, + 7589 + ], + "loc": { + "start": { + "line": 221, + "column": 56 + }, + "end": { + "line": 221, + "column": 60 + } + } + }, + "range": [ + 7552, + 7590 + ], + "loc": { + "start": { + "line": 221, + "column": 23 + }, + "end": { + "line": 221, + "column": 61 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 7608, + 7612 + ], + "loc": { + "start": { + "line": 222, + "column": 14 + }, + "end": { + "line": 222, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 7613, + 7633 + ], + "loc": { + "start": { + "line": 222, + "column": 19 + }, + "end": { + "line": 222, + "column": 39 + } + } + }, + "range": [ + 7608, + 7633 + ], + "loc": { + "start": { + "line": 222, + "column": 14 + }, + "end": { + "line": 222, + "column": 39 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 7634, + 7639 + ], + "loc": { + "start": { + "line": 222, + "column": 40 + }, + "end": { + "line": 222, + "column": 45 + } + } + }, + "range": [ + 7608, + 7640 + ], + "loc": { + "start": { + "line": 222, + "column": 14 + }, + "end": { + "line": 222, + "column": 46 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 7641, + 7645 + ], + "loc": { + "start": { + "line": 222, + "column": 47 + }, + "end": { + "line": 222, + "column": 51 + } + } + }, + "range": [ + 7608, + 7646 + ], + "loc": { + "start": { + "line": 222, + "column": 14 + }, + "end": { + "line": 222, + "column": 52 + } + } + }, + "right": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 7649, + 7653 + ], + "loc": { + "start": { + "line": 222, + "column": 55 + }, + "end": { + "line": 222, + "column": 59 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 7654, + 7674 + ], + "loc": { + "start": { + "line": 222, + "column": 60 + }, + "end": { + "line": 222, + "column": 80 + } + } + }, + "range": [ + 7649, + 7674 + ], + "loc": { + "start": { + "line": 222, + "column": 55 + }, + "end": { + "line": 222, + "column": 80 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 7675, + 7680 + ], + "loc": { + "start": { + "line": 222, + "column": 81 + }, + "end": { + "line": 222, + "column": 86 + } + } + }, + "range": [ + 7649, + 7681 + ], + "loc": { + "start": { + "line": 222, + "column": 55 + }, + "end": { + "line": 222, + "column": 87 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 7682, + 7686 + ], + "loc": { + "start": { + "line": 222, + "column": 88 + }, + "end": { + "line": 222, + "column": 92 + } + } + }, + "range": [ + 7649, + 7687 + ], + "loc": { + "start": { + "line": 222, + "column": 55 + }, + "end": { + "line": 222, + "column": 93 + } + } + }, + "property": { + "type": "Identifier", + "name": "filter", + "range": [ + 7688, + 7694 + ], + "loc": { + "start": { + "line": 222, + "column": 94 + }, + "end": { + "line": 222, + "column": 100 + } + } + }, + "range": [ + 7649, + 7694 + ], + "loc": { + "start": { + "line": 222, + "column": 55 + }, + "end": { + "line": 222, + "column": 100 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 7695, + 7696 + ], + "loc": { + "start": { + "line": 222, + "column": 101 + }, + "end": { + "line": 222, + "column": 102 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "BinaryExpression", + "operator": "!==", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 7725, + 7726 + ], + "loc": { + "start": { + "line": 223, + "column": 23 + }, + "end": { + "line": 223, + "column": 24 + } + } + }, + "property": { + "type": "Literal", + "value": 0, + "raw": "0", + "range": [ + 7727, + 7728 + ], + "loc": { + "start": { + "line": 223, + "column": 25 + }, + "end": { + "line": 223, + "column": 26 + } + } + }, + "range": [ + 7725, + 7729 + ], + "loc": { + "start": { + "line": 223, + "column": 23 + }, + "end": { + "line": 223, + "column": 27 + } + } + }, + "right": { + "type": "Identifier", + "name": "callback", + "range": [ + 7734, + 7742 + ], + "loc": { + "start": { + "line": 223, + "column": 32 + }, + "end": { + "line": 223, + "column": 40 + } + } + }, + "range": [ + 7725, + 7742 + ], + "loc": { + "start": { + "line": 223, + "column": 23 + }, + "end": { + "line": 223, + "column": 40 + } + } + }, + "range": [ + 7718, + 7743 + ], + "loc": { + "start": { + "line": 223, + "column": 16 + }, + "end": { + "line": 223, + "column": 41 + } + } + } + ], + "range": [ + 7700, + 7759 + ], + "loc": { + "start": { + "line": 222, + "column": 106 + }, + "end": { + "line": 224, + "column": 15 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 7695, + 7759 + ], + "loc": { + "start": { + "line": 222, + "column": 101 + }, + "end": { + "line": 224, + "column": 15 + } + } + } + ], + "range": [ + 7649, + 7760 + ], + "loc": { + "start": { + "line": 222, + "column": 55 + }, + "end": { + "line": 224, + "column": 16 + } + } + }, + "range": [ + 7608, + 7760 + ], + "loc": { + "start": { + "line": 222, + "column": 14 + }, + "end": { + "line": 224, + "column": 16 + } + } + }, + "range": [ + 7608, + 7761 + ], + "loc": { + "start": { + "line": 222, + "column": 14 + }, + "end": { + "line": 224, + "column": 17 + } + } + } + ], + "range": [ + 7592, + 7775 + ], + "loc": { + "start": { + "line": 221, + "column": 63 + }, + "end": { + "line": 225, + "column": 13 + } + } + }, + "alternate": null, + "range": [ + 7548, + 7775 + ], + "loc": { + "start": { + "line": 221, + "column": 19 + }, + "end": { + "line": 225, + "column": 13 + } + } + }, + "range": [ + 7223, + 7775 + ], + "loc": { + "start": { + "line": 215, + "column": 12 + }, + "end": { + "line": 225, + "column": 13 + } + } + } + ], + "range": [ + 7209, + 7787 + ], + "loc": { + "start": { + "line": 214, + "column": 51 + }, + "end": { + "line": 226, + "column": 11 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 7201, + 7787 + ], + "loc": { + "start": { + "line": 214, + "column": 43 + }, + "end": { + "line": 226, + "column": 11 + } + } + } + ], + "range": [ + 7168, + 7788 + ], + "loc": { + "start": { + "line": 214, + "column": 10 + }, + "end": { + "line": 226, + "column": 12 + } + } + }, + "range": [ + 7168, + 7789 + ], + "loc": { + "start": { + "line": 214, + "column": 10 + }, + "end": { + "line": 226, + "column": 13 + } + }, + "leadingComments": [ + { + "type": "Line", + "value": " TODO: Performance-wise, this can be made way better. There shouldn't be a need to maintain separate lists.", + "range": [ + 7048, + 7157 + ], + "loc": { + "start": { + "line": 213, + "column": 10 + }, + "end": { + "line": 213, + "column": 119 + } + } + } + ] + } + ], + "range": [ + 7036, + 7799 + ], + "loc": { + "start": { + "line": 212, + "column": 15 + }, + "end": { + "line": 227, + "column": 9 + } + } + }, + "range": [ + 6897, + 7799 + ], + "loc": { + "start": { + "line": 210, + "column": 8 + }, + "end": { + "line": 227, + "column": 9 + } + } + } + ], + "range": [ + 6887, + 7807 + ], + "loc": { + "start": { + "line": 209, + "column": 29 + }, + "end": { + "line": 228, + "column": 7 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "Error", + "range": [ + 7833, + 7838 + ], + "loc": { + "start": { + "line": 229, + "column": 18 + }, + "end": { + "line": 229, + "column": 23 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "Unknown type '", + "cooked": "Unknown type '" + }, + "tail": false, + "range": [ + 7839, + 7856 + ], + "loc": { + "start": { + "line": 229, + "column": 24 + }, + "end": { + "line": 229, + "column": 41 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "'", + "cooked": "'" + }, + "tail": true, + "range": [ + 7860, + 7863 + ], + "loc": { + "start": { + "line": 229, + "column": 45 + }, + "end": { + "line": 229, + "column": 48 + } + } + } + ], + "expressions": [ + { + "type": "Identifier", + "name": "type", + "range": [ + 7856, + 7860 + ], + "loc": { + "start": { + "line": 229, + "column": 41 + }, + "end": { + "line": 229, + "column": 45 + } + } + } + ], + "range": [ + 7839, + 7863 + ], + "loc": { + "start": { + "line": 229, + "column": 24 + }, + "end": { + "line": 229, + "column": 48 + } + } + } + ], + "range": [ + 7829, + 7864 + ], + "loc": { + "start": { + "line": 229, + "column": 14 + }, + "end": { + "line": 229, + "column": 49 + } + } + }, + "range": [ + 7823, + 7865 + ], + "loc": { + "start": { + "line": 229, + "column": 8 + }, + "end": { + "line": 229, + "column": 50 + } + } + } + ], + "range": [ + 7813, + 7873 + ], + "loc": { + "start": { + "line": 228, + "column": 13 + }, + "end": { + "line": 230, + "column": 7 + } + } + }, + "range": [ + 6864, + 7873 + ], + "loc": { + "start": { + "line": 209, + "column": 6 + }, + "end": { + "line": 230, + "column": 7 + } + } + } + ], + "range": [ + 6856, + 7879 + ], + "loc": { + "start": { + "line": 208, + "column": 76 + }, + "end": { + "line": 231, + "column": 5 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "Error", + "range": [ + 7903, + 7908 + ], + "loc": { + "start": { + "line": 232, + "column": 16 + }, + "end": { + "line": 232, + "column": 21 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "Unknown event '", + "cooked": "Unknown event '" + }, + "tail": false, + "range": [ + 7909, + 7927 + ], + "loc": { + "start": { + "line": 232, + "column": 22 + }, + "end": { + "line": 232, + "column": 40 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "'", + "cooked": "'" + }, + "tail": true, + "range": [ + 7932, + 7935 + ], + "loc": { + "start": { + "line": 232, + "column": 45 + }, + "end": { + "line": 232, + "column": 48 + } + } + } + ], + "expressions": [ + { + "type": "Identifier", + "name": "event", + "range": [ + 7927, + 7932 + ], + "loc": { + "start": { + "line": 232, + "column": 40 + }, + "end": { + "line": 232, + "column": 45 + } + } + } + ], + "range": [ + 7909, + 7935 + ], + "loc": { + "start": { + "line": 232, + "column": 22 + }, + "end": { + "line": 232, + "column": 48 + } + } + } + ], + "range": [ + 7899, + 7936 + ], + "loc": { + "start": { + "line": 232, + "column": 12 + }, + "end": { + "line": 232, + "column": 49 + } + } + }, + "range": [ + 7893, + 7937 + ], + "loc": { + "start": { + "line": 232, + "column": 6 + }, + "end": { + "line": 232, + "column": 50 + } + } + } + ], + "range": [ + 7885, + 7943 + ], + "loc": { + "start": { + "line": 231, + "column": 11 + }, + "end": { + "line": 233, + "column": 5 + } + } + }, + "range": [ + 6784, + 7943 + ], + "loc": { + "start": { + "line": 208, + "column": 4 + }, + "end": { + "line": 233, + "column": 5 + } + } + } + ], + "range": [ + 6778, + 7947 + ], + "loc": { + "start": { + "line": 207, + "column": 33 + }, + "end": { + "line": 234, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 6750, + 7947 + ], + "loc": { + "start": { + "line": 207, + "column": 5 + }, + "end": { + "line": 234, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 6747, + 7947 + ], + "loc": { + "start": { + "line": 207, + "column": 2 + }, + "end": { + "line": 234, + "column": 3 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": "*\n * Unregister an event listener that was registered with on().\n *\n * @since 0.4.0\n * @param {string} event - Name of the event.\n * @param {string} type - Name of resource to originally passed to on().\n * @param {string} [id] - ID of the resource to originally passed to on().\n * @param {function} callback - Function originally passed to on().\n * @return {undefined} - Nothing.\n ", + "range": [ + 6341, + 6744 + ], + "loc": { + "start": { + "line": 197, + "column": 2 + }, + "end": { + "line": 206, + "column": 5 + } + } + } + ], + "trailingComments": [ + { + "type": "Block", + "value": "*\n * Register an event listener: \"added\", \"updated\" or \"removed\".\n *\n * @since 0.4.0\n * @param {string} event - Name of the event.\n * @param {string} type - Name of resource to watch.\n * @param {string} [id] - ID of the resource to watch.\n * @param {function} callback - Function to call when the event occurs.\n * @param {Object} [context] - Context in which to call the callback.\n * @return {undefined} - Nothing.\n ", + "range": [ + 7951, + 8391 + ], + "loc": { + "start": { + "line": 236, + "column": 2 + }, + "end": { + "line": 246, + "column": 5 + } + } + } + ], + "static": false + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "on", + "range": [ + 8394, + 8396 + ], + "loc": { + "start": { + "line": 247, + "column": 2 + }, + "end": { + "line": 247, + "column": 4 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "event", + "range": [ + 8397, + 8402 + ], + "loc": { + "start": { + "line": 247, + "column": 5 + }, + "end": { + "line": 247, + "column": 10 + } + } + }, + { + "type": "Identifier", + "name": "type", + "range": [ + 8404, + 8408 + ], + "loc": { + "start": { + "line": 247, + "column": 12 + }, + "end": { + "line": 247, + "column": 16 + } + } + }, + { + "type": "Identifier", + "name": "id", + "range": [ + 8410, + 8412 + ], + "loc": { + "start": { + "line": 247, + "column": 18 + }, + "end": { + "line": 247, + "column": 20 + } + } + }, + { + "type": "Identifier", + "name": "callback", + "range": [ + 8414, + 8422 + ], + "loc": { + "start": { + "line": 247, + "column": 22 + }, + "end": { + "line": 247, + "column": 30 + } + } + }, + { + "type": "Identifier", + "name": "context", + "range": [ + 8424, + 8431 + ], + "loc": { + "start": { + "line": 247, + "column": 32 + }, + "end": { + "line": 247, + "column": 39 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 8443, + 8447 + ], + "loc": { + "start": { + "line": 248, + "column": 8 + }, + "end": { + "line": 248, + "column": 12 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 8448, + 8466 + ], + "loc": { + "start": { + "line": 248, + "column": 13 + }, + "end": { + "line": 248, + "column": 31 + } + } + }, + "range": [ + 8443, + 8466 + ], + "loc": { + "start": { + "line": 248, + "column": 8 + }, + "end": { + "line": 248, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 8467, + 8472 + ], + "loc": { + "start": { + "line": 248, + "column": 32 + }, + "end": { + "line": 248, + "column": 37 + } + } + }, + "range": [ + 8443, + 8473 + ], + "loc": { + "start": { + "line": 248, + "column": 8 + }, + "end": { + "line": 248, + "column": 38 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 8477, + 8481 + ], + "loc": { + "start": { + "line": 248, + "column": 42 + }, + "end": { + "line": 248, + "column": 46 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 8482, + 8502 + ], + "loc": { + "start": { + "line": 248, + "column": 47 + }, + "end": { + "line": 248, + "column": 67 + } + } + }, + "range": [ + 8477, + 8502 + ], + "loc": { + "start": { + "line": 248, + "column": 42 + }, + "end": { + "line": 248, + "column": 67 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 8503, + 8508 + ], + "loc": { + "start": { + "line": 248, + "column": 68 + }, + "end": { + "line": 248, + "column": 73 + } + } + }, + "range": [ + 8477, + 8509 + ], + "loc": { + "start": { + "line": 248, + "column": 42 + }, + "end": { + "line": 248, + "column": 74 + } + } + }, + "range": [ + 8443, + 8509 + ], + "loc": { + "start": { + "line": 248, + "column": 8 + }, + "end": { + "line": 248, + "column": 74 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 8523, + 8527 + ], + "loc": { + "start": { + "line": 249, + "column": 10 + }, + "end": { + "line": 249, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 8528, + 8534 + ], + "loc": { + "start": { + "line": 249, + "column": 15 + }, + "end": { + "line": 249, + "column": 21 + } + } + }, + "range": [ + 8523, + 8534 + ], + "loc": { + "start": { + "line": 249, + "column": 10 + }, + "end": { + "line": 249, + "column": 21 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 8535, + 8539 + ], + "loc": { + "start": { + "line": 249, + "column": 22 + }, + "end": { + "line": 249, + "column": 26 + } + } + }, + "range": [ + 8523, + 8540 + ], + "loc": { + "start": { + "line": 249, + "column": 10 + }, + "end": { + "line": 249, + "column": 27 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "Identifier", + "name": "id", + "range": [ + 8556, + 8558 + ], + "loc": { + "start": { + "line": 250, + "column": 12 + }, + "end": { + "line": 250, + "column": 14 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 8563, + 8565 + ], + "loc": { + "start": { + "line": 250, + "column": 19 + }, + "end": { + "line": 250, + "column": 21 + } + } + }, + "property": { + "type": "Identifier", + "name": "toString", + "range": [ + 8567, + 8575 + ], + "loc": { + "start": { + "line": 250, + "column": 23 + }, + "end": { + "line": 250, + "column": 31 + } + } + }, + "range": [ + 8562, + 8575 + ], + "loc": { + "start": { + "line": 250, + "column": 18 + }, + "end": { + "line": 250, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "name": "call", + "range": [ + 8576, + 8580 + ], + "loc": { + "start": { + "line": 250, + "column": 32 + }, + "end": { + "line": 250, + "column": 36 + } + } + }, + "range": [ + 8562, + 8580 + ], + "loc": { + "start": { + "line": 250, + "column": 18 + }, + "end": { + "line": 250, + "column": 36 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "id", + "range": [ + 8581, + 8583 + ], + "loc": { + "start": { + "line": 250, + "column": 37 + }, + "end": { + "line": 250, + "column": 39 + } + } + } + ], + "range": [ + 8562, + 8584 + ], + "loc": { + "start": { + "line": 250, + "column": 18 + }, + "end": { + "line": 250, + "column": 40 + } + } + }, + "right": { + "type": "Literal", + "value": "[object Function]", + "raw": "'[object Function]'", + "range": [ + 8589, + 8608 + ], + "loc": { + "start": { + "line": 250, + "column": 45 + }, + "end": { + "line": 250, + "column": 64 + } + } + }, + "range": [ + 8562, + 8608 + ], + "loc": { + "start": { + "line": 250, + "column": 18 + }, + "end": { + "line": 250, + "column": 64 + } + } + }, + "range": [ + 8556, + 8608 + ], + "loc": { + "start": { + "line": 250, + "column": 12 + }, + "end": { + "line": 250, + "column": 64 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 8622, + 8626 + ], + "loc": { + "start": { + "line": 251, + "column": 10 + }, + "end": { + "line": 251, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "on", + "range": [ + 8627, + 8629 + ], + "loc": { + "start": { + "line": 251, + "column": 15 + }, + "end": { + "line": 251, + "column": 17 + } + } + }, + "range": [ + 8622, + 8629 + ], + "loc": { + "start": { + "line": 251, + "column": 10 + }, + "end": { + "line": 251, + "column": 17 + } + } + }, + "property": { + "type": "Identifier", + "name": "call", + "range": [ + 8630, + 8634 + ], + "loc": { + "start": { + "line": 251, + "column": 18 + }, + "end": { + "line": 251, + "column": 22 + } + } + }, + "range": [ + 8622, + 8634 + ], + "loc": { + "start": { + "line": 251, + "column": 10 + }, + "end": { + "line": 251, + "column": 22 + } + } + }, + "arguments": [ + { + "type": "ThisExpression", + "range": [ + 8635, + 8639 + ], + "loc": { + "start": { + "line": 251, + "column": 23 + }, + "end": { + "line": 251, + "column": 27 + } + } + }, + { + "type": "Identifier", + "name": "event", + "range": [ + 8641, + 8646 + ], + "loc": { + "start": { + "line": 251, + "column": 29 + }, + "end": { + "line": 251, + "column": 34 + } + } + }, + { + "type": "Identifier", + "name": "type", + "range": [ + 8648, + 8652 + ], + "loc": { + "start": { + "line": 251, + "column": 36 + }, + "end": { + "line": 251, + "column": 40 + } + } + }, + { + "type": "Literal", + "value": null, + "raw": "null", + "range": [ + 8654, + 8658 + ], + "loc": { + "start": { + "line": 251, + "column": 42 + }, + "end": { + "line": 251, + "column": 46 + } + } + }, + { + "type": "Identifier", + "name": "id", + "range": [ + 8660, + 8662 + ], + "loc": { + "start": { + "line": 251, + "column": 48 + }, + "end": { + "line": 251, + "column": 50 + } + } + }, + { + "type": "Identifier", + "name": "callback", + "range": [ + 8664, + 8672 + ], + "loc": { + "start": { + "line": 251, + "column": 52 + }, + "end": { + "line": 251, + "column": 60 + } + } + } + ], + "range": [ + 8622, + 8673 + ], + "loc": { + "start": { + "line": 251, + "column": 10 + }, + "end": { + "line": 251, + "column": 61 + } + } + }, + "range": [ + 8622, + 8674 + ], + "loc": { + "start": { + "line": 251, + "column": 10 + }, + "end": { + "line": 251, + "column": 62 + } + } + } + ], + "range": [ + 8610, + 8684 + ], + "loc": { + "start": { + "line": 250, + "column": 66 + }, + "end": { + "line": 252, + "column": 9 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 8822, + 8826 + ], + "loc": { + "start": { + "line": 254, + "column": 10 + }, + "end": { + "line": 254, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 8827, + 8833 + ], + "loc": { + "start": { + "line": 254, + "column": 15 + }, + "end": { + "line": 254, + "column": 21 + } + } + }, + "range": [ + 8822, + 8833 + ], + "loc": { + "start": { + "line": 254, + "column": 10 + }, + "end": { + "line": 254, + "column": 21 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 8834, + 8838 + ], + "loc": { + "start": { + "line": 254, + "column": 22 + }, + "end": { + "line": 254, + "column": 26 + } + } + }, + "range": [ + 8822, + 8839 + ], + "loc": { + "start": { + "line": 254, + "column": 10 + }, + "end": { + "line": 254, + "column": 27 + } + } + }, + "property": { + "type": "Identifier", + "name": "_names", + "range": [ + 8840, + 8846 + ], + "loc": { + "start": { + "line": 254, + "column": 28 + }, + "end": { + "line": 254, + "column": 34 + } + } + }, + "range": [ + 8822, + 8846 + ], + "loc": { + "start": { + "line": 254, + "column": 10 + }, + "end": { + "line": 254, + "column": 34 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 8847, + 8854 + ], + "loc": { + "start": { + "line": 254, + "column": 35 + }, + "end": { + "line": 254, + "column": 42 + } + } + }, + "range": [ + 8822, + 8854 + ], + "loc": { + "start": { + "line": 254, + "column": 10 + }, + "end": { + "line": 254, + "column": 42 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "type", + "range": [ + 8855, + 8859 + ], + "loc": { + "start": { + "line": 254, + "column": 43 + }, + "end": { + "line": 254, + "column": 47 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "id", + "range": [ + 8881, + 8883 + ], + "loc": { + "start": { + "line": 255, + "column": 16 + }, + "end": { + "line": 255, + "column": 18 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 8901, + 8905 + ], + "loc": { + "start": { + "line": 256, + "column": 14 + }, + "end": { + "line": 256, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 8906, + 8924 + ], + "loc": { + "start": { + "line": 256, + "column": 19 + }, + "end": { + "line": 256, + "column": 37 + } + } + }, + "range": [ + 8901, + 8924 + ], + "loc": { + "start": { + "line": 256, + "column": 14 + }, + "end": { + "line": 256, + "column": 37 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 8925, + 8930 + ], + "loc": { + "start": { + "line": 256, + "column": 38 + }, + "end": { + "line": 256, + "column": 43 + } + } + }, + "range": [ + 8901, + 8931 + ], + "loc": { + "start": { + "line": 256, + "column": 14 + }, + "end": { + "line": 256, + "column": 44 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 8932, + 8936 + ], + "loc": { + "start": { + "line": 256, + "column": 45 + }, + "end": { + "line": 256, + "column": 49 + } + } + }, + "range": [ + 8901, + 8937 + ], + "loc": { + "start": { + "line": 256, + "column": 14 + }, + "end": { + "line": 256, + "column": 50 + } + } + }, + "right": { + "type": "LogicalExpression", + "operator": "||", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 8940, + 8944 + ], + "loc": { + "start": { + "line": 256, + "column": 53 + }, + "end": { + "line": 256, + "column": 57 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 8945, + 8963 + ], + "loc": { + "start": { + "line": 256, + "column": 58 + }, + "end": { + "line": 256, + "column": 76 + } + } + }, + "range": [ + 8940, + 8963 + ], + "loc": { + "start": { + "line": 256, + "column": 53 + }, + "end": { + "line": 256, + "column": 76 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 8964, + 8969 + ], + "loc": { + "start": { + "line": 256, + "column": 77 + }, + "end": { + "line": 256, + "column": 82 + } + } + }, + "range": [ + 8940, + 8970 + ], + "loc": { + "start": { + "line": 256, + "column": 53 + }, + "end": { + "line": 256, + "column": 83 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 8971, + 8975 + ], + "loc": { + "start": { + "line": 256, + "column": 84 + }, + "end": { + "line": 256, + "column": 88 + } + } + }, + "range": [ + 8940, + 8976 + ], + "loc": { + "start": { + "line": 256, + "column": 53 + }, + "end": { + "line": 256, + "column": 89 + } + } + }, + "right": { + "type": "ObjectExpression", + "properties": [], + "range": [ + 8980, + 8982 + ], + "loc": { + "start": { + "line": 256, + "column": 93 + }, + "end": { + "line": 256, + "column": 95 + } + } + }, + "range": [ + 8940, + 8982 + ], + "loc": { + "start": { + "line": 256, + "column": 53 + }, + "end": { + "line": 256, + "column": 95 + } + } + }, + "range": [ + 8901, + 8982 + ], + "loc": { + "start": { + "line": 256, + "column": 14 + }, + "end": { + "line": 256, + "column": 95 + } + } + }, + "range": [ + 8901, + 8983 + ], + "loc": { + "start": { + "line": 256, + "column": 14 + }, + "end": { + "line": 256, + "column": 96 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 8998, + 9002 + ], + "loc": { + "start": { + "line": 257, + "column": 14 + }, + "end": { + "line": 257, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 9003, + 9021 + ], + "loc": { + "start": { + "line": 257, + "column": 19 + }, + "end": { + "line": 257, + "column": 37 + } + } + }, + "range": [ + 8998, + 9021 + ], + "loc": { + "start": { + "line": 257, + "column": 14 + }, + "end": { + "line": 257, + "column": 37 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 9022, + 9027 + ], + "loc": { + "start": { + "line": 257, + "column": 38 + }, + "end": { + "line": 257, + "column": 43 + } + } + }, + "range": [ + 8998, + 9028 + ], + "loc": { + "start": { + "line": 257, + "column": 14 + }, + "end": { + "line": 257, + "column": 44 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 9029, + 9033 + ], + "loc": { + "start": { + "line": 257, + "column": 45 + }, + "end": { + "line": 257, + "column": 49 + } + } + }, + "range": [ + 8998, + 9034 + ], + "loc": { + "start": { + "line": 257, + "column": 14 + }, + "end": { + "line": 257, + "column": 50 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 9035, + 9037 + ], + "loc": { + "start": { + "line": 257, + "column": 51 + }, + "end": { + "line": 257, + "column": 53 + } + } + }, + "range": [ + 8998, + 9038 + ], + "loc": { + "start": { + "line": 257, + "column": 14 + }, + "end": { + "line": 257, + "column": 54 + } + } + }, + "right": { + "type": "LogicalExpression", + "operator": "||", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 9041, + 9045 + ], + "loc": { + "start": { + "line": 257, + "column": 57 + }, + "end": { + "line": 257, + "column": 61 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 9046, + 9064 + ], + "loc": { + "start": { + "line": 257, + "column": 62 + }, + "end": { + "line": 257, + "column": 80 + } + } + }, + "range": [ + 9041, + 9064 + ], + "loc": { + "start": { + "line": 257, + "column": 57 + }, + "end": { + "line": 257, + "column": 80 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 9065, + 9070 + ], + "loc": { + "start": { + "line": 257, + "column": 81 + }, + "end": { + "line": 257, + "column": 86 + } + } + }, + "range": [ + 9041, + 9071 + ], + "loc": { + "start": { + "line": 257, + "column": 57 + }, + "end": { + "line": 257, + "column": 87 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 9072, + 9076 + ], + "loc": { + "start": { + "line": 257, + "column": 88 + }, + "end": { + "line": 257, + "column": 92 + } + } + }, + "range": [ + 9041, + 9077 + ], + "loc": { + "start": { + "line": 257, + "column": 57 + }, + "end": { + "line": 257, + "column": 93 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 9078, + 9080 + ], + "loc": { + "start": { + "line": 257, + "column": 94 + }, + "end": { + "line": 257, + "column": 96 + } + } + }, + "range": [ + 9041, + 9081 + ], + "loc": { + "start": { + "line": 257, + "column": 57 + }, + "end": { + "line": 257, + "column": 97 + } + } + }, + "right": { + "type": "ArrayExpression", + "elements": [], + "range": [ + 9085, + 9087 + ], + "loc": { + "start": { + "line": 257, + "column": 101 + }, + "end": { + "line": 257, + "column": 103 + } + } + }, + "range": [ + 9041, + 9087 + ], + "loc": { + "start": { + "line": 257, + "column": 57 + }, + "end": { + "line": 257, + "column": 103 + } + } + }, + "range": [ + 8998, + 9087 + ], + "loc": { + "start": { + "line": 257, + "column": 14 + }, + "end": { + "line": 257, + "column": 103 + } + } + }, + "range": [ + 8998, + 9088 + ], + "loc": { + "start": { + "line": 257, + "column": 14 + }, + "end": { + "line": 257, + "column": 104 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "UnaryExpression", + "operator": "!", + "argument": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 9108, + 9112 + ], + "loc": { + "start": { + "line": 258, + "column": 19 + }, + "end": { + "line": 258, + "column": 23 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 9113, + 9131 + ], + "loc": { + "start": { + "line": 258, + "column": 24 + }, + "end": { + "line": 258, + "column": 42 + } + } + }, + "range": [ + 9108, + 9131 + ], + "loc": { + "start": { + "line": 258, + "column": 19 + }, + "end": { + "line": 258, + "column": 42 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 9132, + 9137 + ], + "loc": { + "start": { + "line": 258, + "column": 43 + }, + "end": { + "line": 258, + "column": 48 + } + } + }, + "range": [ + 9108, + 9138 + ], + "loc": { + "start": { + "line": 258, + "column": 19 + }, + "end": { + "line": 258, + "column": 49 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 9139, + 9143 + ], + "loc": { + "start": { + "line": 258, + "column": 50 + }, + "end": { + "line": 258, + "column": 54 + } + } + }, + "range": [ + 9108, + 9144 + ], + "loc": { + "start": { + "line": 258, + "column": 19 + }, + "end": { + "line": 258, + "column": 55 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 9145, + 9147 + ], + "loc": { + "start": { + "line": 258, + "column": 56 + }, + "end": { + "line": 258, + "column": 58 + } + } + }, + "range": [ + 9108, + 9148 + ], + "loc": { + "start": { + "line": 258, + "column": 19 + }, + "end": { + "line": 258, + "column": 59 + } + } + }, + "property": { + "type": "Identifier", + "name": "find", + "range": [ + 9149, + 9153 + ], + "loc": { + "start": { + "line": 258, + "column": 60 + }, + "end": { + "line": 258, + "column": 64 + } + } + }, + "range": [ + 9108, + 9153 + ], + "loc": { + "start": { + "line": 258, + "column": 19 + }, + "end": { + "line": 258, + "column": 64 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 9154, + 9155 + ], + "loc": { + "start": { + "line": 258, + "column": 65 + }, + "end": { + "line": 258, + "column": 66 + } + } + } + ], + "body": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 9159, + 9160 + ], + "loc": { + "start": { + "line": 258, + "column": 70 + }, + "end": { + "line": 258, + "column": 71 + } + } + }, + "property": { + "type": "Literal", + "value": 0, + "raw": "0", + "range": [ + 9161, + 9162 + ], + "loc": { + "start": { + "line": 258, + "column": 72 + }, + "end": { + "line": 258, + "column": 73 + } + } + }, + "range": [ + 9159, + 9163 + ], + "loc": { + "start": { + "line": 258, + "column": 70 + }, + "end": { + "line": 258, + "column": 74 + } + } + }, + "right": { + "type": "Identifier", + "name": "callback", + "range": [ + 9168, + 9176 + ], + "loc": { + "start": { + "line": 258, + "column": 79 + }, + "end": { + "line": 258, + "column": 87 + } + } + }, + "range": [ + 9159, + 9176 + ], + "loc": { + "start": { + "line": 258, + "column": 70 + }, + "end": { + "line": 258, + "column": 87 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 9154, + 9176 + ], + "loc": { + "start": { + "line": 258, + "column": 65 + }, + "end": { + "line": 258, + "column": 87 + } + } + } + ], + "range": [ + 9108, + 9177 + ], + "loc": { + "start": { + "line": 258, + "column": 19 + }, + "end": { + "line": 258, + "column": 88 + } + } + }, + "prefix": true, + "range": [ + 9107, + 9177 + ], + "loc": { + "start": { + "line": 258, + "column": 18 + }, + "end": { + "line": 258, + "column": 88 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 9197, + 9201 + ], + "loc": { + "start": { + "line": 259, + "column": 16 + }, + "end": { + "line": 259, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 9202, + 9220 + ], + "loc": { + "start": { + "line": 259, + "column": 21 + }, + "end": { + "line": 259, + "column": 39 + } + } + }, + "range": [ + 9197, + 9220 + ], + "loc": { + "start": { + "line": 259, + "column": 16 + }, + "end": { + "line": 259, + "column": 39 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 9221, + 9226 + ], + "loc": { + "start": { + "line": 259, + "column": 40 + }, + "end": { + "line": 259, + "column": 45 + } + } + }, + "range": [ + 9197, + 9227 + ], + "loc": { + "start": { + "line": 259, + "column": 16 + }, + "end": { + "line": 259, + "column": 46 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 9228, + 9232 + ], + "loc": { + "start": { + "line": 259, + "column": 47 + }, + "end": { + "line": 259, + "column": 51 + } + } + }, + "range": [ + 9197, + 9233 + ], + "loc": { + "start": { + "line": 259, + "column": 16 + }, + "end": { + "line": 259, + "column": 52 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 9234, + 9236 + ], + "loc": { + "start": { + "line": 259, + "column": 53 + }, + "end": { + "line": 259, + "column": 55 + } + } + }, + "range": [ + 9197, + 9237 + ], + "loc": { + "start": { + "line": 259, + "column": 16 + }, + "end": { + "line": 259, + "column": 56 + } + } + }, + "property": { + "type": "Identifier", + "name": "push", + "range": [ + 9238, + 9242 + ], + "loc": { + "start": { + "line": 259, + "column": 57 + }, + "end": { + "line": 259, + "column": 61 + } + } + }, + "range": [ + 9197, + 9242 + ], + "loc": { + "start": { + "line": 259, + "column": 16 + }, + "end": { + "line": 259, + "column": 61 + } + } + }, + "arguments": [ + { + "type": "ArrayExpression", + "elements": [ + { + "type": "Identifier", + "name": "callback", + "range": [ + 9245, + 9253 + ], + "loc": { + "start": { + "line": 259, + "column": 64 + }, + "end": { + "line": 259, + "column": 72 + } + } + }, + { + "type": "Identifier", + "name": "context", + "range": [ + 9255, + 9262 + ], + "loc": { + "start": { + "line": 259, + "column": 74 + }, + "end": { + "line": 259, + "column": 81 + } + } + } + ], + "range": [ + 9243, + 9264 + ], + "loc": { + "start": { + "line": 259, + "column": 62 + }, + "end": { + "line": 259, + "column": 83 + } + } + } + ], + "range": [ + 9197, + 9265 + ], + "loc": { + "start": { + "line": 259, + "column": 16 + }, + "end": { + "line": 259, + "column": 84 + } + } + }, + "range": [ + 9197, + 9266 + ], + "loc": { + "start": { + "line": 259, + "column": 16 + }, + "end": { + "line": 259, + "column": 85 + } + } + } + ], + "range": [ + 9179, + 9282 + ], + "loc": { + "start": { + "line": 258, + "column": 90 + }, + "end": { + "line": 260, + "column": 15 + } + } + }, + "alternate": null, + "range": [ + 9103, + 9282 + ], + "loc": { + "start": { + "line": 258, + "column": 14 + }, + "end": { + "line": 260, + "column": 15 + } + } + } + ], + "range": [ + 8885, + 9296 + ], + "loc": { + "start": { + "line": 255, + "column": 20 + }, + "end": { + "line": 261, + "column": 13 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 9318, + 9322 + ], + "loc": { + "start": { + "line": 262, + "column": 14 + }, + "end": { + "line": 262, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 9323, + 9343 + ], + "loc": { + "start": { + "line": 262, + "column": 19 + }, + "end": { + "line": 262, + "column": 39 + } + } + }, + "range": [ + 9318, + 9343 + ], + "loc": { + "start": { + "line": 262, + "column": 14 + }, + "end": { + "line": 262, + "column": 39 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 9344, + 9349 + ], + "loc": { + "start": { + "line": 262, + "column": 40 + }, + "end": { + "line": 262, + "column": 45 + } + } + }, + "range": [ + 9318, + 9350 + ], + "loc": { + "start": { + "line": 262, + "column": 14 + }, + "end": { + "line": 262, + "column": 46 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 9351, + 9355 + ], + "loc": { + "start": { + "line": 262, + "column": 47 + }, + "end": { + "line": 262, + "column": 51 + } + } + }, + "range": [ + 9318, + 9356 + ], + "loc": { + "start": { + "line": 262, + "column": 14 + }, + "end": { + "line": 262, + "column": 52 + } + } + }, + "right": { + "type": "LogicalExpression", + "operator": "||", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 9359, + 9363 + ], + "loc": { + "start": { + "line": 262, + "column": 55 + }, + "end": { + "line": 262, + "column": 59 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 9364, + 9384 + ], + "loc": { + "start": { + "line": 262, + "column": 60 + }, + "end": { + "line": 262, + "column": 80 + } + } + }, + "range": [ + 9359, + 9384 + ], + "loc": { + "start": { + "line": 262, + "column": 55 + }, + "end": { + "line": 262, + "column": 80 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 9385, + 9390 + ], + "loc": { + "start": { + "line": 262, + "column": 81 + }, + "end": { + "line": 262, + "column": 86 + } + } + }, + "range": [ + 9359, + 9391 + ], + "loc": { + "start": { + "line": 262, + "column": 55 + }, + "end": { + "line": 262, + "column": 87 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 9392, + 9396 + ], + "loc": { + "start": { + "line": 262, + "column": 88 + }, + "end": { + "line": 262, + "column": 92 + } + } + }, + "range": [ + 9359, + 9397 + ], + "loc": { + "start": { + "line": 262, + "column": 55 + }, + "end": { + "line": 262, + "column": 93 + } + } + }, + "right": { + "type": "ArrayExpression", + "elements": [], + "range": [ + 9401, + 9403 + ], + "loc": { + "start": { + "line": 262, + "column": 97 + }, + "end": { + "line": 262, + "column": 99 + } + } + }, + "range": [ + 9359, + 9403 + ], + "loc": { + "start": { + "line": 262, + "column": 55 + }, + "end": { + "line": 262, + "column": 99 + } + } + }, + "range": [ + 9318, + 9403 + ], + "loc": { + "start": { + "line": 262, + "column": 14 + }, + "end": { + "line": 262, + "column": 99 + } + } + }, + "range": [ + 9318, + 9404 + ], + "loc": { + "start": { + "line": 262, + "column": 14 + }, + "end": { + "line": 262, + "column": 100 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "UnaryExpression", + "operator": "!", + "argument": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 9424, + 9428 + ], + "loc": { + "start": { + "line": 263, + "column": 19 + }, + "end": { + "line": 263, + "column": 23 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 9429, + 9449 + ], + "loc": { + "start": { + "line": 263, + "column": 24 + }, + "end": { + "line": 263, + "column": 44 + } + } + }, + "range": [ + 9424, + 9449 + ], + "loc": { + "start": { + "line": 263, + "column": 19 + }, + "end": { + "line": 263, + "column": 44 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 9450, + 9455 + ], + "loc": { + "start": { + "line": 263, + "column": 45 + }, + "end": { + "line": 263, + "column": 50 + } + } + }, + "range": [ + 9424, + 9456 + ], + "loc": { + "start": { + "line": 263, + "column": 19 + }, + "end": { + "line": 263, + "column": 51 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 9457, + 9461 + ], + "loc": { + "start": { + "line": 263, + "column": 52 + }, + "end": { + "line": 263, + "column": 56 + } + } + }, + "range": [ + 9424, + 9462 + ], + "loc": { + "start": { + "line": 263, + "column": 19 + }, + "end": { + "line": 263, + "column": 57 + } + } + }, + "property": { + "type": "Identifier", + "name": "find", + "range": [ + 9463, + 9467 + ], + "loc": { + "start": { + "line": 263, + "column": 58 + }, + "end": { + "line": 263, + "column": 62 + } + } + }, + "range": [ + 9424, + 9467 + ], + "loc": { + "start": { + "line": 263, + "column": 19 + }, + "end": { + "line": 263, + "column": 62 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 9468, + 9469 + ], + "loc": { + "start": { + "line": 263, + "column": 63 + }, + "end": { + "line": 263, + "column": 64 + } + } + } + ], + "body": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 9473, + 9474 + ], + "loc": { + "start": { + "line": 263, + "column": 68 + }, + "end": { + "line": 263, + "column": 69 + } + } + }, + "property": { + "type": "Literal", + "value": 0, + "raw": "0", + "range": [ + 9475, + 9476 + ], + "loc": { + "start": { + "line": 263, + "column": 70 + }, + "end": { + "line": 263, + "column": 71 + } + } + }, + "range": [ + 9473, + 9477 + ], + "loc": { + "start": { + "line": 263, + "column": 68 + }, + "end": { + "line": 263, + "column": 72 + } + } + }, + "right": { + "type": "Identifier", + "name": "callback", + "range": [ + 9482, + 9490 + ], + "loc": { + "start": { + "line": 263, + "column": 77 + }, + "end": { + "line": 263, + "column": 85 + } + } + }, + "range": [ + 9473, + 9490 + ], + "loc": { + "start": { + "line": 263, + "column": 68 + }, + "end": { + "line": 263, + "column": 85 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 9468, + 9490 + ], + "loc": { + "start": { + "line": 263, + "column": 63 + }, + "end": { + "line": 263, + "column": 85 + } + } + } + ], + "range": [ + 9424, + 9491 + ], + "loc": { + "start": { + "line": 263, + "column": 19 + }, + "end": { + "line": 263, + "column": 86 + } + } + }, + "prefix": true, + "range": [ + 9423, + 9491 + ], + "loc": { + "start": { + "line": 263, + "column": 18 + }, + "end": { + "line": 263, + "column": 86 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 9511, + 9515 + ], + "loc": { + "start": { + "line": 264, + "column": 16 + }, + "end": { + "line": 264, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 9516, + 9536 + ], + "loc": { + "start": { + "line": 264, + "column": 21 + }, + "end": { + "line": 264, + "column": 41 + } + } + }, + "range": [ + 9511, + 9536 + ], + "loc": { + "start": { + "line": 264, + "column": 16 + }, + "end": { + "line": 264, + "column": 41 + } + } + }, + "property": { + "type": "Identifier", + "name": "event", + "range": [ + 9537, + 9542 + ], + "loc": { + "start": { + "line": 264, + "column": 42 + }, + "end": { + "line": 264, + "column": 47 + } + } + }, + "range": [ + 9511, + 9543 + ], + "loc": { + "start": { + "line": 264, + "column": 16 + }, + "end": { + "line": 264, + "column": 48 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 9544, + 9548 + ], + "loc": { + "start": { + "line": 264, + "column": 49 + }, + "end": { + "line": 264, + "column": 53 + } + } + }, + "range": [ + 9511, + 9549 + ], + "loc": { + "start": { + "line": 264, + "column": 16 + }, + "end": { + "line": 264, + "column": 54 + } + } + }, + "property": { + "type": "Identifier", + "name": "push", + "range": [ + 9550, + 9554 + ], + "loc": { + "start": { + "line": 264, + "column": 55 + }, + "end": { + "line": 264, + "column": 59 + } + } + }, + "range": [ + 9511, + 9554 + ], + "loc": { + "start": { + "line": 264, + "column": 16 + }, + "end": { + "line": 264, + "column": 59 + } + } + }, + "arguments": [ + { + "type": "ArrayExpression", + "elements": [ + { + "type": "Identifier", + "name": "callback", + "range": [ + 9557, + 9565 + ], + "loc": { + "start": { + "line": 264, + "column": 62 + }, + "end": { + "line": 264, + "column": 70 + } + } + }, + { + "type": "Identifier", + "name": "context", + "range": [ + 9567, + 9574 + ], + "loc": { + "start": { + "line": 264, + "column": 72 + }, + "end": { + "line": 264, + "column": 79 + } + } + } + ], + "range": [ + 9555, + 9576 + ], + "loc": { + "start": { + "line": 264, + "column": 60 + }, + "end": { + "line": 264, + "column": 81 + } + } + } + ], + "range": [ + 9511, + 9577 + ], + "loc": { + "start": { + "line": 264, + "column": 16 + }, + "end": { + "line": 264, + "column": 82 + } + } + }, + "range": [ + 9511, + 9578 + ], + "loc": { + "start": { + "line": 264, + "column": 16 + }, + "end": { + "line": 264, + "column": 83 + } + } + } + ], + "range": [ + 9493, + 9594 + ], + "loc": { + "start": { + "line": 263, + "column": 88 + }, + "end": { + "line": 265, + "column": 15 + } + } + }, + "alternate": null, + "range": [ + 9419, + 9594 + ], + "loc": { + "start": { + "line": 263, + "column": 14 + }, + "end": { + "line": 265, + "column": 15 + } + } + } + ], + "range": [ + 9302, + 9608 + ], + "loc": { + "start": { + "line": 261, + "column": 19 + }, + "end": { + "line": 266, + "column": 13 + } + } + }, + "range": [ + 8877, + 9608 + ], + "loc": { + "start": { + "line": 255, + "column": 12 + }, + "end": { + "line": 266, + "column": 13 + } + } + } + ], + "range": [ + 8863, + 9620 + ], + "loc": { + "start": { + "line": 254, + "column": 51 + }, + "end": { + "line": 267, + "column": 11 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 8855, + 9620 + ], + "loc": { + "start": { + "line": 254, + "column": 43 + }, + "end": { + "line": 267, + "column": 11 + } + } + } + ], + "range": [ + 8822, + 9621 + ], + "loc": { + "start": { + "line": 254, + "column": 10 + }, + "end": { + "line": 267, + "column": 12 + } + } + }, + "range": [ + 8822, + 9622 + ], + "loc": { + "start": { + "line": 254, + "column": 10 + }, + "end": { + "line": 267, + "column": 13 + } + }, + "leadingComments": [ + { + "type": "Line", + "value": " TODO: Performance-wise, this can be made way better. There shouldn't be a need to maintain separate lists.", + "range": [ + 8702, + 8811 + ], + "loc": { + "start": { + "line": 253, + "column": 10 + }, + "end": { + "line": 253, + "column": 119 + } + } + } + ] + } + ], + "range": [ + 8690, + 9632 + ], + "loc": { + "start": { + "line": 252, + "column": 15 + }, + "end": { + "line": 268, + "column": 9 + } + } + }, + "range": [ + 8552, + 9632 + ], + "loc": { + "start": { + "line": 250, + "column": 8 + }, + "end": { + "line": 268, + "column": 9 + } + } + } + ], + "range": [ + 8542, + 9640 + ], + "loc": { + "start": { + "line": 249, + "column": 29 + }, + "end": { + "line": 269, + "column": 7 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "Error", + "range": [ + 9666, + 9671 + ], + "loc": { + "start": { + "line": 270, + "column": 18 + }, + "end": { + "line": 270, + "column": 23 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "Unknown type '", + "cooked": "Unknown type '" + }, + "tail": false, + "range": [ + 9672, + 9689 + ], + "loc": { + "start": { + "line": 270, + "column": 24 + }, + "end": { + "line": 270, + "column": 41 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "'", + "cooked": "'" + }, + "tail": true, + "range": [ + 9693, + 9696 + ], + "loc": { + "start": { + "line": 270, + "column": 45 + }, + "end": { + "line": 270, + "column": 48 + } + } + } + ], + "expressions": [ + { + "type": "Identifier", + "name": "type", + "range": [ + 9689, + 9693 + ], + "loc": { + "start": { + "line": 270, + "column": 41 + }, + "end": { + "line": 270, + "column": 45 + } + } + } + ], + "range": [ + 9672, + 9696 + ], + "loc": { + "start": { + "line": 270, + "column": 24 + }, + "end": { + "line": 270, + "column": 48 + } + } + } + ], + "range": [ + 9662, + 9697 + ], + "loc": { + "start": { + "line": 270, + "column": 14 + }, + "end": { + "line": 270, + "column": 49 + } + } + }, + "range": [ + 9656, + 9698 + ], + "loc": { + "start": { + "line": 270, + "column": 8 + }, + "end": { + "line": 270, + "column": 50 + } + } + } + ], + "range": [ + 9646, + 9706 + ], + "loc": { + "start": { + "line": 269, + "column": 13 + }, + "end": { + "line": 271, + "column": 7 + } + } + }, + "range": [ + 8519, + 9706 + ], + "loc": { + "start": { + "line": 249, + "column": 6 + }, + "end": { + "line": 271, + "column": 7 + } + } + } + ], + "range": [ + 8511, + 9712 + ], + "loc": { + "start": { + "line": 248, + "column": 76 + }, + "end": { + "line": 272, + "column": 5 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "Error", + "range": [ + 9736, + 9741 + ], + "loc": { + "start": { + "line": 273, + "column": 16 + }, + "end": { + "line": 273, + "column": 21 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "Unknown event '", + "cooked": "Unknown event '" + }, + "tail": false, + "range": [ + 9742, + 9760 + ], + "loc": { + "start": { + "line": 273, + "column": 22 + }, + "end": { + "line": 273, + "column": 40 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "'", + "cooked": "'" + }, + "tail": true, + "range": [ + 9765, + 9768 + ], + "loc": { + "start": { + "line": 273, + "column": 45 + }, + "end": { + "line": 273, + "column": 48 + } + } + } + ], + "expressions": [ + { + "type": "Identifier", + "name": "event", + "range": [ + 9760, + 9765 + ], + "loc": { + "start": { + "line": 273, + "column": 40 + }, + "end": { + "line": 273, + "column": 45 + } + } + } + ], + "range": [ + 9742, + 9768 + ], + "loc": { + "start": { + "line": 273, + "column": 22 + }, + "end": { + "line": 273, + "column": 48 + } + } + } + ], + "range": [ + 9732, + 9769 + ], + "loc": { + "start": { + "line": 273, + "column": 12 + }, + "end": { + "line": 273, + "column": 49 + } + } + }, + "range": [ + 9726, + 9770 + ], + "loc": { + "start": { + "line": 273, + "column": 6 + }, + "end": { + "line": 273, + "column": 50 + } + } + } + ], + "range": [ + 9718, + 9776 + ], + "loc": { + "start": { + "line": 272, + "column": 11 + }, + "end": { + "line": 274, + "column": 5 + } + } + }, + "range": [ + 8439, + 9776 + ], + "loc": { + "start": { + "line": 248, + "column": 4 + }, + "end": { + "line": 274, + "column": 5 + } + } + } + ], + "range": [ + 8433, + 9780 + ], + "loc": { + "start": { + "line": 247, + "column": 41 + }, + "end": { + "line": 275, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 8396, + 9780 + ], + "loc": { + "start": { + "line": 247, + "column": 4 + }, + "end": { + "line": 275, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 8394, + 9780 + ], + "loc": { + "start": { + "line": 247, + "column": 2 + }, + "end": { + "line": 275, + "column": 3 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": "*\n * Register an event listener: \"added\", \"updated\" or \"removed\".\n *\n * @since 0.4.0\n * @param {string} event - Name of the event.\n * @param {string} type - Name of resource to watch.\n * @param {string} [id] - ID of the resource to watch.\n * @param {function} callback - Function to call when the event occurs.\n * @param {Object} [context] - Context in which to call the callback.\n * @return {undefined} - Nothing.\n ", + "range": [ + 7951, + 8391 + ], + "loc": { + "start": { + "line": 236, + "column": 2 + }, + "end": { + "line": 246, + "column": 5 + } + } + } + ], + "trailingComments": [ + { + "type": "Block", + "value": "*\n * Add a JSON API response to the store. This method can be used to handle a\n * successful GET or POST response from the server.\n *\n * @since 0.1.0\n * @param {Object} root - Top Level Object to push. See:\n http://jsonapi.org/format/#document-top-level\n * @return {undefined} - Nothing.\n ", + "range": [ + 9784, + 10118 + ], + "loc": { + "start": { + "line": 277, + "column": 2 + }, + "end": { + "line": 285, + "column": 5 + } + } + } + ], + "static": false + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "push", + "range": [ + 10121, + 10125 + ], + "loc": { + "start": { + "line": 286, + "column": 2 + }, + "end": { + "line": 286, + "column": 6 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "root", + "range": [ + 10126, + 10130 + ], + "loc": { + "start": { + "line": 286, + "column": 7 + }, + "end": { + "line": 286, + "column": 11 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "root", + "range": [ + 10142, + 10146 + ], + "loc": { + "start": { + "line": 287, + "column": 8 + }, + "end": { + "line": 287, + "column": 12 + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "range": [ + 10147, + 10151 + ], + "loc": { + "start": { + "line": 287, + "column": 13 + }, + "end": { + "line": 287, + "column": 17 + } + } + }, + "range": [ + 10142, + 10151 + ], + "loc": { + "start": { + "line": 287, + "column": 8 + }, + "end": { + "line": 287, + "column": 17 + } + } + }, + "property": { + "type": "Identifier", + "name": "constructor", + "range": [ + 10152, + 10163 + ], + "loc": { + "start": { + "line": 287, + "column": 18 + }, + "end": { + "line": 287, + "column": 29 + } + } + }, + "range": [ + 10142, + 10163 + ], + "loc": { + "start": { + "line": 287, + "column": 8 + }, + "end": { + "line": 287, + "column": 29 + } + } + }, + "right": { + "type": "Identifier", + "name": "Array", + "range": [ + 10168, + 10173 + ], + "loc": { + "start": { + "line": 287, + "column": 34 + }, + "end": { + "line": 287, + "column": 39 + } + } + }, + "range": [ + 10142, + 10173 + ], + "loc": { + "start": { + "line": 287, + "column": 8 + }, + "end": { + "line": 287, + "column": 39 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "root", + "range": [ + 10183, + 10187 + ], + "loc": { + "start": { + "line": 288, + "column": 6 + }, + "end": { + "line": 288, + "column": 10 + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "range": [ + 10188, + 10192 + ], + "loc": { + "start": { + "line": 288, + "column": 11 + }, + "end": { + "line": 288, + "column": 15 + } + } + }, + "range": [ + 10183, + 10192 + ], + "loc": { + "start": { + "line": 288, + "column": 6 + }, + "end": { + "line": 288, + "column": 15 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 10193, + 10200 + ], + "loc": { + "start": { + "line": 288, + "column": 16 + }, + "end": { + "line": 288, + "column": 23 + } + } + }, + "range": [ + 10183, + 10200 + ], + "loc": { + "start": { + "line": 288, + "column": 6 + }, + "end": { + "line": 288, + "column": 23 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 10201, + 10202 + ], + "loc": { + "start": { + "line": 288, + "column": 24 + }, + "end": { + "line": 288, + "column": 25 + } + } + } + ], + "body": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 10206, + 10210 + ], + "loc": { + "start": { + "line": 288, + "column": 29 + }, + "end": { + "line": 288, + "column": 33 + } + } + }, + "property": { + "type": "Identifier", + "name": "add", + "range": [ + 10211, + 10214 + ], + "loc": { + "start": { + "line": 288, + "column": 34 + }, + "end": { + "line": 288, + "column": 37 + } + } + }, + "range": [ + 10206, + 10214 + ], + "loc": { + "start": { + "line": 288, + "column": 29 + }, + "end": { + "line": 288, + "column": 37 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 10215, + 10216 + ], + "loc": { + "start": { + "line": 288, + "column": 38 + }, + "end": { + "line": 288, + "column": 39 + } + } + } + ], + "range": [ + 10206, + 10217 + ], + "loc": { + "start": { + "line": 288, + "column": 29 + }, + "end": { + "line": 288, + "column": 40 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 10201, + 10217 + ], + "loc": { + "start": { + "line": 288, + "column": 24 + }, + "end": { + "line": 288, + "column": 40 + } + } + } + ], + "range": [ + 10183, + 10218 + ], + "loc": { + "start": { + "line": 288, + "column": 6 + }, + "end": { + "line": 288, + "column": 41 + } + } + }, + "range": [ + 10183, + 10219 + ], + "loc": { + "start": { + "line": 288, + "column": 6 + }, + "end": { + "line": 288, + "column": 42 + } + } + } + ], + "range": [ + 10175, + 10225 + ], + "loc": { + "start": { + "line": 287, + "column": 41 + }, + "end": { + "line": 289, + "column": 5 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 10239, + 10243 + ], + "loc": { + "start": { + "line": 290, + "column": 6 + }, + "end": { + "line": 290, + "column": 10 + } + } + }, + "property": { + "type": "Identifier", + "name": "add", + "range": [ + 10244, + 10247 + ], + "loc": { + "start": { + "line": 290, + "column": 11 + }, + "end": { + "line": 290, + "column": 14 + } + } + }, + "range": [ + 10239, + 10247 + ], + "loc": { + "start": { + "line": 290, + "column": 6 + }, + "end": { + "line": 290, + "column": 14 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "root", + "range": [ + 10248, + 10252 + ], + "loc": { + "start": { + "line": 290, + "column": 15 + }, + "end": { + "line": 290, + "column": 19 + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "range": [ + 10253, + 10257 + ], + "loc": { + "start": { + "line": 290, + "column": 20 + }, + "end": { + "line": 290, + "column": 24 + } + } + }, + "range": [ + 10248, + 10257 + ], + "loc": { + "start": { + "line": 290, + "column": 15 + }, + "end": { + "line": 290, + "column": 24 + } + } + } + ], + "range": [ + 10239, + 10258 + ], + "loc": { + "start": { + "line": 290, + "column": 6 + }, + "end": { + "line": 290, + "column": 25 + } + } + }, + "range": [ + 10239, + 10259 + ], + "loc": { + "start": { + "line": 290, + "column": 6 + }, + "end": { + "line": 290, + "column": 26 + } + } + } + ], + "range": [ + 10231, + 10265 + ], + "loc": { + "start": { + "line": 289, + "column": 11 + }, + "end": { + "line": 291, + "column": 5 + } + } + }, + "range": [ + 10138, + 10265 + ], + "loc": { + "start": { + "line": 287, + "column": 4 + }, + "end": { + "line": 291, + "column": 5 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "root", + "range": [ + 10274, + 10278 + ], + "loc": { + "start": { + "line": 292, + "column": 8 + }, + "end": { + "line": 292, + "column": 12 + } + } + }, + "property": { + "type": "Identifier", + "name": "included", + "range": [ + 10279, + 10287 + ], + "loc": { + "start": { + "line": 292, + "column": 13 + }, + "end": { + "line": 292, + "column": 21 + } + } + }, + "range": [ + 10274, + 10287 + ], + "loc": { + "start": { + "line": 292, + "column": 8 + }, + "end": { + "line": 292, + "column": 21 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "root", + "range": [ + 10297, + 10301 + ], + "loc": { + "start": { + "line": 293, + "column": 6 + }, + "end": { + "line": 293, + "column": 10 + } + } + }, + "property": { + "type": "Identifier", + "name": "included", + "range": [ + 10302, + 10310 + ], + "loc": { + "start": { + "line": 293, + "column": 11 + }, + "end": { + "line": 293, + "column": 19 + } + } + }, + "range": [ + 10297, + 10310 + ], + "loc": { + "start": { + "line": 293, + "column": 6 + }, + "end": { + "line": 293, + "column": 19 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 10311, + 10318 + ], + "loc": { + "start": { + "line": 293, + "column": 20 + }, + "end": { + "line": 293, + "column": 27 + } + } + }, + "range": [ + 10297, + 10318 + ], + "loc": { + "start": { + "line": 293, + "column": 6 + }, + "end": { + "line": 293, + "column": 27 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 10319, + 10320 + ], + "loc": { + "start": { + "line": 293, + "column": 28 + }, + "end": { + "line": 293, + "column": 29 + } + } + } + ], + "body": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 10324, + 10328 + ], + "loc": { + "start": { + "line": 293, + "column": 33 + }, + "end": { + "line": 293, + "column": 37 + } + } + }, + "property": { + "type": "Identifier", + "name": "add", + "range": [ + 10329, + 10332 + ], + "loc": { + "start": { + "line": 293, + "column": 38 + }, + "end": { + "line": 293, + "column": 41 + } + } + }, + "range": [ + 10324, + 10332 + ], + "loc": { + "start": { + "line": 293, + "column": 33 + }, + "end": { + "line": 293, + "column": 41 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 10333, + 10334 + ], + "loc": { + "start": { + "line": 293, + "column": 42 + }, + "end": { + "line": 293, + "column": 43 + } + } + } + ], + "range": [ + 10324, + 10335 + ], + "loc": { + "start": { + "line": 293, + "column": 33 + }, + "end": { + "line": 293, + "column": 44 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 10319, + 10335 + ], + "loc": { + "start": { + "line": 293, + "column": 28 + }, + "end": { + "line": 293, + "column": 44 + } + } + } + ], + "range": [ + 10297, + 10336 + ], + "loc": { + "start": { + "line": 293, + "column": 6 + }, + "end": { + "line": 293, + "column": 45 + } + } + }, + "range": [ + 10297, + 10337 + ], + "loc": { + "start": { + "line": 293, + "column": 6 + }, + "end": { + "line": 293, + "column": 46 + } + } + } + ], + "range": [ + 10289, + 10343 + ], + "loc": { + "start": { + "line": 292, + "column": 23 + }, + "end": { + "line": 294, + "column": 5 + } + } + }, + "alternate": null, + "range": [ + 10270, + 10343 + ], + "loc": { + "start": { + "line": 292, + "column": 4 + }, + "end": { + "line": 294, + "column": 5 + } + } + } + ], + "range": [ + 10132, + 10347 + ], + "loc": { + "start": { + "line": 286, + "column": 13 + }, + "end": { + "line": 295, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 10125, + 10347 + ], + "loc": { + "start": { + "line": 286, + "column": 6 + }, + "end": { + "line": 295, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 10121, + 10347 + ], + "loc": { + "start": { + "line": 286, + "column": 2 + }, + "end": { + "line": 295, + "column": 3 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": "*\n * Add a JSON API response to the store. This method can be used to handle a\n * successful GET or POST response from the server.\n *\n * @since 0.1.0\n * @param {Object} root - Top Level Object to push. See:\n http://jsonapi.org/format/#document-top-level\n * @return {undefined} - Nothing.\n ", + "range": [ + 9784, + 10118 + ], + "loc": { + "start": { + "line": 277, + "column": 2 + }, + "end": { + "line": 285, + "column": 5 + } + } + } + ], + "trailingComments": [ + { + "type": "Block", + "value": "*\n * Remove a resource or collection of resources from the store.\n *\n * @since 0.1.0\n * @param {!string} type - Type of the resource(s) to remove.\n * @param {string} [id] - The id of the resource to remove. If omitted all\n * resources of the type will be removed.\n * @return {undefined} - Nothing.\n ", + "range": [ + 10351, + 10693 + ], + "loc": { + "start": { + "line": 297, + "column": 2 + }, + "end": { + "line": 305, + "column": 5 + } + } + } + ], + "static": false + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "remove", + "range": [ + 10696, + 10702 + ], + "loc": { + "start": { + "line": 306, + "column": 2 + }, + "end": { + "line": 306, + "column": 8 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "type", + "range": [ + 10703, + 10707 + ], + "loc": { + "start": { + "line": 306, + "column": 9 + }, + "end": { + "line": 306, + "column": 13 + } + } + }, + { + "type": "Identifier", + "name": "id", + "range": [ + 10709, + 10711 + ], + "loc": { + "start": { + "line": 306, + "column": 15 + }, + "end": { + "line": 306, + "column": 17 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "type", + "range": [ + 10723, + 10727 + ], + "loc": { + "start": { + "line": 307, + "column": 8 + }, + "end": { + "line": 307, + "column": 12 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 10741, + 10745 + ], + "loc": { + "start": { + "line": 308, + "column": 10 + }, + "end": { + "line": 308, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 10746, + 10752 + ], + "loc": { + "start": { + "line": 308, + "column": 15 + }, + "end": { + "line": 308, + "column": 21 + } + } + }, + "range": [ + 10741, + 10752 + ], + "loc": { + "start": { + "line": 308, + "column": 10 + }, + "end": { + "line": 308, + "column": 21 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 10753, + 10757 + ], + "loc": { + "start": { + "line": 308, + "column": 22 + }, + "end": { + "line": 308, + "column": 26 + } + } + }, + "range": [ + 10741, + 10758 + ], + "loc": { + "start": { + "line": 308, + "column": 10 + }, + "end": { + "line": 308, + "column": 27 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "id", + "range": [ + 10774, + 10776 + ], + "loc": { + "start": { + "line": 309, + "column": 12 + }, + "end": { + "line": 309, + "column": 14 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "resource", + "range": [ + 10794, + 10802 + ], + "loc": { + "start": { + "line": 310, + "column": 14 + }, + "end": { + "line": 310, + "column": 22 + } + } + }, + "init": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 10805, + 10809 + ], + "loc": { + "start": { + "line": 310, + "column": 25 + }, + "end": { + "line": 310, + "column": 29 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 10810, + 10815 + ], + "loc": { + "start": { + "line": 310, + "column": 30 + }, + "end": { + "line": 310, + "column": 35 + } + } + }, + "range": [ + 10805, + 10815 + ], + "loc": { + "start": { + "line": 310, + "column": 25 + }, + "end": { + "line": 310, + "column": 35 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 10816, + 10820 + ], + "loc": { + "start": { + "line": 310, + "column": 36 + }, + "end": { + "line": 310, + "column": 40 + } + } + }, + "range": [ + 10805, + 10821 + ], + "loc": { + "start": { + "line": 310, + "column": 25 + }, + "end": { + "line": 310, + "column": 41 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 10822, + 10824 + ], + "loc": { + "start": { + "line": 310, + "column": 42 + }, + "end": { + "line": 310, + "column": 44 + } + } + }, + "range": [ + 10805, + 10825 + ], + "loc": { + "start": { + "line": 310, + "column": 25 + }, + "end": { + "line": 310, + "column": 45 + } + } + }, + "range": [ + 10794, + 10825 + ], + "loc": { + "start": { + "line": 310, + "column": 14 + }, + "end": { + "line": 310, + "column": 45 + } + } + } + ], + "kind": "let", + "range": [ + 10790, + 10826 + ], + "loc": { + "start": { + "line": 310, + "column": 10 + }, + "end": { + "line": 310, + "column": 46 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "resource", + "range": [ + 10841, + 10849 + ], + "loc": { + "start": { + "line": 311, + "column": 14 + }, + "end": { + "line": 311, + "column": 22 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 10865, + 10869 + ], + "loc": { + "start": { + "line": 312, + "column": 12 + }, + "end": { + "line": 312, + "column": 16 + } + } + }, + "property": { + "type": "Identifier", + "name": "_remove", + "range": [ + 10870, + 10877 + ], + "loc": { + "start": { + "line": 312, + "column": 17 + }, + "end": { + "line": 312, + "column": 24 + } + } + }, + "range": [ + 10865, + 10877 + ], + "loc": { + "start": { + "line": 312, + "column": 12 + }, + "end": { + "line": 312, + "column": 24 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "resource", + "range": [ + 10878, + 10886 + ], + "loc": { + "start": { + "line": 312, + "column": 25 + }, + "end": { + "line": 312, + "column": 33 + } + } + } + ], + "range": [ + 10865, + 10887 + ], + "loc": { + "start": { + "line": 312, + "column": 12 + }, + "end": { + "line": 312, + "column": 34 + } + } + }, + "range": [ + 10865, + 10888 + ], + "loc": { + "start": { + "line": 312, + "column": 12 + }, + "end": { + "line": 312, + "column": 35 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 10905, + 10909 + ], + "loc": { + "start": { + "line": 313, + "column": 16 + }, + "end": { + "line": 313, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 10910, + 10928 + ], + "loc": { + "start": { + "line": 313, + "column": 21 + }, + "end": { + "line": 313, + "column": 39 + } + } + }, + "range": [ + 10905, + 10928 + ], + "loc": { + "start": { + "line": 313, + "column": 16 + }, + "end": { + "line": 313, + "column": 39 + } + } + }, + "property": { + "type": "Literal", + "value": "removed", + "raw": "\"removed\"", + "range": [ + 10929, + 10938 + ], + "loc": { + "start": { + "line": 313, + "column": 40 + }, + "end": { + "line": 313, + "column": 49 + } + } + }, + "range": [ + 10905, + 10939 + ], + "loc": { + "start": { + "line": 313, + "column": 16 + }, + "end": { + "line": 313, + "column": 50 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 10940, + 10944 + ], + "loc": { + "start": { + "line": 313, + "column": 51 + }, + "end": { + "line": 313, + "column": 55 + } + } + }, + "range": [ + 10905, + 10945 + ], + "loc": { + "start": { + "line": 313, + "column": 16 + }, + "end": { + "line": 313, + "column": 56 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 10949, + 10953 + ], + "loc": { + "start": { + "line": 313, + "column": 60 + }, + "end": { + "line": 313, + "column": 64 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 10954, + 10972 + ], + "loc": { + "start": { + "line": 313, + "column": 65 + }, + "end": { + "line": 313, + "column": 83 + } + } + }, + "range": [ + 10949, + 10972 + ], + "loc": { + "start": { + "line": 313, + "column": 60 + }, + "end": { + "line": 313, + "column": 83 + } + } + }, + "property": { + "type": "Literal", + "value": "removed", + "raw": "\"removed\"", + "range": [ + 10973, + 10982 + ], + "loc": { + "start": { + "line": 313, + "column": 84 + }, + "end": { + "line": 313, + "column": 93 + } + } + }, + "range": [ + 10949, + 10983 + ], + "loc": { + "start": { + "line": 313, + "column": 60 + }, + "end": { + "line": 313, + "column": 94 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 10984, + 10988 + ], + "loc": { + "start": { + "line": 313, + "column": 95 + }, + "end": { + "line": 313, + "column": 99 + } + } + }, + "range": [ + 10949, + 10989 + ], + "loc": { + "start": { + "line": 313, + "column": 60 + }, + "end": { + "line": 313, + "column": 100 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 10990, + 10992 + ], + "loc": { + "start": { + "line": 313, + "column": 101 + }, + "end": { + "line": 313, + "column": 103 + } + } + }, + "range": [ + 10949, + 10993 + ], + "loc": { + "start": { + "line": 313, + "column": 60 + }, + "end": { + "line": 313, + "column": 104 + } + } + }, + "range": [ + 10905, + 10993 + ], + "loc": { + "start": { + "line": 313, + "column": 16 + }, + "end": { + "line": 313, + "column": 104 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 11012, + 11016 + ], + "loc": { + "start": { + "line": 314, + "column": 15 + }, + "end": { + "line": 314, + "column": 19 + } + } + }, + "property": { + "type": "Identifier", + "name": "_resourceListeners", + "range": [ + 11017, + 11035 + ], + "loc": { + "start": { + "line": 314, + "column": 20 + }, + "end": { + "line": 314, + "column": 38 + } + } + }, + "range": [ + 11012, + 11035 + ], + "loc": { + "start": { + "line": 314, + "column": 15 + }, + "end": { + "line": 314, + "column": 38 + } + } + }, + "property": { + "type": "Literal", + "value": "removed", + "raw": "\"removed\"", + "range": [ + 11036, + 11045 + ], + "loc": { + "start": { + "line": 314, + "column": 39 + }, + "end": { + "line": 314, + "column": 48 + } + } + }, + "range": [ + 11012, + 11046 + ], + "loc": { + "start": { + "line": 314, + "column": 15 + }, + "end": { + "line": 314, + "column": 49 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 11047, + 11051 + ], + "loc": { + "start": { + "line": 314, + "column": 50 + }, + "end": { + "line": 314, + "column": 54 + } + } + }, + "range": [ + 11012, + 11052 + ], + "loc": { + "start": { + "line": 314, + "column": 15 + }, + "end": { + "line": 314, + "column": 55 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 11053, + 11055 + ], + "loc": { + "start": { + "line": 314, + "column": 56 + }, + "end": { + "line": 314, + "column": 58 + } + } + }, + "range": [ + 11012, + 11056 + ], + "loc": { + "start": { + "line": 314, + "column": 15 + }, + "end": { + "line": 314, + "column": 59 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 11057, + 11064 + ], + "loc": { + "start": { + "line": 314, + "column": 60 + }, + "end": { + "line": 314, + "column": 67 + } + } + }, + "range": [ + 11012, + 11064 + ], + "loc": { + "start": { + "line": 314, + "column": 15 + }, + "end": { + "line": 314, + "column": 67 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 11065, + 11066 + ], + "loc": { + "start": { + "line": 314, + "column": 68 + }, + "end": { + "line": 314, + "column": 69 + } + } + } + ], + "body": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 11070, + 11071 + ], + "loc": { + "start": { + "line": 314, + "column": 73 + }, + "end": { + "line": 314, + "column": 74 + } + } + }, + "property": { + "type": "Literal", + "value": 0, + "raw": "0", + "range": [ + 11072, + 11073 + ], + "loc": { + "start": { + "line": 314, + "column": 75 + }, + "end": { + "line": 314, + "column": 76 + } + } + }, + "range": [ + 11070, + 11074 + ], + "loc": { + "start": { + "line": 314, + "column": 73 + }, + "end": { + "line": 314, + "column": 77 + } + } + }, + "property": { + "type": "Identifier", + "name": "call", + "range": [ + 11075, + 11079 + ], + "loc": { + "start": { + "line": 314, + "column": 78 + }, + "end": { + "line": 314, + "column": 82 + } + } + }, + "range": [ + 11070, + 11079 + ], + "loc": { + "start": { + "line": 314, + "column": 73 + }, + "end": { + "line": 314, + "column": 82 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 11080, + 11081 + ], + "loc": { + "start": { + "line": 314, + "column": 83 + }, + "end": { + "line": 314, + "column": 84 + } + } + }, + "property": { + "type": "Literal", + "value": 1, + "raw": "1", + "range": [ + 11082, + 11083 + ], + "loc": { + "start": { + "line": 314, + "column": 85 + }, + "end": { + "line": 314, + "column": 86 + } + } + }, + "range": [ + 11080, + 11084 + ], + "loc": { + "start": { + "line": 314, + "column": 83 + }, + "end": { + "line": 314, + "column": 87 + } + } + }, + { + "type": "Identifier", + "name": "resource", + "range": [ + 11086, + 11094 + ], + "loc": { + "start": { + "line": 314, + "column": 89 + }, + "end": { + "line": 314, + "column": 97 + } + } + } + ], + "range": [ + 11070, + 11095 + ], + "loc": { + "start": { + "line": 314, + "column": 73 + }, + "end": { + "line": 314, + "column": 98 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 11065, + 11095 + ], + "loc": { + "start": { + "line": 314, + "column": 68 + }, + "end": { + "line": 314, + "column": 98 + } + } + } + ], + "range": [ + 11012, + 11096 + ], + "loc": { + "start": { + "line": 314, + "column": 15 + }, + "end": { + "line": 314, + "column": 99 + } + } + }, + "range": [ + 11012, + 11097 + ], + "loc": { + "start": { + "line": 314, + "column": 15 + }, + "end": { + "line": 314, + "column": 100 + } + } + } + ], + "range": [ + 10995, + 11111 + ], + "loc": { + "start": { + "line": 313, + "column": 106 + }, + "end": { + "line": 315, + "column": 13 + } + } + }, + "alternate": null, + "range": [ + 10901, + 11111 + ], + "loc": { + "start": { + "line": 313, + "column": 12 + }, + "end": { + "line": 315, + "column": 13 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 11128, + 11132 + ], + "loc": { + "start": { + "line": 316, + "column": 16 + }, + "end": { + "line": 316, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 11133, + 11153 + ], + "loc": { + "start": { + "line": 316, + "column": 21 + }, + "end": { + "line": 316, + "column": 41 + } + } + }, + "range": [ + 11128, + 11153 + ], + "loc": { + "start": { + "line": 316, + "column": 16 + }, + "end": { + "line": 316, + "column": 41 + } + } + }, + "property": { + "type": "Literal", + "value": "removed", + "raw": "\"removed\"", + "range": [ + 11154, + 11163 + ], + "loc": { + "start": { + "line": 316, + "column": 42 + }, + "end": { + "line": 316, + "column": 51 + } + } + }, + "range": [ + 11128, + 11164 + ], + "loc": { + "start": { + "line": 316, + "column": 16 + }, + "end": { + "line": 316, + "column": 52 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 11165, + 11169 + ], + "loc": { + "start": { + "line": 316, + "column": 53 + }, + "end": { + "line": 316, + "column": 57 + } + } + }, + "range": [ + 11128, + 11170 + ], + "loc": { + "start": { + "line": 316, + "column": 16 + }, + "end": { + "line": 316, + "column": 58 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 11188, + 11192 + ], + "loc": { + "start": { + "line": 317, + "column": 14 + }, + "end": { + "line": 317, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "_collectionListeners", + "range": [ + 11193, + 11213 + ], + "loc": { + "start": { + "line": 317, + "column": 19 + }, + "end": { + "line": 317, + "column": 39 + } + } + }, + "range": [ + 11188, + 11213 + ], + "loc": { + "start": { + "line": 317, + "column": 14 + }, + "end": { + "line": 317, + "column": 39 + } + } + }, + "property": { + "type": "Literal", + "value": "removed", + "raw": "\"removed\"", + "range": [ + 11214, + 11223 + ], + "loc": { + "start": { + "line": 317, + "column": 40 + }, + "end": { + "line": 317, + "column": 49 + } + } + }, + "range": [ + 11188, + 11224 + ], + "loc": { + "start": { + "line": 317, + "column": 14 + }, + "end": { + "line": 317, + "column": 50 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 11225, + 11229 + ], + "loc": { + "start": { + "line": 317, + "column": 51 + }, + "end": { + "line": 317, + "column": 55 + } + } + }, + "range": [ + 11188, + 11230 + ], + "loc": { + "start": { + "line": 317, + "column": 14 + }, + "end": { + "line": 317, + "column": 56 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 11231, + 11238 + ], + "loc": { + "start": { + "line": 317, + "column": 57 + }, + "end": { + "line": 317, + "column": 64 + } + } + }, + "range": [ + 11188, + 11238 + ], + "loc": { + "start": { + "line": 317, + "column": 14 + }, + "end": { + "line": 317, + "column": 64 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 11239, + 11240 + ], + "loc": { + "start": { + "line": 317, + "column": 65 + }, + "end": { + "line": 317, + "column": 66 + } + } + } + ], + "body": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 11244, + 11245 + ], + "loc": { + "start": { + "line": 317, + "column": 70 + }, + "end": { + "line": 317, + "column": 71 + } + } + }, + "property": { + "type": "Literal", + "value": 0, + "raw": "0", + "range": [ + 11246, + 11247 + ], + "loc": { + "start": { + "line": 317, + "column": 72 + }, + "end": { + "line": 317, + "column": 73 + } + } + }, + "range": [ + 11244, + 11248 + ], + "loc": { + "start": { + "line": 317, + "column": 70 + }, + "end": { + "line": 317, + "column": 74 + } + } + }, + "property": { + "type": "Identifier", + "name": "call", + "range": [ + 11249, + 11253 + ], + "loc": { + "start": { + "line": 317, + "column": 75 + }, + "end": { + "line": 317, + "column": 79 + } + } + }, + "range": [ + 11244, + 11253 + ], + "loc": { + "start": { + "line": 317, + "column": 70 + }, + "end": { + "line": 317, + "column": 79 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "x", + "range": [ + 11254, + 11255 + ], + "loc": { + "start": { + "line": 317, + "column": 80 + }, + "end": { + "line": 317, + "column": 81 + } + } + }, + "property": { + "type": "Literal", + "value": 1, + "raw": "1", + "range": [ + 11256, + 11257 + ], + "loc": { + "start": { + "line": 317, + "column": 82 + }, + "end": { + "line": 317, + "column": 83 + } + } + }, + "range": [ + 11254, + 11258 + ], + "loc": { + "start": { + "line": 317, + "column": 80 + }, + "end": { + "line": 317, + "column": 84 + } + } + }, + { + "type": "Identifier", + "name": "resource", + "range": [ + 11260, + 11268 + ], + "loc": { + "start": { + "line": 317, + "column": 86 + }, + "end": { + "line": 317, + "column": 94 + } + } + } + ], + "range": [ + 11244, + 11269 + ], + "loc": { + "start": { + "line": 317, + "column": 70 + }, + "end": { + "line": 317, + "column": 95 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 11239, + 11269 + ], + "loc": { + "start": { + "line": 317, + "column": 65 + }, + "end": { + "line": 317, + "column": 95 + } + } + } + ], + "range": [ + 11188, + 11270 + ], + "loc": { + "start": { + "line": 317, + "column": 14 + }, + "end": { + "line": 317, + "column": 96 + } + } + }, + "range": [ + 11188, + 11271 + ], + "loc": { + "start": { + "line": 317, + "column": 14 + }, + "end": { + "line": 317, + "column": 97 + } + } + } + ], + "range": [ + 11172, + 11285 + ], + "loc": { + "start": { + "line": 316, + "column": 60 + }, + "end": { + "line": 318, + "column": 13 + } + } + }, + "alternate": null, + "range": [ + 11124, + 11285 + ], + "loc": { + "start": { + "line": 316, + "column": 12 + }, + "end": { + "line": 318, + "column": 13 + } + } + } + ], + "range": [ + 10851, + 11297 + ], + "loc": { + "start": { + "line": 311, + "column": 24 + }, + "end": { + "line": 319, + "column": 11 + } + } + }, + "alternate": null, + "range": [ + 10837, + 11297 + ], + "loc": { + "start": { + "line": 311, + "column": 10 + }, + "end": { + "line": 319, + "column": 11 + } + } + } + ], + "range": [ + 10778, + 11307 + ], + "loc": { + "start": { + "line": 309, + "column": 16 + }, + "end": { + "line": 320, + "column": 9 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "Object", + "range": [ + 11325, + 11331 + ], + "loc": { + "start": { + "line": 321, + "column": 10 + }, + "end": { + "line": 321, + "column": 16 + } + } + }, + "property": { + "type": "Identifier", + "name": "keys", + "range": [ + 11332, + 11336 + ], + "loc": { + "start": { + "line": 321, + "column": 17 + }, + "end": { + "line": 321, + "column": 21 + } + } + }, + "range": [ + 11325, + 11336 + ], + "loc": { + "start": { + "line": 321, + "column": 10 + }, + "end": { + "line": 321, + "column": 21 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 11337, + 11341 + ], + "loc": { + "start": { + "line": 321, + "column": 22 + }, + "end": { + "line": 321, + "column": 26 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 11342, + 11347 + ], + "loc": { + "start": { + "line": 321, + "column": 27 + }, + "end": { + "line": 321, + "column": 32 + } + } + }, + "range": [ + 11337, + 11347 + ], + "loc": { + "start": { + "line": 321, + "column": 22 + }, + "end": { + "line": 321, + "column": 32 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 11348, + 11352 + ], + "loc": { + "start": { + "line": 321, + "column": 33 + }, + "end": { + "line": 321, + "column": 37 + } + } + }, + "range": [ + 11337, + 11353 + ], + "loc": { + "start": { + "line": 321, + "column": 22 + }, + "end": { + "line": 321, + "column": 38 + } + } + } + ], + "range": [ + 11325, + 11354 + ], + "loc": { + "start": { + "line": 321, + "column": 10 + }, + "end": { + "line": 321, + "column": 39 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 11355, + 11362 + ], + "loc": { + "start": { + "line": 321, + "column": 40 + }, + "end": { + "line": 321, + "column": 47 + } + } + }, + "range": [ + 11325, + 11362 + ], + "loc": { + "start": { + "line": 321, + "column": 10 + }, + "end": { + "line": 321, + "column": 47 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "id", + "range": [ + 11363, + 11365 + ], + "loc": { + "start": { + "line": 321, + "column": 48 + }, + "end": { + "line": 321, + "column": 50 + } + } + } + ], + "body": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 11369, + 11373 + ], + "loc": { + "start": { + "line": 321, + "column": 54 + }, + "end": { + "line": 321, + "column": 58 + } + } + }, + "property": { + "type": "Identifier", + "name": "remove", + "range": [ + 11374, + 11380 + ], + "loc": { + "start": { + "line": 321, + "column": 59 + }, + "end": { + "line": 321, + "column": 65 + } + } + }, + "range": [ + 11369, + 11380 + ], + "loc": { + "start": { + "line": 321, + "column": 54 + }, + "end": { + "line": 321, + "column": 65 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "type", + "range": [ + 11381, + 11385 + ], + "loc": { + "start": { + "line": 321, + "column": 66 + }, + "end": { + "line": 321, + "column": 70 + } + } + }, + { + "type": "Identifier", + "name": "id", + "range": [ + 11387, + 11389 + ], + "loc": { + "start": { + "line": 321, + "column": 72 + }, + "end": { + "line": 321, + "column": 74 + } + } + } + ], + "range": [ + 11369, + 11390 + ], + "loc": { + "start": { + "line": 321, + "column": 54 + }, + "end": { + "line": 321, + "column": 75 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 11363, + 11390 + ], + "loc": { + "start": { + "line": 321, + "column": 48 + }, + "end": { + "line": 321, + "column": 75 + } + } + } + ], + "range": [ + 11325, + 11391 + ], + "loc": { + "start": { + "line": 321, + "column": 10 + }, + "end": { + "line": 321, + "column": 76 + } + } + }, + "range": [ + 11325, + 11392 + ], + "loc": { + "start": { + "line": 321, + "column": 10 + }, + "end": { + "line": 321, + "column": 77 + } + } + } + ], + "range": [ + 11313, + 11402 + ], + "loc": { + "start": { + "line": 320, + "column": 15 + }, + "end": { + "line": 322, + "column": 9 + } + } + }, + "range": [ + 10770, + 11402 + ], + "loc": { + "start": { + "line": 309, + "column": 8 + }, + "end": { + "line": 322, + "column": 9 + } + } + } + ], + "range": [ + 10760, + 11410 + ], + "loc": { + "start": { + "line": 308, + "column": 29 + }, + "end": { + "line": 323, + "column": 7 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "TypeError", + "range": [ + 11436, + 11445 + ], + "loc": { + "start": { + "line": 324, + "column": 18 + }, + "end": { + "line": 324, + "column": 27 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "Unknown type '", + "cooked": "Unknown type '" + }, + "tail": false, + "range": [ + 11446, + 11463 + ], + "loc": { + "start": { + "line": 324, + "column": 28 + }, + "end": { + "line": 324, + "column": 45 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "'", + "cooked": "'" + }, + "tail": true, + "range": [ + 11467, + 11470 + ], + "loc": { + "start": { + "line": 324, + "column": 49 + }, + "end": { + "line": 324, + "column": 52 + } + } + } + ], + "expressions": [ + { + "type": "Identifier", + "name": "type", + "range": [ + 11463, + 11467 + ], + "loc": { + "start": { + "line": 324, + "column": 45 + }, + "end": { + "line": 324, + "column": 49 + } + } + } + ], + "range": [ + 11446, + 11470 + ], + "loc": { + "start": { + "line": 324, + "column": 28 + }, + "end": { + "line": 324, + "column": 52 + } + } + } + ], + "range": [ + 11432, + 11471 + ], + "loc": { + "start": { + "line": 324, + "column": 14 + }, + "end": { + "line": 324, + "column": 53 + } + } + }, + "range": [ + 11426, + 11472 + ], + "loc": { + "start": { + "line": 324, + "column": 8 + }, + "end": { + "line": 324, + "column": 54 + } + } + } + ], + "range": [ + 11416, + 11480 + ], + "loc": { + "start": { + "line": 323, + "column": 13 + }, + "end": { + "line": 325, + "column": 7 + } + } + }, + "range": [ + 10737, + 11480 + ], + "loc": { + "start": { + "line": 308, + "column": 6 + }, + "end": { + "line": 325, + "column": 7 + } + } + } + ], + "range": [ + 10729, + 11486 + ], + "loc": { + "start": { + "line": 307, + "column": 14 + }, + "end": { + "line": 326, + "column": 5 + } + } + }, + "alternate": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "TypeError", + "range": [ + 11510, + 11519 + ], + "loc": { + "start": { + "line": 327, + "column": 16 + }, + "end": { + "line": 327, + "column": 25 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "You must provide a type to remove", + "cooked": "You must provide a type to remove" + }, + "tail": true, + "range": [ + 11520, + 11555 + ], + "loc": { + "start": { + "line": 327, + "column": 26 + }, + "end": { + "line": 327, + "column": 61 + } + } + } + ], + "expressions": [], + "range": [ + 11520, + 11555 + ], + "loc": { + "start": { + "line": 327, + "column": 26 + }, + "end": { + "line": 327, + "column": 61 + } + } + } + ], + "range": [ + 11506, + 11556 + ], + "loc": { + "start": { + "line": 327, + "column": 12 + }, + "end": { + "line": 327, + "column": 62 + } + } + }, + "range": [ + 11500, + 11557 + ], + "loc": { + "start": { + "line": 327, + "column": 6 + }, + "end": { + "line": 327, + "column": 63 + } + } + } + ], + "range": [ + 11492, + 11563 + ], + "loc": { + "start": { + "line": 326, + "column": 11 + }, + "end": { + "line": 328, + "column": 5 + } + } + }, + "range": [ + 10719, + 11563 + ], + "loc": { + "start": { + "line": 307, + "column": 4 + }, + "end": { + "line": 328, + "column": 5 + } + } + } + ], + "range": [ + 10713, + 11567 + ], + "loc": { + "start": { + "line": 306, + "column": 19 + }, + "end": { + "line": 329, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 10702, + 11567 + ], + "loc": { + "start": { + "line": 306, + "column": 8 + }, + "end": { + "line": 329, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 10696, + 11567 + ], + "loc": { + "start": { + "line": 306, + "column": 2 + }, + "end": { + "line": 329, + "column": 3 + } + }, + "leadingComments": [ + { + "type": "Block", + "value": "*\n * Remove a resource or collection of resources from the store.\n *\n * @since 0.1.0\n * @param {!string} type - Type of the resource(s) to remove.\n * @param {string} [id] - The id of the resource to remove. If omitted all\n * resources of the type will be removed.\n * @return {undefined} - Nothing.\n ", + "range": [ + 10351, + 10693 + ], + "loc": { + "start": { + "line": 297, + "column": 2 + }, + "end": { + "line": 305, + "column": 5 + } + } + } + ], + "static": false + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_addField", + "range": [ + 11571, + 11580 + ], + "loc": { + "start": { + "line": 331, + "column": 2 + }, + "end": { + "line": 331, + "column": 11 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "object", + "range": [ + 11581, + 11587 + ], + "loc": { + "start": { + "line": 331, + "column": 12 + }, + "end": { + "line": 331, + "column": 18 + } + } + }, + { + "type": "Identifier", + "name": "resource", + "range": [ + 11589, + 11597 + ], + "loc": { + "start": { + "line": 331, + "column": 20 + }, + "end": { + "line": 331, + "column": 28 + } + } + }, + { + "type": "Identifier", + "name": "definition", + "range": [ + 11599, + 11609 + ], + "loc": { + "start": { + "line": 331, + "column": 30 + }, + "end": { + "line": 331, + "column": 40 + } + } + }, + { + "type": "Identifier", + "name": "fieldName", + "range": [ + 11611, + 11620 + ], + "loc": { + "start": { + "line": 331, + "column": 42 + }, + "end": { + "line": 331, + "column": 51 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "field", + "range": [ + 11632, + 11637 + ], + "loc": { + "start": { + "line": 332, + "column": 8 + }, + "end": { + "line": 332, + "column": 13 + } + } + }, + "init": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "definition", + "range": [ + 11640, + 11650 + ], + "loc": { + "start": { + "line": 332, + "column": 16 + }, + "end": { + "line": 332, + "column": 26 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 11651, + 11660 + ], + "loc": { + "start": { + "line": 332, + "column": 27 + }, + "end": { + "line": 332, + "column": 36 + } + } + }, + "range": [ + 11640, + 11661 + ], + "loc": { + "start": { + "line": 332, + "column": 16 + }, + "end": { + "line": 332, + "column": 37 + } + } + }, + "range": [ + 11632, + 11661 + ], + "loc": { + "start": { + "line": 332, + "column": 8 + }, + "end": { + "line": 332, + "column": 37 + } + } + } + ], + "kind": "var", + "range": [ + 11628, + 11662 + ], + "loc": { + "start": { + "line": 332, + "column": 4 + }, + "end": { + "line": 332, + "column": 38 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "newValue", + "range": [ + 11671, + 11679 + ], + "loc": { + "start": { + "line": 333, + "column": 8 + }, + "end": { + "line": 333, + "column": 16 + } + } + }, + "init": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "field", + "range": [ + 11682, + 11687 + ], + "loc": { + "start": { + "line": 333, + "column": 19 + }, + "end": { + "line": 333, + "column": 24 + } + } + }, + "property": { + "type": "Identifier", + "name": "deserialize", + "range": [ + 11688, + 11699 + ], + "loc": { + "start": { + "line": 333, + "column": 25 + }, + "end": { + "line": 333, + "column": 36 + } + } + }, + "range": [ + 11682, + 11699 + ], + "loc": { + "start": { + "line": 333, + "column": 19 + }, + "end": { + "line": 333, + "column": 36 + } + } + }, + "property": { + "type": "Identifier", + "name": "call", + "range": [ + 11700, + 11704 + ], + "loc": { + "start": { + "line": 333, + "column": 37 + }, + "end": { + "line": 333, + "column": 41 + } + } + }, + "range": [ + 11682, + 11704 + ], + "loc": { + "start": { + "line": 333, + "column": 19 + }, + "end": { + "line": 333, + "column": 41 + } + } + }, + "arguments": [ + { + "type": "ThisExpression", + "range": [ + 11705, + 11709 + ], + "loc": { + "start": { + "line": 333, + "column": 42 + }, + "end": { + "line": 333, + "column": 46 + } + } + }, + { + "type": "Identifier", + "name": "object", + "range": [ + 11711, + 11717 + ], + "loc": { + "start": { + "line": 333, + "column": 48 + }, + "end": { + "line": 333, + "column": 54 + } + } + }, + { + "type": "Identifier", + "name": "fieldName", + "range": [ + 11719, + 11728 + ], + "loc": { + "start": { + "line": 333, + "column": 56 + }, + "end": { + "line": 333, + "column": 65 + } + } + } + ], + "range": [ + 11682, + 11729 + ], + "loc": { + "start": { + "line": 333, + "column": 19 + }, + "end": { + "line": 333, + "column": 66 + } + } + }, + "range": [ + 11671, + 11729 + ], + "loc": { + "start": { + "line": 333, + "column": 8 + }, + "end": { + "line": 333, + "column": 66 + } + } + } + ], + "kind": "var", + "range": [ + 11667, + 11730 + ], + "loc": { + "start": { + "line": 333, + "column": 4 + }, + "end": { + "line": 333, + "column": 67 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "!==", + "left": { + "type": "UnaryExpression", + "operator": "typeof", + "argument": { + "type": "Identifier", + "name": "newValue", + "range": [ + 11746, + 11754 + ], + "loc": { + "start": { + "line": 334, + "column": 15 + }, + "end": { + "line": 334, + "column": 23 + } + } + }, + "prefix": true, + "range": [ + 11739, + 11754 + ], + "loc": { + "start": { + "line": 334, + "column": 8 + }, + "end": { + "line": 334, + "column": 23 + } + } + }, + "right": { + "type": "Literal", + "value": "undefined", + "raw": "\"undefined\"", + "range": [ + 11759, + 11770 + ], + "loc": { + "start": { + "line": 334, + "column": 28 + }, + "end": { + "line": 334, + "column": 39 + } + } + }, + "range": [ + 11739, + 11770 + ], + "loc": { + "start": { + "line": 334, + "column": 8 + }, + "end": { + "line": 334, + "column": 39 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "field", + "range": [ + 11784, + 11789 + ], + "loc": { + "start": { + "line": 335, + "column": 10 + }, + "end": { + "line": 335, + "column": 15 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 11790, + 11794 + ], + "loc": { + "start": { + "line": 335, + "column": 16 + }, + "end": { + "line": 335, + "column": 20 + } + } + }, + "range": [ + 11784, + 11794 + ], + "loc": { + "start": { + "line": 335, + "column": 10 + }, + "end": { + "line": 335, + "column": 20 + } + } + }, + "right": { + "type": "Literal", + "value": "has-one", + "raw": "\"has-one\"", + "range": [ + 11799, + 11808 + ], + "loc": { + "start": { + "line": 335, + "column": 25 + }, + "end": { + "line": 335, + "column": 34 + } + } + }, + "range": [ + 11784, + 11808 + ], + "loc": { + "start": { + "line": 335, + "column": 10 + }, + "end": { + "line": 335, + "column": 34 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "resource", + "range": [ + 11824, + 11832 + ], + "loc": { + "start": { + "line": 336, + "column": 12 + }, + "end": { + "line": 336, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 11833, + 11842 + ], + "loc": { + "start": { + "line": 336, + "column": 21 + }, + "end": { + "line": 336, + "column": 30 + } + } + }, + "range": [ + 11824, + 11843 + ], + "loc": { + "start": { + "line": 336, + "column": 12 + }, + "end": { + "line": 336, + "column": 31 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 11857, + 11861 + ], + "loc": { + "start": { + "line": 337, + "column": 10 + }, + "end": { + "line": 337, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "_removeInverseRelationship", + "range": [ + 11862, + 11888 + ], + "loc": { + "start": { + "line": 337, + "column": 15 + }, + "end": { + "line": 337, + "column": 41 + } + } + }, + "range": [ + 11857, + 11888 + ], + "loc": { + "start": { + "line": 337, + "column": 10 + }, + "end": { + "line": 337, + "column": 41 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "resource", + "range": [ + 11889, + 11897 + ], + "loc": { + "start": { + "line": 337, + "column": 42 + }, + "end": { + "line": 337, + "column": 50 + } + } + }, + { + "type": "Identifier", + "name": "fieldName", + "range": [ + 11899, + 11908 + ], + "loc": { + "start": { + "line": 337, + "column": 52 + }, + "end": { + "line": 337, + "column": 61 + } + } + }, + { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "resource", + "range": [ + 11910, + 11918 + ], + "loc": { + "start": { + "line": 337, + "column": 63 + }, + "end": { + "line": 337, + "column": 71 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 11919, + 11928 + ], + "loc": { + "start": { + "line": 337, + "column": 72 + }, + "end": { + "line": 337, + "column": 81 + } + } + }, + "range": [ + 11910, + 11929 + ], + "loc": { + "start": { + "line": 337, + "column": 63 + }, + "end": { + "line": 337, + "column": 82 + } + } + }, + { + "type": "Identifier", + "name": "field", + "range": [ + 11931, + 11936 + ], + "loc": { + "start": { + "line": 337, + "column": 84 + }, + "end": { + "line": 337, + "column": 89 + } + } + } + ], + "range": [ + 11857, + 11937 + ], + "loc": { + "start": { + "line": 337, + "column": 10 + }, + "end": { + "line": 337, + "column": 90 + } + } + }, + "range": [ + 11857, + 11938 + ], + "loc": { + "start": { + "line": 337, + "column": 10 + }, + "end": { + "line": 337, + "column": 91 + } + } + } + ], + "range": [ + 11845, + 11948 + ], + "loc": { + "start": { + "line": 336, + "column": 33 + }, + "end": { + "line": 338, + "column": 9 + } + } + }, + "alternate": null, + "range": [ + 11820, + 11948 + ], + "loc": { + "start": { + "line": 336, + "column": 8 + }, + "end": { + "line": 338, + "column": 9 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "newValue", + "range": [ + 11961, + 11969 + ], + "loc": { + "start": { + "line": 339, + "column": 12 + }, + "end": { + "line": 339, + "column": 20 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 11983, + 11987 + ], + "loc": { + "start": { + "line": 340, + "column": 10 + }, + "end": { + "line": 340, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "_addInverseRelationship", + "range": [ + 11988, + 12011 + ], + "loc": { + "start": { + "line": 340, + "column": 15 + }, + "end": { + "line": 340, + "column": 38 + } + } + }, + "range": [ + 11983, + 12011 + ], + "loc": { + "start": { + "line": 340, + "column": 10 + }, + "end": { + "line": 340, + "column": 38 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "resource", + "range": [ + 12012, + 12020 + ], + "loc": { + "start": { + "line": 340, + "column": 39 + }, + "end": { + "line": 340, + "column": 47 + } + } + }, + { + "type": "Identifier", + "name": "fieldName", + "range": [ + 12022, + 12031 + ], + "loc": { + "start": { + "line": 340, + "column": 49 + }, + "end": { + "line": 340, + "column": 58 + } + } + }, + { + "type": "Identifier", + "name": "newValue", + "range": [ + 12033, + 12041 + ], + "loc": { + "start": { + "line": 340, + "column": 60 + }, + "end": { + "line": 340, + "column": 68 + } + } + }, + { + "type": "Identifier", + "name": "field", + "range": [ + 12043, + 12048 + ], + "loc": { + "start": { + "line": 340, + "column": 70 + }, + "end": { + "line": 340, + "column": 75 + } + } + } + ], + "range": [ + 11983, + 12049 + ], + "loc": { + "start": { + "line": 340, + "column": 10 + }, + "end": { + "line": 340, + "column": 76 + } + } + }, + "range": [ + 11983, + 12050 + ], + "loc": { + "start": { + "line": 340, + "column": 10 + }, + "end": { + "line": 340, + "column": 77 + } + } + } + ], + "range": [ + 11971, + 12060 + ], + "loc": { + "start": { + "line": 339, + "column": 22 + }, + "end": { + "line": 341, + "column": 9 + } + } + }, + "alternate": null, + "range": [ + 11957, + 12060 + ], + "loc": { + "start": { + "line": 339, + "column": 8 + }, + "end": { + "line": 341, + "column": 9 + } + } + } + ], + "range": [ + 11810, + 12068 + ], + "loc": { + "start": { + "line": 335, + "column": 36 + }, + "end": { + "line": 342, + "column": 7 + } + } + }, + "alternate": { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "field", + "range": [ + 12078, + 12083 + ], + "loc": { + "start": { + "line": 342, + "column": 17 + }, + "end": { + "line": 342, + "column": 22 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 12084, + 12088 + ], + "loc": { + "start": { + "line": 342, + "column": 23 + }, + "end": { + "line": 342, + "column": 27 + } + } + }, + "range": [ + 12078, + 12088 + ], + "loc": { + "start": { + "line": 342, + "column": 17 + }, + "end": { + "line": 342, + "column": 27 + } + } + }, + "right": { + "type": "Literal", + "value": "has-many", + "raw": "\"has-many\"", + "range": [ + 12093, + 12103 + ], + "loc": { + "start": { + "line": 342, + "column": 32 + }, + "end": { + "line": 342, + "column": 42 + } + } + }, + "range": [ + 12078, + 12103 + ], + "loc": { + "start": { + "line": 342, + "column": 17 + }, + "end": { + "line": 342, + "column": 42 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "resource", + "range": [ + 12115, + 12123 + ], + "loc": { + "start": { + "line": 343, + "column": 8 + }, + "end": { + "line": 343, + "column": 16 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 12124, + 12133 + ], + "loc": { + "start": { + "line": 343, + "column": 17 + }, + "end": { + "line": 343, + "column": 26 + } + } + }, + "range": [ + 12115, + 12134 + ], + "loc": { + "start": { + "line": 343, + "column": 8 + }, + "end": { + "line": 343, + "column": 27 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 12135, + 12142 + ], + "loc": { + "start": { + "line": 343, + "column": 28 + }, + "end": { + "line": 343, + "column": 35 + } + } + }, + "range": [ + 12115, + 12142 + ], + "loc": { + "start": { + "line": 343, + "column": 8 + }, + "end": { + "line": 343, + "column": 35 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "r", + "range": [ + 12143, + 12144 + ], + "loc": { + "start": { + "line": 343, + "column": 36 + }, + "end": { + "line": 343, + "column": 37 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "!==", + "left": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "resource", + "range": [ + 12164, + 12172 + ], + "loc": { + "start": { + "line": 344, + "column": 14 + }, + "end": { + "line": 344, + "column": 22 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 12173, + 12182 + ], + "loc": { + "start": { + "line": 344, + "column": 23 + }, + "end": { + "line": 344, + "column": 32 + } + } + }, + "range": [ + 12164, + 12183 + ], + "loc": { + "start": { + "line": 344, + "column": 14 + }, + "end": { + "line": 344, + "column": 33 + } + } + }, + "property": { + "type": "Identifier", + "name": "indexOf", + "range": [ + 12184, + 12191 + ], + "loc": { + "start": { + "line": 344, + "column": 34 + }, + "end": { + "line": 344, + "column": 41 + } + } + }, + "range": [ + 12164, + 12191 + ], + "loc": { + "start": { + "line": 344, + "column": 14 + }, + "end": { + "line": 344, + "column": 41 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "r", + "range": [ + 12192, + 12193 + ], + "loc": { + "start": { + "line": 344, + "column": 42 + }, + "end": { + "line": 344, + "column": 43 + } + } + } + ], + "range": [ + 12164, + 12194 + ], + "loc": { + "start": { + "line": 344, + "column": 14 + }, + "end": { + "line": 344, + "column": 44 + } + } + }, + "right": { + "type": "UnaryExpression", + "operator": "-", + "argument": { + "type": "Literal", + "value": 1, + "raw": "1", + "range": [ + 12200, + 12201 + ], + "loc": { + "start": { + "line": 344, + "column": 50 + }, + "end": { + "line": 344, + "column": 51 + } + } + }, + "prefix": true, + "range": [ + 12199, + 12201 + ], + "loc": { + "start": { + "line": 344, + "column": 49 + }, + "end": { + "line": 344, + "column": 51 + } + } + }, + "range": [ + 12164, + 12201 + ], + "loc": { + "start": { + "line": 344, + "column": 14 + }, + "end": { + "line": 344, + "column": 51 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 12217, + 12221 + ], + "loc": { + "start": { + "line": 345, + "column": 12 + }, + "end": { + "line": 345, + "column": 16 + } + } + }, + "property": { + "type": "Identifier", + "name": "_removeInverseRelationship", + "range": [ + 12222, + 12248 + ], + "loc": { + "start": { + "line": 345, + "column": 17 + }, + "end": { + "line": 345, + "column": 43 + } + } + }, + "range": [ + 12217, + 12248 + ], + "loc": { + "start": { + "line": 345, + "column": 12 + }, + "end": { + "line": 345, + "column": 43 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "resource", + "range": [ + 12249, + 12257 + ], + "loc": { + "start": { + "line": 345, + "column": 44 + }, + "end": { + "line": 345, + "column": 52 + } + } + }, + { + "type": "Identifier", + "name": "fieldName", + "range": [ + 12259, + 12268 + ], + "loc": { + "start": { + "line": 345, + "column": 54 + }, + "end": { + "line": 345, + "column": 63 + } + } + }, + { + "type": "Identifier", + "name": "r", + "range": [ + 12270, + 12271 + ], + "loc": { + "start": { + "line": 345, + "column": 65 + }, + "end": { + "line": 345, + "column": 66 + } + } + }, + { + "type": "Identifier", + "name": "field", + "range": [ + 12273, + 12278 + ], + "loc": { + "start": { + "line": 345, + "column": 68 + }, + "end": { + "line": 345, + "column": 73 + } + } + } + ], + "range": [ + 12217, + 12279 + ], + "loc": { + "start": { + "line": 345, + "column": 12 + }, + "end": { + "line": 345, + "column": 74 + } + } + }, + "range": [ + 12217, + 12280 + ], + "loc": { + "start": { + "line": 345, + "column": 12 + }, + "end": { + "line": 345, + "column": 75 + } + } + } + ], + "range": [ + 12203, + 12292 + ], + "loc": { + "start": { + "line": 344, + "column": 53 + }, + "end": { + "line": 346, + "column": 11 + } + } + }, + "alternate": null, + "range": [ + 12160, + 12292 + ], + "loc": { + "start": { + "line": 344, + "column": 10 + }, + "end": { + "line": 346, + "column": 11 + } + } + } + ], + "range": [ + 12148, + 12302 + ], + "loc": { + "start": { + "line": 343, + "column": 41 + }, + "end": { + "line": 347, + "column": 9 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 12143, + 12302 + ], + "loc": { + "start": { + "line": 343, + "column": 36 + }, + "end": { + "line": 347, + "column": 9 + } + } + } + ], + "range": [ + 12115, + 12303 + ], + "loc": { + "start": { + "line": 343, + "column": 8 + }, + "end": { + "line": 347, + "column": 10 + } + } + }, + "range": [ + 12115, + 12304 + ], + "loc": { + "start": { + "line": 343, + "column": 8 + }, + "end": { + "line": 347, + "column": 11 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "newValue", + "range": [ + 12313, + 12321 + ], + "loc": { + "start": { + "line": 348, + "column": 8 + }, + "end": { + "line": 348, + "column": 16 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 12322, + 12329 + ], + "loc": { + "start": { + "line": 348, + "column": 17 + }, + "end": { + "line": 348, + "column": 24 + } + } + }, + "range": [ + 12313, + 12329 + ], + "loc": { + "start": { + "line": 348, + "column": 8 + }, + "end": { + "line": 348, + "column": 24 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "r", + "range": [ + 12330, + 12331 + ], + "loc": { + "start": { + "line": 348, + "column": 25 + }, + "end": { + "line": 348, + "column": 26 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 12347, + 12351 + ], + "loc": { + "start": { + "line": 349, + "column": 10 + }, + "end": { + "line": 349, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "_addInverseRelationship", + "range": [ + 12352, + 12375 + ], + "loc": { + "start": { + "line": 349, + "column": 15 + }, + "end": { + "line": 349, + "column": 38 + } + } + }, + "range": [ + 12347, + 12375 + ], + "loc": { + "start": { + "line": 349, + "column": 10 + }, + "end": { + "line": 349, + "column": 38 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "resource", + "range": [ + 12376, + 12384 + ], + "loc": { + "start": { + "line": 349, + "column": 39 + }, + "end": { + "line": 349, + "column": 47 + } + } + }, + { + "type": "Identifier", + "name": "fieldName", + "range": [ + 12386, + 12395 + ], + "loc": { + "start": { + "line": 349, + "column": 49 + }, + "end": { + "line": 349, + "column": 58 + } + } + }, + { + "type": "Identifier", + "name": "r", + "range": [ + 12397, + 12398 + ], + "loc": { + "start": { + "line": 349, + "column": 60 + }, + "end": { + "line": 349, + "column": 61 + } + } + }, + { + "type": "Identifier", + "name": "field", + "range": [ + 12400, + 12405 + ], + "loc": { + "start": { + "line": 349, + "column": 63 + }, + "end": { + "line": 349, + "column": 68 + } + } + } + ], + "range": [ + 12347, + 12406 + ], + "loc": { + "start": { + "line": 349, + "column": 10 + }, + "end": { + "line": 349, + "column": 69 + } + } + }, + "range": [ + 12347, + 12407 + ], + "loc": { + "start": { + "line": 349, + "column": 10 + }, + "end": { + "line": 349, + "column": 70 + } + } + } + ], + "range": [ + 12335, + 12417 + ], + "loc": { + "start": { + "line": 348, + "column": 30 + }, + "end": { + "line": 350, + "column": 9 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 12330, + 12417 + ], + "loc": { + "start": { + "line": 348, + "column": 25 + }, + "end": { + "line": 350, + "column": 9 + } + } + } + ], + "range": [ + 12313, + 12418 + ], + "loc": { + "start": { + "line": 348, + "column": 8 + }, + "end": { + "line": 350, + "column": 10 + } + } + }, + "range": [ + 12313, + 12419 + ], + "loc": { + "start": { + "line": 348, + "column": 8 + }, + "end": { + "line": 350, + "column": 11 + } + } + } + ], + "range": [ + 12105, + 12427 + ], + "loc": { + "start": { + "line": 342, + "column": 44 + }, + "end": { + "line": 351, + "column": 7 + } + } + }, + "alternate": null, + "range": [ + 12074, + 12427 + ], + "loc": { + "start": { + "line": 342, + "column": 13 + }, + "end": { + "line": 351, + "column": 7 + } + } + }, + "range": [ + 11780, + 12427 + ], + "loc": { + "start": { + "line": 335, + "column": 6 + }, + "end": { + "line": 351, + "column": 7 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "resource", + "range": [ + 12434, + 12442 + ], + "loc": { + "start": { + "line": 352, + "column": 6 + }, + "end": { + "line": 352, + "column": 14 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 12443, + 12452 + ], + "loc": { + "start": { + "line": 352, + "column": 15 + }, + "end": { + "line": 352, + "column": 24 + } + } + }, + "range": [ + 12434, + 12453 + ], + "loc": { + "start": { + "line": 352, + "column": 6 + }, + "end": { + "line": 352, + "column": 25 + } + } + }, + "right": { + "type": "Identifier", + "name": "newValue", + "range": [ + 12456, + 12464 + ], + "loc": { + "start": { + "line": 352, + "column": 28 + }, + "end": { + "line": 352, + "column": 36 + } + } + }, + "range": [ + 12434, + 12464 + ], + "loc": { + "start": { + "line": 352, + "column": 6 + }, + "end": { + "line": 352, + "column": 36 + } + } + }, + "range": [ + 12434, + 12465 + ], + "loc": { + "start": { + "line": 352, + "column": 6 + }, + "end": { + "line": 352, + "column": 37 + } + } + } + ], + "range": [ + 11772, + 12471 + ], + "loc": { + "start": { + "line": 334, + "column": 41 + }, + "end": { + "line": 353, + "column": 5 + } + } + }, + "alternate": null, + "range": [ + 11735, + 12471 + ], + "loc": { + "start": { + "line": 334, + "column": 4 + }, + "end": { + "line": 353, + "column": 5 + } + } + } + ], + "range": [ + 11622, + 12475 + ], + "loc": { + "start": { + "line": 331, + "column": 53 + }, + "end": { + "line": 354, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 11580, + 12475 + ], + "loc": { + "start": { + "line": 331, + "column": 11 + }, + "end": { + "line": 354, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 11571, + 12475 + ], + "loc": { + "start": { + "line": 331, + "column": 2 + }, + "end": { + "line": 354, + "column": 3 + } + }, + "static": false + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_addInverseRelationship", + "range": [ + 12479, + 12502 + ], + "loc": { + "start": { + "line": 356, + "column": 2 + }, + "end": { + "line": 356, + "column": 25 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 12503, + 12517 + ], + "loc": { + "start": { + "line": 356, + "column": 26 + }, + "end": { + "line": 356, + "column": 40 + } + } + }, + { + "type": "Identifier", + "name": "sourceFieldName", + "range": [ + 12519, + 12534 + ], + "loc": { + "start": { + "line": 356, + "column": 42 + }, + "end": { + "line": 356, + "column": 57 + } + } + }, + { + "type": "Identifier", + "name": "targetResource", + "range": [ + 12536, + 12550 + ], + "loc": { + "start": { + "line": 356, + "column": 59 + }, + "end": { + "line": 356, + "column": 73 + } + } + }, + { + "type": "Identifier", + "name": "sourceField", + "range": [ + 12552, + 12563 + ], + "loc": { + "start": { + "line": 356, + "column": 75 + }, + "end": { + "line": 356, + "column": 86 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "targetDefinition", + "range": [ + 12575, + 12591 + ], + "loc": { + "start": { + "line": 357, + "column": 8 + }, + "end": { + "line": 357, + "column": 24 + } + } + }, + "init": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 12594, + 12598 + ], + "loc": { + "start": { + "line": 357, + "column": 27 + }, + "end": { + "line": 357, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 12599, + 12605 + ], + "loc": { + "start": { + "line": 357, + "column": 32 + }, + "end": { + "line": 357, + "column": 38 + } + } + }, + "range": [ + 12594, + 12605 + ], + "loc": { + "start": { + "line": 357, + "column": 27 + }, + "end": { + "line": 357, + "column": 38 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 12606, + 12620 + ], + "loc": { + "start": { + "line": 357, + "column": 39 + }, + "end": { + "line": 357, + "column": 53 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 12621, + 12625 + ], + "loc": { + "start": { + "line": 357, + "column": 54 + }, + "end": { + "line": 357, + "column": 58 + } + } + }, + "range": [ + 12606, + 12625 + ], + "loc": { + "start": { + "line": 357, + "column": 39 + }, + "end": { + "line": 357, + "column": 58 + } + } + }, + "range": [ + 12594, + 12626 + ], + "loc": { + "start": { + "line": 357, + "column": 27 + }, + "end": { + "line": 357, + "column": 59 + } + } + }, + "range": [ + 12575, + 12626 + ], + "loc": { + "start": { + "line": 357, + "column": 8 + }, + "end": { + "line": 357, + "column": 59 + } + } + } + ], + "kind": "var", + "range": [ + 12571, + 12627 + ], + "loc": { + "start": { + "line": 357, + "column": 4 + }, + "end": { + "line": 357, + "column": 60 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "sourceDefinition", + "range": [ + 12636, + 12652 + ], + "loc": { + "start": { + "line": 358, + "column": 8 + }, + "end": { + "line": 358, + "column": 24 + } + } + }, + "init": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 12655, + 12659 + ], + "loc": { + "start": { + "line": 358, + "column": 27 + }, + "end": { + "line": 358, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 12660, + 12666 + ], + "loc": { + "start": { + "line": 358, + "column": 32 + }, + "end": { + "line": 358, + "column": 38 + } + } + }, + "range": [ + 12655, + 12666 + ], + "loc": { + "start": { + "line": 358, + "column": 27 + }, + "end": { + "line": 358, + "column": 38 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 12667, + 12681 + ], + "loc": { + "start": { + "line": 358, + "column": 39 + }, + "end": { + "line": 358, + "column": 53 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 12682, + 12686 + ], + "loc": { + "start": { + "line": 358, + "column": 54 + }, + "end": { + "line": 358, + "column": 58 + } + } + }, + "range": [ + 12667, + 12686 + ], + "loc": { + "start": { + "line": 358, + "column": 39 + }, + "end": { + "line": 358, + "column": 58 + } + } + }, + "range": [ + 12655, + 12687 + ], + "loc": { + "start": { + "line": 358, + "column": 27 + }, + "end": { + "line": 358, + "column": 59 + } + } + }, + "range": [ + 12636, + 12687 + ], + "loc": { + "start": { + "line": 358, + "column": 8 + }, + "end": { + "line": 358, + "column": 59 + } + } + } + ], + "kind": "var", + "range": [ + 12632, + 12688 + ], + "loc": { + "start": { + "line": 358, + "column": 4 + }, + "end": { + "line": 358, + "column": 60 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "targetDefinition", + "range": [ + 12697, + 12713 + ], + "loc": { + "start": { + "line": 359, + "column": 8 + }, + "end": { + "line": 359, + "column": 24 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 12727, + 12742 + ], + "loc": { + "start": { + "line": 360, + "column": 10 + }, + "end": { + "line": 360, + "column": 25 + } + } + }, + "init": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ArrayExpression", + "elements": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceField", + "range": [ + 12747, + 12758 + ], + "loc": { + "start": { + "line": 360, + "column": 30 + }, + "end": { + "line": 360, + "column": 41 + } + } + }, + "property": { + "type": "Identifier", + "name": "inverse", + "range": [ + 12759, + 12766 + ], + "loc": { + "start": { + "line": 360, + "column": 42 + }, + "end": { + "line": 360, + "column": 49 + } + } + }, + "range": [ + 12747, + 12766 + ], + "loc": { + "start": { + "line": 360, + "column": 30 + }, + "end": { + "line": 360, + "column": 49 + } + } + } + ], + "range": [ + 12745, + 12768 + ], + "loc": { + "start": { + "line": 360, + "column": 28 + }, + "end": { + "line": 360, + "column": 51 + } + } + }, + "property": { + "type": "Identifier", + "name": "concat", + "range": [ + 12769, + 12775 + ], + "loc": { + "start": { + "line": 360, + "column": 52 + }, + "end": { + "line": 360, + "column": 58 + } + } + }, + "range": [ + 12745, + 12775 + ], + "loc": { + "start": { + "line": 360, + "column": 28 + }, + "end": { + "line": 360, + "column": 58 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceDefinition", + "range": [ + 12776, + 12792 + ], + "loc": { + "start": { + "line": 360, + "column": 59 + }, + "end": { + "line": 360, + "column": 75 + } + } + }, + "property": { + "type": "Identifier", + "name": "_names", + "range": [ + 12793, + 12799 + ], + "loc": { + "start": { + "line": 360, + "column": 76 + }, + "end": { + "line": 360, + "column": 82 + } + } + }, + "range": [ + 12776, + 12799 + ], + "loc": { + "start": { + "line": 360, + "column": 59 + }, + "end": { + "line": 360, + "column": 82 + } + } + } + ], + "range": [ + 12745, + 12800 + ], + "loc": { + "start": { + "line": 360, + "column": 28 + }, + "end": { + "line": 360, + "column": 83 + } + } + }, + "property": { + "type": "Identifier", + "name": "find", + "range": [ + 12801, + 12805 + ], + "loc": { + "start": { + "line": 360, + "column": 84 + }, + "end": { + "line": 360, + "column": 88 + } + } + }, + "range": [ + 12745, + 12805 + ], + "loc": { + "start": { + "line": 360, + "column": 28 + }, + "end": { + "line": 360, + "column": 88 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "x", + "range": [ + 12806, + 12807 + ], + "loc": { + "start": { + "line": 360, + "column": 89 + }, + "end": { + "line": 360, + "column": 90 + } + } + } + ], + "body": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "targetDefinition", + "range": [ + 12811, + 12827 + ], + "loc": { + "start": { + "line": 360, + "column": 94 + }, + "end": { + "line": 360, + "column": 110 + } + } + }, + "property": { + "type": "Identifier", + "name": "x", + "range": [ + 12828, + 12829 + ], + "loc": { + "start": { + "line": 360, + "column": 111 + }, + "end": { + "line": 360, + "column": 112 + } + } + }, + "range": [ + 12811, + 12830 + ], + "loc": { + "start": { + "line": 360, + "column": 94 + }, + "end": { + "line": 360, + "column": 113 + } + } + }, + "generator": false, + "expression": true, + "range": [ + 12806, + 12830 + ], + "loc": { + "start": { + "line": 360, + "column": 89 + }, + "end": { + "line": 360, + "column": 113 + } + } + } + ], + "range": [ + 12745, + 12831 + ], + "loc": { + "start": { + "line": 360, + "column": 28 + }, + "end": { + "line": 360, + "column": 114 + } + } + }, + "range": [ + 12727, + 12831 + ], + "loc": { + "start": { + "line": 360, + "column": 10 + }, + "end": { + "line": 360, + "column": 114 + } + } + } + ], + "kind": "let", + "range": [ + 12723, + 12832 + ], + "loc": { + "start": { + "line": 360, + "column": 6 + }, + "end": { + "line": 360, + "column": 115 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "targetField", + "range": [ + 12843, + 12854 + ], + "loc": { + "start": { + "line": 361, + "column": 10 + }, + "end": { + "line": 361, + "column": 21 + } + } + }, + "init": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "Identifier", + "name": "targetDefinition", + "range": [ + 12857, + 12873 + ], + "loc": { + "start": { + "line": 361, + "column": 24 + }, + "end": { + "line": 361, + "column": 40 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "targetDefinition", + "range": [ + 12877, + 12893 + ], + "loc": { + "start": { + "line": 361, + "column": 44 + }, + "end": { + "line": 361, + "column": 60 + } + } + }, + "property": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 12894, + 12909 + ], + "loc": { + "start": { + "line": 361, + "column": 61 + }, + "end": { + "line": 361, + "column": 76 + } + } + }, + "range": [ + 12877, + 12910 + ], + "loc": { + "start": { + "line": 361, + "column": 44 + }, + "end": { + "line": 361, + "column": 77 + } + } + }, + "range": [ + 12857, + 12910 + ], + "loc": { + "start": { + "line": 361, + "column": 24 + }, + "end": { + "line": 361, + "column": 77 + } + } + }, + "range": [ + 12843, + 12910 + ], + "loc": { + "start": { + "line": 361, + "column": 10 + }, + "end": { + "line": 361, + "column": 77 + } + } + } + ], + "kind": "let", + "range": [ + 12839, + 12911 + ], + "loc": { + "start": { + "line": 361, + "column": 6 + }, + "end": { + "line": 361, + "column": 78 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 12918, + 12932 + ], + "loc": { + "start": { + "line": 362, + "column": 6 + }, + "end": { + "line": 362, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 12933, + 12944 + ], + "loc": { + "start": { + "line": 362, + "column": 21 + }, + "end": { + "line": 362, + "column": 32 + } + } + }, + "range": [ + 12918, + 12944 + ], + "loc": { + "start": { + "line": 362, + "column": 6 + }, + "end": { + "line": 362, + "column": 32 + } + } + }, + "property": { + "type": "Identifier", + "name": "push", + "range": [ + 12945, + 12949 + ], + "loc": { + "start": { + "line": 362, + "column": 33 + }, + "end": { + "line": 362, + "column": 37 + } + } + }, + "range": [ + 12918, + 12949 + ], + "loc": { + "start": { + "line": 362, + "column": 6 + }, + "end": { + "line": 362, + "column": 37 + } + } + }, + "arguments": [ + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "type", + "range": [ + 12952, + 12956 + ], + "loc": { + "start": { + "line": 362, + "column": 40 + }, + "end": { + "line": 362, + "column": 44 + } + } + }, + "value": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 12958, + 12972 + ], + "loc": { + "start": { + "line": 362, + "column": 46 + }, + "end": { + "line": 362, + "column": 60 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 12973, + 12977 + ], + "loc": { + "start": { + "line": 362, + "column": 61 + }, + "end": { + "line": 362, + "column": 65 + } + } + }, + "range": [ + 12958, + 12977 + ], + "loc": { + "start": { + "line": 362, + "column": 46 + }, + "end": { + "line": 362, + "column": 65 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 12952, + 12977 + ], + "loc": { + "start": { + "line": 362, + "column": 40 + }, + "end": { + "line": 362, + "column": 65 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "id", + "range": [ + 12979, + 12981 + ], + "loc": { + "start": { + "line": 362, + "column": 67 + }, + "end": { + "line": 362, + "column": 69 + } + } + }, + "value": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 12983, + 12997 + ], + "loc": { + "start": { + "line": 362, + "column": 71 + }, + "end": { + "line": 362, + "column": 85 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 12998, + 13000 + ], + "loc": { + "start": { + "line": 362, + "column": 86 + }, + "end": { + "line": 362, + "column": 88 + } + } + }, + "range": [ + 12983, + 13000 + ], + "loc": { + "start": { + "line": 362, + "column": 71 + }, + "end": { + "line": 362, + "column": 88 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 12979, + 13000 + ], + "loc": { + "start": { + "line": 362, + "column": 67 + }, + "end": { + "line": 362, + "column": 88 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 13002, + 13011 + ], + "loc": { + "start": { + "line": 362, + "column": 90 + }, + "end": { + "line": 362, + "column": 99 + } + } + }, + "value": { + "type": "Identifier", + "name": "sourceFieldName", + "range": [ + 13013, + 13028 + ], + "loc": { + "start": { + "line": 362, + "column": 101 + }, + "end": { + "line": 362, + "column": 116 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 13002, + 13028 + ], + "loc": { + "start": { + "line": 362, + "column": 90 + }, + "end": { + "line": 362, + "column": 116 + } + } + } + ], + "range": [ + 12950, + 13030 + ], + "loc": { + "start": { + "line": 362, + "column": 38 + }, + "end": { + "line": 362, + "column": 118 + } + } + } + ], + "range": [ + 12918, + 13031 + ], + "loc": { + "start": { + "line": 362, + "column": 6 + }, + "end": { + "line": 362, + "column": 119 + } + } + }, + "range": [ + 12918, + 13032 + ], + "loc": { + "start": { + "line": 362, + "column": 6 + }, + "end": { + "line": 362, + "column": 120 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "targetField", + "range": [ + 13043, + 13054 + ], + "loc": { + "start": { + "line": 363, + "column": 10 + }, + "end": { + "line": 363, + "column": 21 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetField", + "range": [ + 13070, + 13081 + ], + "loc": { + "start": { + "line": 364, + "column": 12 + }, + "end": { + "line": 364, + "column": 23 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 13082, + 13086 + ], + "loc": { + "start": { + "line": 364, + "column": 24 + }, + "end": { + "line": 364, + "column": 28 + } + } + }, + "range": [ + 13070, + 13086 + ], + "loc": { + "start": { + "line": 364, + "column": 12 + }, + "end": { + "line": 364, + "column": 28 + } + } + }, + "right": { + "type": "Literal", + "value": "has-one", + "raw": "\"has-one\"", + "range": [ + 13091, + 13100 + ], + "loc": { + "start": { + "line": 364, + "column": 33 + }, + "end": { + "line": 364, + "column": 42 + } + } + }, + "range": [ + 13070, + 13100 + ], + "loc": { + "start": { + "line": 364, + "column": 12 + }, + "end": { + "line": 364, + "column": 42 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 13114, + 13128 + ], + "loc": { + "start": { + "line": 365, + "column": 10 + }, + "end": { + "line": 365, + "column": 24 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 13129, + 13140 + ], + "loc": { + "start": { + "line": 365, + "column": 25 + }, + "end": { + "line": 365, + "column": 36 + } + } + }, + "range": [ + 13114, + 13140 + ], + "loc": { + "start": { + "line": 365, + "column": 10 + }, + "end": { + "line": 365, + "column": 36 + } + } + }, + "property": { + "type": "Identifier", + "name": "push", + "range": [ + 13141, + 13145 + ], + "loc": { + "start": { + "line": 365, + "column": 37 + }, + "end": { + "line": 365, + "column": 41 + } + } + }, + "range": [ + 13114, + 13145 + ], + "loc": { + "start": { + "line": 365, + "column": 10 + }, + "end": { + "line": 365, + "column": 41 + } + } + }, + "arguments": [ + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "type", + "range": [ + 13148, + 13152 + ], + "loc": { + "start": { + "line": 365, + "column": 44 + }, + "end": { + "line": 365, + "column": 48 + } + } + }, + "value": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 13154, + 13168 + ], + "loc": { + "start": { + "line": 365, + "column": 50 + }, + "end": { + "line": 365, + "column": 64 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 13169, + 13173 + ], + "loc": { + "start": { + "line": 365, + "column": 65 + }, + "end": { + "line": 365, + "column": 69 + } + } + }, + "range": [ + 13154, + 13173 + ], + "loc": { + "start": { + "line": 365, + "column": 50 + }, + "end": { + "line": 365, + "column": 69 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 13148, + 13173 + ], + "loc": { + "start": { + "line": 365, + "column": 44 + }, + "end": { + "line": 365, + "column": 69 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "id", + "range": [ + 13175, + 13177 + ], + "loc": { + "start": { + "line": 365, + "column": 71 + }, + "end": { + "line": 365, + "column": 73 + } + } + }, + "value": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 13179, + 13193 + ], + "loc": { + "start": { + "line": 365, + "column": 75 + }, + "end": { + "line": 365, + "column": 89 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 13194, + 13196 + ], + "loc": { + "start": { + "line": 365, + "column": 90 + }, + "end": { + "line": 365, + "column": 92 + } + } + }, + "range": [ + 13179, + 13196 + ], + "loc": { + "start": { + "line": 365, + "column": 75 + }, + "end": { + "line": 365, + "column": 92 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 13175, + 13196 + ], + "loc": { + "start": { + "line": 365, + "column": 71 + }, + "end": { + "line": 365, + "column": 92 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 13198, + 13207 + ], + "loc": { + "start": { + "line": 365, + "column": 94 + }, + "end": { + "line": 365, + "column": 103 + } + } + }, + "value": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 13209, + 13224 + ], + "loc": { + "start": { + "line": 365, + "column": 105 + }, + "end": { + "line": 365, + "column": 120 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 13198, + 13224 + ], + "loc": { + "start": { + "line": 365, + "column": 94 + }, + "end": { + "line": 365, + "column": 120 + } + } + } + ], + "range": [ + 13146, + 13226 + ], + "loc": { + "start": { + "line": 365, + "column": 42 + }, + "end": { + "line": 365, + "column": 122 + } + } + } + ], + "range": [ + 13114, + 13227 + ], + "loc": { + "start": { + "line": 365, + "column": 10 + }, + "end": { + "line": 365, + "column": 123 + } + } + }, + "range": [ + 13114, + 13228 + ], + "loc": { + "start": { + "line": 365, + "column": 10 + }, + "end": { + "line": 365, + "column": 124 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 13239, + 13253 + ], + "loc": { + "start": { + "line": 366, + "column": 10 + }, + "end": { + "line": 366, + "column": 24 + } + } + }, + "property": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 13254, + 13269 + ], + "loc": { + "start": { + "line": 366, + "column": 25 + }, + "end": { + "line": 366, + "column": 40 + } + } + }, + "range": [ + 13239, + 13270 + ], + "loc": { + "start": { + "line": 366, + "column": 10 + }, + "end": { + "line": 366, + "column": 41 + } + } + }, + "right": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 13273, + 13287 + ], + "loc": { + "start": { + "line": 366, + "column": 44 + }, + "end": { + "line": 366, + "column": 58 + } + } + }, + "range": [ + 13239, + 13287 + ], + "loc": { + "start": { + "line": 366, + "column": 10 + }, + "end": { + "line": 366, + "column": 58 + } + } + }, + "range": [ + 13239, + 13288 + ], + "loc": { + "start": { + "line": 366, + "column": 10 + }, + "end": { + "line": 366, + "column": 59 + } + } + } + ], + "range": [ + 13102, + 13298 + ], + "loc": { + "start": { + "line": 364, + "column": 44 + }, + "end": { + "line": 367, + "column": 9 + } + } + }, + "alternate": { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetField", + "range": [ + 13308, + 13319 + ], + "loc": { + "start": { + "line": 367, + "column": 19 + }, + "end": { + "line": 367, + "column": 30 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 13320, + 13324 + ], + "loc": { + "start": { + "line": 367, + "column": 31 + }, + "end": { + "line": 367, + "column": 35 + } + } + }, + "range": [ + 13308, + 13324 + ], + "loc": { + "start": { + "line": 367, + "column": 19 + }, + "end": { + "line": 367, + "column": 35 + } + } + }, + "right": { + "type": "Literal", + "value": "has-many", + "raw": "\"has-many\"", + "range": [ + 13329, + 13339 + ], + "loc": { + "start": { + "line": 367, + "column": 40 + }, + "end": { + "line": 367, + "column": 50 + } + } + }, + "range": [ + 13308, + 13339 + ], + "loc": { + "start": { + "line": 367, + "column": 19 + }, + "end": { + "line": 367, + "column": 50 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 13353, + 13367 + ], + "loc": { + "start": { + "line": 368, + "column": 10 + }, + "end": { + "line": 368, + "column": 24 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 13368, + 13379 + ], + "loc": { + "start": { + "line": 368, + "column": 25 + }, + "end": { + "line": 368, + "column": 36 + } + } + }, + "range": [ + 13353, + 13379 + ], + "loc": { + "start": { + "line": 368, + "column": 10 + }, + "end": { + "line": 368, + "column": 36 + } + } + }, + "property": { + "type": "Identifier", + "name": "push", + "range": [ + 13380, + 13384 + ], + "loc": { + "start": { + "line": 368, + "column": 37 + }, + "end": { + "line": 368, + "column": 41 + } + } + }, + "range": [ + 13353, + 13384 + ], + "loc": { + "start": { + "line": 368, + "column": 10 + }, + "end": { + "line": 368, + "column": 41 + } + } + }, + "arguments": [ + { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "type", + "range": [ + 13387, + 13391 + ], + "loc": { + "start": { + "line": 368, + "column": 44 + }, + "end": { + "line": 368, + "column": 48 + } + } + }, + "value": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 13393, + 13407 + ], + "loc": { + "start": { + "line": 368, + "column": 50 + }, + "end": { + "line": 368, + "column": 64 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 13408, + 13412 + ], + "loc": { + "start": { + "line": 368, + "column": 65 + }, + "end": { + "line": 368, + "column": 69 + } + } + }, + "range": [ + 13393, + 13412 + ], + "loc": { + "start": { + "line": 368, + "column": 50 + }, + "end": { + "line": 368, + "column": 69 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 13387, + 13412 + ], + "loc": { + "start": { + "line": 368, + "column": 44 + }, + "end": { + "line": 368, + "column": 69 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "id", + "range": [ + 13414, + 13416 + ], + "loc": { + "start": { + "line": 368, + "column": 71 + }, + "end": { + "line": 368, + "column": 73 + } + } + }, + "value": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 13418, + 13432 + ], + "loc": { + "start": { + "line": 368, + "column": 75 + }, + "end": { + "line": 368, + "column": 89 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 13433, + 13435 + ], + "loc": { + "start": { + "line": 368, + "column": 90 + }, + "end": { + "line": 368, + "column": 92 + } + } + }, + "range": [ + 13418, + 13435 + ], + "loc": { + "start": { + "line": 368, + "column": 75 + }, + "end": { + "line": 368, + "column": 92 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 13414, + 13435 + ], + "loc": { + "start": { + "line": 368, + "column": 71 + }, + "end": { + "line": 368, + "column": 92 + } + } + }, + { + "type": "Property", + "key": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 13437, + 13446 + ], + "loc": { + "start": { + "line": 368, + "column": 94 + }, + "end": { + "line": 368, + "column": 103 + } + } + }, + "value": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 13448, + 13463 + ], + "loc": { + "start": { + "line": 368, + "column": 105 + }, + "end": { + "line": 368, + "column": 120 + } + } + }, + "kind": "init", + "method": false, + "shorthand": false, + "computed": false, + "range": [ + 13437, + 13463 + ], + "loc": { + "start": { + "line": 368, + "column": 94 + }, + "end": { + "line": 368, + "column": 120 + } + } + } + ], + "range": [ + 13385, + 13465 + ], + "loc": { + "start": { + "line": 368, + "column": 42 + }, + "end": { + "line": 368, + "column": 122 + } + } + } + ], + "range": [ + 13353, + 13466 + ], + "loc": { + "start": { + "line": 368, + "column": 10 + }, + "end": { + "line": 368, + "column": 123 + } + } + }, + "range": [ + 13353, + 13467 + ], + "loc": { + "start": { + "line": 368, + "column": 10 + }, + "end": { + "line": 368, + "column": 124 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 13482, + 13496 + ], + "loc": { + "start": { + "line": 369, + "column": 14 + }, + "end": { + "line": 369, + "column": 28 + } + } + }, + "property": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 13497, + 13512 + ], + "loc": { + "start": { + "line": 369, + "column": 29 + }, + "end": { + "line": 369, + "column": 44 + } + } + }, + "range": [ + 13482, + 13513 + ], + "loc": { + "start": { + "line": 369, + "column": 14 + }, + "end": { + "line": 369, + "column": 45 + } + } + }, + "property": { + "type": "Identifier", + "name": "indexOf", + "range": [ + 13514, + 13521 + ], + "loc": { + "start": { + "line": 369, + "column": 46 + }, + "end": { + "line": 369, + "column": 53 + } + } + }, + "range": [ + 13482, + 13521 + ], + "loc": { + "start": { + "line": 369, + "column": 14 + }, + "end": { + "line": 369, + "column": 53 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 13522, + 13536 + ], + "loc": { + "start": { + "line": 369, + "column": 54 + }, + "end": { + "line": 369, + "column": 68 + } + } + } + ], + "range": [ + 13482, + 13537 + ], + "loc": { + "start": { + "line": 369, + "column": 14 + }, + "end": { + "line": 369, + "column": 69 + } + } + }, + "right": { + "type": "UnaryExpression", + "operator": "-", + "argument": { + "type": "Literal", + "value": 1, + "raw": "1", + "range": [ + 13543, + 13544 + ], + "loc": { + "start": { + "line": 369, + "column": 75 + }, + "end": { + "line": 369, + "column": 76 + } + } + }, + "prefix": true, + "range": [ + 13542, + 13544 + ], + "loc": { + "start": { + "line": 369, + "column": 74 + }, + "end": { + "line": 369, + "column": 76 + } + } + }, + "range": [ + 13482, + 13544 + ], + "loc": { + "start": { + "line": 369, + "column": 14 + }, + "end": { + "line": 369, + "column": 76 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 13560, + 13574 + ], + "loc": { + "start": { + "line": 370, + "column": 12 + }, + "end": { + "line": 370, + "column": 26 + } + } + }, + "property": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 13575, + 13590 + ], + "loc": { + "start": { + "line": 370, + "column": 27 + }, + "end": { + "line": 370, + "column": 42 + } + } + }, + "range": [ + 13560, + 13591 + ], + "loc": { + "start": { + "line": 370, + "column": 12 + }, + "end": { + "line": 370, + "column": 43 + } + } + }, + "property": { + "type": "Identifier", + "name": "push", + "range": [ + 13592, + 13596 + ], + "loc": { + "start": { + "line": 370, + "column": 44 + }, + "end": { + "line": 370, + "column": 48 + } + } + }, + "range": [ + 13560, + 13596 + ], + "loc": { + "start": { + "line": 370, + "column": 12 + }, + "end": { + "line": 370, + "column": 48 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 13597, + 13611 + ], + "loc": { + "start": { + "line": 370, + "column": 49 + }, + "end": { + "line": 370, + "column": 63 + } + } + } + ], + "range": [ + 13560, + 13612 + ], + "loc": { + "start": { + "line": 370, + "column": 12 + }, + "end": { + "line": 370, + "column": 64 + } + } + }, + "range": [ + 13560, + 13613 + ], + "loc": { + "start": { + "line": 370, + "column": 12 + }, + "end": { + "line": 370, + "column": 65 + } + } + } + ], + "range": [ + 13546, + 13625 + ], + "loc": { + "start": { + "line": 369, + "column": 78 + }, + "end": { + "line": 371, + "column": 11 + } + } + }, + "alternate": null, + "range": [ + 13478, + 13625 + ], + "loc": { + "start": { + "line": 369, + "column": 10 + }, + "end": { + "line": 371, + "column": 11 + } + } + } + ], + "range": [ + 13341, + 13635 + ], + "loc": { + "start": { + "line": 367, + "column": 52 + }, + "end": { + "line": 372, + "column": 9 + } + } + }, + "alternate": { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetField", + "range": [ + 13645, + 13656 + ], + "loc": { + "start": { + "line": 372, + "column": 19 + }, + "end": { + "line": 372, + "column": 30 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 13657, + 13661 + ], + "loc": { + "start": { + "line": 372, + "column": 31 + }, + "end": { + "line": 372, + "column": 35 + } + } + }, + "range": [ + 13645, + 13661 + ], + "loc": { + "start": { + "line": 372, + "column": 19 + }, + "end": { + "line": 372, + "column": 35 + } + } + }, + "right": { + "type": "Literal", + "value": "attr", + "raw": "\"attr\"", + "range": [ + 13666, + 13672 + ], + "loc": { + "start": { + "line": 372, + "column": 40 + }, + "end": { + "line": 372, + "column": 46 + } + } + }, + "range": [ + 13645, + 13672 + ], + "loc": { + "start": { + "line": 372, + "column": 19 + }, + "end": { + "line": 372, + "column": 46 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "Error", + "range": [ + 13696, + 13701 + ], + "loc": { + "start": { + "line": 373, + "column": 20 + }, + "end": { + "line": 373, + "column": 25 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "The the inverse relationship for '", + "cooked": "The the inverse relationship for '" + }, + "tail": false, + "range": [ + 13702, + 13739 + ], + "loc": { + "start": { + "line": 373, + "column": 26 + }, + "end": { + "line": 373, + "column": 63 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "' is an attribute ('", + "cooked": "' is an attribute ('" + }, + "tail": false, + "range": [ + 13754, + 13777 + ], + "loc": { + "start": { + "line": 373, + "column": 78 + }, + "end": { + "line": 373, + "column": 101 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "')", + "cooked": "')" + }, + "tail": true, + "range": [ + 13792, + 13796 + ], + "loc": { + "start": { + "line": 373, + "column": 116 + }, + "end": { + "line": 373, + "column": 120 + } + } + } + ], + "expressions": [ + { + "type": "Identifier", + "name": "sourceFieldName", + "range": [ + 13739, + 13754 + ], + "loc": { + "start": { + "line": 373, + "column": 63 + }, + "end": { + "line": 373, + "column": 78 + } + } + }, + { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 13777, + 13792 + ], + "loc": { + "start": { + "line": 373, + "column": 101 + }, + "end": { + "line": 373, + "column": 116 + } + } + } + ], + "range": [ + 13702, + 13796 + ], + "loc": { + "start": { + "line": 373, + "column": 26 + }, + "end": { + "line": 373, + "column": 120 + } + } + } + ], + "range": [ + 13692, + 13797 + ], + "loc": { + "start": { + "line": 373, + "column": 16 + }, + "end": { + "line": 373, + "column": 121 + } + } + }, + "range": [ + 13686, + 13798 + ], + "loc": { + "start": { + "line": 373, + "column": 10 + }, + "end": { + "line": 373, + "column": 122 + } + } + } + ], + "range": [ + 13674, + 13808 + ], + "loc": { + "start": { + "line": 372, + "column": 48 + }, + "end": { + "line": 374, + "column": 9 + } + } + }, + "alternate": null, + "range": [ + 13641, + 13808 + ], + "loc": { + "start": { + "line": 372, + "column": 15 + }, + "end": { + "line": 374, + "column": 9 + } + } + }, + "range": [ + 13304, + 13808 + ], + "loc": { + "start": { + "line": 367, + "column": 15 + }, + "end": { + "line": 374, + "column": 9 + } + } + }, + "range": [ + 13066, + 13808 + ], + "loc": { + "start": { + "line": 364, + "column": 8 + }, + "end": { + "line": 374, + "column": 9 + } + } + } + ], + "range": [ + 13056, + 13816 + ], + "loc": { + "start": { + "line": 363, + "column": 23 + }, + "end": { + "line": 375, + "column": 7 + } + } + }, + "alternate": { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceField", + "range": [ + 13826, + 13837 + ], + "loc": { + "start": { + "line": 375, + "column": 17 + }, + "end": { + "line": 375, + "column": 28 + } + } + }, + "property": { + "type": "Identifier", + "name": "inverse", + "range": [ + 13838, + 13845 + ], + "loc": { + "start": { + "line": 375, + "column": 29 + }, + "end": { + "line": 375, + "column": 36 + } + } + }, + "range": [ + 13826, + 13845 + ], + "loc": { + "start": { + "line": 375, + "column": 17 + }, + "end": { + "line": 375, + "column": 36 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "Error", + "range": [ + 13867, + 13872 + ], + "loc": { + "start": { + "line": 376, + "column": 18 + }, + "end": { + "line": 376, + "column": 23 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "The the inverse relationship for '", + "cooked": "The the inverse relationship for '" + }, + "tail": false, + "range": [ + 13873, + 13910 + ], + "loc": { + "start": { + "line": 376, + "column": 24 + }, + "end": { + "line": 376, + "column": 61 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "' is missing ('", + "cooked": "' is missing ('" + }, + "tail": false, + "range": [ + 13925, + 13943 + ], + "loc": { + "start": { + "line": 376, + "column": 76 + }, + "end": { + "line": 376, + "column": 94 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "')", + "cooked": "')" + }, + "tail": true, + "range": [ + 13962, + 13966 + ], + "loc": { + "start": { + "line": 376, + "column": 113 + }, + "end": { + "line": 376, + "column": 117 + } + } + } + ], + "expressions": [ + { + "type": "Identifier", + "name": "sourceFieldName", + "range": [ + 13910, + 13925 + ], + "loc": { + "start": { + "line": 376, + "column": 61 + }, + "end": { + "line": 376, + "column": 76 + } + } + }, + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceField", + "range": [ + 13943, + 13954 + ], + "loc": { + "start": { + "line": 376, + "column": 94 + }, + "end": { + "line": 376, + "column": 105 + } + } + }, + "property": { + "type": "Identifier", + "name": "inverse", + "range": [ + 13955, + 13962 + ], + "loc": { + "start": { + "line": 376, + "column": 106 + }, + "end": { + "line": 376, + "column": 113 + } + } + }, + "range": [ + 13943, + 13962 + ], + "loc": { + "start": { + "line": 376, + "column": 94 + }, + "end": { + "line": 376, + "column": 113 + } + } + } + ], + "range": [ + 13873, + 13966 + ], + "loc": { + "start": { + "line": 376, + "column": 24 + }, + "end": { + "line": 376, + "column": 117 + } + } + } + ], + "range": [ + 13863, + 13967 + ], + "loc": { + "start": { + "line": 376, + "column": 14 + }, + "end": { + "line": 376, + "column": 118 + } + } + }, + "range": [ + 13857, + 13968 + ], + "loc": { + "start": { + "line": 376, + "column": 8 + }, + "end": { + "line": 376, + "column": 119 + } + } + } + ], + "range": [ + 13847, + 13976 + ], + "loc": { + "start": { + "line": 375, + "column": 38 + }, + "end": { + "line": 377, + "column": 7 + } + } + }, + "alternate": null, + "range": [ + 13822, + 13976 + ], + "loc": { + "start": { + "line": 375, + "column": 13 + }, + "end": { + "line": 377, + "column": 7 + } + } + }, + "range": [ + 13039, + 13976 + ], + "loc": { + "start": { + "line": 363, + "column": 6 + }, + "end": { + "line": 377, + "column": 7 + } + } + } + ], + "range": [ + 12715, + 13982 + ], + "loc": { + "start": { + "line": 359, + "column": 26 + }, + "end": { + "line": 378, + "column": 5 + } + } + }, + "alternate": null, + "range": [ + 12693, + 13982 + ], + "loc": { + "start": { + "line": 359, + "column": 4 + }, + "end": { + "line": 378, + "column": 5 + } + } + } + ], + "range": [ + 12565, + 13986 + ], + "loc": { + "start": { + "line": 356, + "column": 88 + }, + "end": { + "line": 379, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 12502, + 13986 + ], + "loc": { + "start": { + "line": 356, + "column": 25 + }, + "end": { + "line": 379, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 12479, + 13986 + ], + "loc": { + "start": { + "line": 356, + "column": 2 + }, + "end": { + "line": 379, + "column": 3 + } + }, + "static": false + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_remove", + "range": [ + 13990, + 13997 + ], + "loc": { + "start": { + "line": 381, + "column": 2 + }, + "end": { + "line": 381, + "column": 9 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "resource", + "range": [ + 13998, + 14006 + ], + "loc": { + "start": { + "line": 381, + "column": 10 + }, + "end": { + "line": 381, + "column": 18 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "resource", + "range": [ + 14014, + 14022 + ], + "loc": { + "start": { + "line": 382, + "column": 4 + }, + "end": { + "line": 382, + "column": 12 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 14023, + 14034 + ], + "loc": { + "start": { + "line": 382, + "column": 13 + }, + "end": { + "line": 382, + "column": 24 + } + } + }, + "range": [ + 14014, + 14034 + ], + "loc": { + "start": { + "line": 382, + "column": 4 + }, + "end": { + "line": 382, + "column": 24 + } + } + }, + "property": { + "type": "Identifier", + "name": "forEach", + "range": [ + 14035, + 14042 + ], + "loc": { + "start": { + "line": 382, + "column": 25 + }, + "end": { + "line": 382, + "column": 32 + } + } + }, + "range": [ + 14014, + 14042 + ], + "loc": { + "start": { + "line": 382, + "column": 4 + }, + "end": { + "line": 382, + "column": 32 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "dependent", + "range": [ + 14043, + 14052 + ], + "loc": { + "start": { + "line": 382, + "column": 33 + }, + "end": { + "line": 382, + "column": 42 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "dependentResource", + "range": [ + 14068, + 14085 + ], + "loc": { + "start": { + "line": 383, + "column": 10 + }, + "end": { + "line": 383, + "column": 27 + } + } + }, + "init": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 14088, + 14092 + ], + "loc": { + "start": { + "line": 383, + "column": 30 + }, + "end": { + "line": 383, + "column": 34 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 14093, + 14098 + ], + "loc": { + "start": { + "line": 383, + "column": 35 + }, + "end": { + "line": 383, + "column": 40 + } + } + }, + "range": [ + 14088, + 14098 + ], + "loc": { + "start": { + "line": 383, + "column": 30 + }, + "end": { + "line": 383, + "column": 40 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "dependent", + "range": [ + 14099, + 14108 + ], + "loc": { + "start": { + "line": 383, + "column": 41 + }, + "end": { + "line": 383, + "column": 50 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 14109, + 14113 + ], + "loc": { + "start": { + "line": 383, + "column": 51 + }, + "end": { + "line": 383, + "column": 55 + } + } + }, + "range": [ + 14099, + 14113 + ], + "loc": { + "start": { + "line": 383, + "column": 41 + }, + "end": { + "line": 383, + "column": 55 + } + } + }, + "range": [ + 14088, + 14114 + ], + "loc": { + "start": { + "line": 383, + "column": 30 + }, + "end": { + "line": 383, + "column": 56 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "dependent", + "range": [ + 14115, + 14124 + ], + "loc": { + "start": { + "line": 383, + "column": 57 + }, + "end": { + "line": 383, + "column": 66 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 14125, + 14127 + ], + "loc": { + "start": { + "line": 383, + "column": 67 + }, + "end": { + "line": 383, + "column": 69 + } + } + }, + "range": [ + 14115, + 14127 + ], + "loc": { + "start": { + "line": 383, + "column": 57 + }, + "end": { + "line": 383, + "column": 69 + } + } + }, + "range": [ + 14088, + 14128 + ], + "loc": { + "start": { + "line": 383, + "column": 30 + }, + "end": { + "line": 383, + "column": 70 + } + } + }, + "range": [ + 14068, + 14128 + ], + "loc": { + "start": { + "line": 383, + "column": 10 + }, + "end": { + "line": 383, + "column": 70 + } + } + } + ], + "kind": "let", + "range": [ + 14064, + 14129 + ], + "loc": { + "start": { + "line": 383, + "column": 6 + }, + "end": { + "line": 383, + "column": 71 + } + } + }, + { + "type": "SwitchStatement", + "discriminant": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 14144, + 14148 + ], + "loc": { + "start": { + "line": 384, + "column": 14 + }, + "end": { + "line": 384, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 14149, + 14155 + ], + "loc": { + "start": { + "line": 384, + "column": 19 + }, + "end": { + "line": 384, + "column": 25 + } + } + }, + "range": [ + 14144, + 14155 + ], + "loc": { + "start": { + "line": 384, + "column": 14 + }, + "end": { + "line": 384, + "column": 25 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "dependent", + "range": [ + 14156, + 14165 + ], + "loc": { + "start": { + "line": 384, + "column": 26 + }, + "end": { + "line": 384, + "column": 35 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 14166, + 14170 + ], + "loc": { + "start": { + "line": 384, + "column": 36 + }, + "end": { + "line": 384, + "column": 40 + } + } + }, + "range": [ + 14156, + 14170 + ], + "loc": { + "start": { + "line": 384, + "column": 26 + }, + "end": { + "line": 384, + "column": 40 + } + } + }, + "range": [ + 14144, + 14171 + ], + "loc": { + "start": { + "line": 384, + "column": 14 + }, + "end": { + "line": 384, + "column": 41 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "dependent", + "range": [ + 14172, + 14181 + ], + "loc": { + "start": { + "line": 384, + "column": 42 + }, + "end": { + "line": 384, + "column": 51 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 14182, + 14191 + ], + "loc": { + "start": { + "line": 384, + "column": 52 + }, + "end": { + "line": 384, + "column": 61 + } + } + }, + "range": [ + 14172, + 14191 + ], + "loc": { + "start": { + "line": 384, + "column": 42 + }, + "end": { + "line": 384, + "column": 61 + } + } + }, + "range": [ + 14144, + 14192 + ], + "loc": { + "start": { + "line": 384, + "column": 14 + }, + "end": { + "line": 384, + "column": 62 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 14193, + 14197 + ], + "loc": { + "start": { + "line": 384, + "column": 63 + }, + "end": { + "line": 384, + "column": 67 + } + } + }, + "range": [ + 14144, + 14197 + ], + "loc": { + "start": { + "line": 384, + "column": 14 + }, + "end": { + "line": 384, + "column": 67 + } + } + }, + "cases": [ + { + "type": "SwitchCase", + "test": { + "type": "Literal", + "value": "has-one", + "raw": "\"has-one\"", + "range": [ + 14214, + 14223 + ], + "loc": { + "start": { + "line": 385, + "column": 13 + }, + "end": { + "line": 385, + "column": 22 + } + } + }, + "consequent": [ + { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "dependentResource", + "range": [ + 14237, + 14254 + ], + "loc": { + "start": { + "line": 386, + "column": 10 + }, + "end": { + "line": 386, + "column": 27 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "dependent", + "range": [ + 14255, + 14264 + ], + "loc": { + "start": { + "line": 386, + "column": 28 + }, + "end": { + "line": 386, + "column": 37 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 14265, + 14274 + ], + "loc": { + "start": { + "line": 386, + "column": 38 + }, + "end": { + "line": 386, + "column": 47 + } + } + }, + "range": [ + 14255, + 14274 + ], + "loc": { + "start": { + "line": 386, + "column": 28 + }, + "end": { + "line": 386, + "column": 47 + } + } + }, + "range": [ + 14237, + 14275 + ], + "loc": { + "start": { + "line": 386, + "column": 10 + }, + "end": { + "line": 386, + "column": 48 + } + } + }, + "right": { + "type": "Literal", + "value": null, + "raw": "null", + "range": [ + 14278, + 14282 + ], + "loc": { + "start": { + "line": 386, + "column": 51 + }, + "end": { + "line": 386, + "column": 55 + } + } + }, + "range": [ + 14237, + 14282 + ], + "loc": { + "start": { + "line": 386, + "column": 10 + }, + "end": { + "line": 386, + "column": 55 + } + } + }, + "range": [ + 14237, + 14283 + ], + "loc": { + "start": { + "line": 386, + "column": 10 + }, + "end": { + "line": 386, + "column": 56 + } + } + }, + { + "type": "BreakStatement", + "label": null, + "range": [ + 14294, + 14300 + ], + "loc": { + "start": { + "line": 387, + "column": 10 + }, + "end": { + "line": 387, + "column": 16 + } + } + } + ], + "range": [ + 14225, + 14310 + ], + "loc": { + "start": { + "line": 385, + "column": 24 + }, + "end": { + "line": 388, + "column": 9 + } + } + } + ], + "range": [ + 14209, + 14310 + ], + "loc": { + "start": { + "line": 385, + "column": 8 + }, + "end": { + "line": 388, + "column": 9 + } + } + }, + { + "type": "SwitchCase", + "test": { + "type": "Literal", + "value": "has-many", + "raw": "\"has-many\"", + "range": [ + 14324, + 14334 + ], + "loc": { + "start": { + "line": 389, + "column": 13 + }, + "end": { + "line": 389, + "column": 23 + } + } + }, + "consequent": [ + { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "index", + "range": [ + 14352, + 14357 + ], + "loc": { + "start": { + "line": 390, + "column": 14 + }, + "end": { + "line": 390, + "column": 19 + } + } + }, + "init": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "dependentResource", + "range": [ + 14360, + 14377 + ], + "loc": { + "start": { + "line": 390, + "column": 22 + }, + "end": { + "line": 390, + "column": 39 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "dependent", + "range": [ + 14378, + 14387 + ], + "loc": { + "start": { + "line": 390, + "column": 40 + }, + "end": { + "line": 390, + "column": 49 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 14388, + 14397 + ], + "loc": { + "start": { + "line": 390, + "column": 50 + }, + "end": { + "line": 390, + "column": 59 + } + } + }, + "range": [ + 14378, + 14397 + ], + "loc": { + "start": { + "line": 390, + "column": 40 + }, + "end": { + "line": 390, + "column": 59 + } + } + }, + "range": [ + 14360, + 14398 + ], + "loc": { + "start": { + "line": 390, + "column": 22 + }, + "end": { + "line": 390, + "column": 60 + } + } + }, + "property": { + "type": "Identifier", + "name": "indexOf", + "range": [ + 14399, + 14406 + ], + "loc": { + "start": { + "line": 390, + "column": 61 + }, + "end": { + "line": 390, + "column": 68 + } + } + }, + "range": [ + 14360, + 14406 + ], + "loc": { + "start": { + "line": 390, + "column": 22 + }, + "end": { + "line": 390, + "column": 68 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "resource", + "range": [ + 14407, + 14415 + ], + "loc": { + "start": { + "line": 390, + "column": 69 + }, + "end": { + "line": 390, + "column": 77 + } + } + } + ], + "range": [ + 14360, + 14416 + ], + "loc": { + "start": { + "line": 390, + "column": 22 + }, + "end": { + "line": 390, + "column": 78 + } + } + }, + "range": [ + 14352, + 14416 + ], + "loc": { + "start": { + "line": 390, + "column": 14 + }, + "end": { + "line": 390, + "column": 78 + } + } + } + ], + "kind": "let", + "range": [ + 14348, + 14417 + ], + "loc": { + "start": { + "line": 390, + "column": 10 + }, + "end": { + "line": 390, + "column": 79 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "!==", + "left": { + "type": "Identifier", + "name": "index", + "range": [ + 14432, + 14437 + ], + "loc": { + "start": { + "line": 391, + "column": 14 + }, + "end": { + "line": 391, + "column": 19 + } + } + }, + "right": { + "type": "UnaryExpression", + "operator": "-", + "argument": { + "type": "Literal", + "value": 1, + "raw": "1", + "range": [ + 14443, + 14444 + ], + "loc": { + "start": { + "line": 391, + "column": 25 + }, + "end": { + "line": 391, + "column": 26 + } + } + }, + "prefix": true, + "range": [ + 14442, + 14444 + ], + "loc": { + "start": { + "line": 391, + "column": 24 + }, + "end": { + "line": 391, + "column": 26 + } + } + }, + "range": [ + 14432, + 14444 + ], + "loc": { + "start": { + "line": 391, + "column": 14 + }, + "end": { + "line": 391, + "column": 26 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "dependentResource", + "range": [ + 14460, + 14477 + ], + "loc": { + "start": { + "line": 392, + "column": 12 + }, + "end": { + "line": 392, + "column": 29 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "dependent", + "range": [ + 14478, + 14487 + ], + "loc": { + "start": { + "line": 392, + "column": 30 + }, + "end": { + "line": 392, + "column": 39 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 14488, + 14497 + ], + "loc": { + "start": { + "line": 392, + "column": 40 + }, + "end": { + "line": 392, + "column": 49 + } + } + }, + "range": [ + 14478, + 14497 + ], + "loc": { + "start": { + "line": 392, + "column": 30 + }, + "end": { + "line": 392, + "column": 49 + } + } + }, + "range": [ + 14460, + 14498 + ], + "loc": { + "start": { + "line": 392, + "column": 12 + }, + "end": { + "line": 392, + "column": 50 + } + } + }, + "property": { + "type": "Identifier", + "name": "splice", + "range": [ + 14499, + 14505 + ], + "loc": { + "start": { + "line": 392, + "column": 51 + }, + "end": { + "line": 392, + "column": 57 + } + } + }, + "range": [ + 14460, + 14505 + ], + "loc": { + "start": { + "line": 392, + "column": 12 + }, + "end": { + "line": 392, + "column": 57 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "name": "index", + "range": [ + 14506, + 14511 + ], + "loc": { + "start": { + "line": 392, + "column": 58 + }, + "end": { + "line": 392, + "column": 63 + } + } + }, + { + "type": "Literal", + "value": 1, + "raw": "1", + "range": [ + 14513, + 14514 + ], + "loc": { + "start": { + "line": 392, + "column": 65 + }, + "end": { + "line": 392, + "column": 66 + } + } + } + ], + "range": [ + 14460, + 14515 + ], + "loc": { + "start": { + "line": 392, + "column": 12 + }, + "end": { + "line": 392, + "column": 67 + } + } + }, + "range": [ + 14460, + 14516 + ], + "loc": { + "start": { + "line": 392, + "column": 12 + }, + "end": { + "line": 392, + "column": 68 + } + } + } + ], + "range": [ + 14446, + 14528 + ], + "loc": { + "start": { + "line": 391, + "column": 28 + }, + "end": { + "line": 393, + "column": 11 + } + } + }, + "alternate": null, + "range": [ + 14428, + 14528 + ], + "loc": { + "start": { + "line": 391, + "column": 10 + }, + "end": { + "line": 393, + "column": 11 + } + } + }, + { + "type": "BreakStatement", + "label": null, + "range": [ + 14539, + 14545 + ], + "loc": { + "start": { + "line": 394, + "column": 10 + }, + "end": { + "line": 394, + "column": 16 + } + } + } + ], + "range": [ + 14336, + 14555 + ], + "loc": { + "start": { + "line": 389, + "column": 25 + }, + "end": { + "line": 395, + "column": 9 + } + } + } + ], + "range": [ + 14319, + 14555 + ], + "loc": { + "start": { + "line": 389, + "column": 8 + }, + "end": { + "line": 395, + "column": 9 + } + } + }, + { + "type": "SwitchCase", + "test": null, + "consequent": [ + { + "type": "BlockStatement", + "body": [ + { + "type": "BreakStatement", + "label": null, + "range": [ + 14585, + 14591 + ], + "loc": { + "start": { + "line": 397, + "column": 10 + }, + "end": { + "line": 397, + "column": 16 + } + } + } + ], + "range": [ + 14573, + 14601 + ], + "loc": { + "start": { + "line": 396, + "column": 17 + }, + "end": { + "line": 398, + "column": 9 + } + } + } + ], + "range": [ + 14564, + 14601 + ], + "loc": { + "start": { + "line": 396, + "column": 8 + }, + "end": { + "line": 398, + "column": 9 + } + } + } + ], + "range": [ + 14136, + 14609 + ], + "loc": { + "start": { + "line": 384, + "column": 6 + }, + "end": { + "line": 399, + "column": 7 + } + }, + "trailingComments": [ + { + "type": "Line", + "value": " TODO: This only needs to be run once for each dependent.", + "range": [ + 14616, + 14675 + ], + "loc": { + "start": { + "line": 400, + "column": 6 + }, + "end": { + "line": 400, + "column": 65 + } + } + } + ] + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "dependentResource", + "range": [ + 14682, + 14699 + ], + "loc": { + "start": { + "line": 401, + "column": 6 + }, + "end": { + "line": 401, + "column": 23 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 14700, + 14711 + ], + "loc": { + "start": { + "line": 401, + "column": 24 + }, + "end": { + "line": 401, + "column": 35 + } + } + }, + "range": [ + 14682, + 14711 + ], + "loc": { + "start": { + "line": 401, + "column": 6 + }, + "end": { + "line": 401, + "column": 35 + } + } + }, + "right": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "dependentResource", + "range": [ + 14714, + 14731 + ], + "loc": { + "start": { + "line": 401, + "column": 38 + }, + "end": { + "line": 401, + "column": 55 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 14732, + 14743 + ], + "loc": { + "start": { + "line": 401, + "column": 56 + }, + "end": { + "line": 401, + "column": 67 + } + } + }, + "range": [ + 14714, + 14743 + ], + "loc": { + "start": { + "line": 401, + "column": 38 + }, + "end": { + "line": 401, + "column": 67 + } + } + }, + "property": { + "type": "Identifier", + "name": "filter", + "range": [ + 14744, + 14750 + ], + "loc": { + "start": { + "line": 401, + "column": 68 + }, + "end": { + "line": 401, + "column": 74 + } + } + }, + "range": [ + 14714, + 14750 + ], + "loc": { + "start": { + "line": 401, + "column": 38 + }, + "end": { + "line": 401, + "column": 74 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "d", + "range": [ + 14751, + 14752 + ], + "loc": { + "start": { + "line": 401, + "column": 75 + }, + "end": { + "line": 401, + "column": 76 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "UnaryExpression", + "operator": "!", + "argument": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "d", + "range": [ + 14775, + 14776 + ], + "loc": { + "start": { + "line": 402, + "column": 17 + }, + "end": { + "line": 402, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 14777, + 14781 + ], + "loc": { + "start": { + "line": 402, + "column": 19 + }, + "end": { + "line": 402, + "column": 23 + } + } + }, + "range": [ + 14775, + 14781 + ], + "loc": { + "start": { + "line": 402, + "column": 17 + }, + "end": { + "line": 402, + "column": 23 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "resource", + "range": [ + 14786, + 14794 + ], + "loc": { + "start": { + "line": 402, + "column": 28 + }, + "end": { + "line": 402, + "column": 36 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 14795, + 14799 + ], + "loc": { + "start": { + "line": 402, + "column": 37 + }, + "end": { + "line": 402, + "column": 41 + } + } + }, + "range": [ + 14786, + 14799 + ], + "loc": { + "start": { + "line": 402, + "column": 28 + }, + "end": { + "line": 402, + "column": 41 + } + } + }, + "range": [ + 14775, + 14799 + ], + "loc": { + "start": { + "line": 402, + "column": 17 + }, + "end": { + "line": 402, + "column": 41 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "d", + "range": [ + 14803, + 14804 + ], + "loc": { + "start": { + "line": 402, + "column": 45 + }, + "end": { + "line": 402, + "column": 46 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 14805, + 14807 + ], + "loc": { + "start": { + "line": 402, + "column": 47 + }, + "end": { + "line": 402, + "column": 49 + } + } + }, + "range": [ + 14803, + 14807 + ], + "loc": { + "start": { + "line": 402, + "column": 45 + }, + "end": { + "line": 402, + "column": 49 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "resource", + "range": [ + 14812, + 14820 + ], + "loc": { + "start": { + "line": 402, + "column": 54 + }, + "end": { + "line": 402, + "column": 62 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 14821, + 14823 + ], + "loc": { + "start": { + "line": 402, + "column": 63 + }, + "end": { + "line": 402, + "column": 65 + } + } + }, + "range": [ + 14812, + 14823 + ], + "loc": { + "start": { + "line": 402, + "column": 54 + }, + "end": { + "line": 402, + "column": 65 + } + } + }, + "range": [ + 14803, + 14823 + ], + "loc": { + "start": { + "line": 402, + "column": 45 + }, + "end": { + "line": 402, + "column": 65 + } + } + }, + "range": [ + 14775, + 14823 + ], + "loc": { + "start": { + "line": 402, + "column": 17 + }, + "end": { + "line": 402, + "column": 65 + } + } + }, + "prefix": true, + "range": [ + 14773, + 14824 + ], + "loc": { + "start": { + "line": 402, + "column": 15 + }, + "end": { + "line": 402, + "column": 66 + } + } + }, + "range": [ + 14766, + 14825 + ], + "loc": { + "start": { + "line": 402, + "column": 8 + }, + "end": { + "line": 402, + "column": 67 + } + } + } + ], + "range": [ + 14756, + 14833 + ], + "loc": { + "start": { + "line": 401, + "column": 80 + }, + "end": { + "line": 403, + "column": 7 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 14751, + 14833 + ], + "loc": { + "start": { + "line": 401, + "column": 75 + }, + "end": { + "line": 403, + "column": 7 + } + } + } + ], + "range": [ + 14714, + 14834 + ], + "loc": { + "start": { + "line": 401, + "column": 38 + }, + "end": { + "line": 403, + "column": 8 + } + } + }, + "range": [ + 14682, + 14834 + ], + "loc": { + "start": { + "line": 401, + "column": 6 + }, + "end": { + "line": 403, + "column": 8 + } + } + }, + "range": [ + 14682, + 14835 + ], + "loc": { + "start": { + "line": 401, + "column": 6 + }, + "end": { + "line": 403, + "column": 9 + } + }, + "leadingComments": [ + { + "type": "Line", + "value": " TODO: This only needs to be run once for each dependent.", + "range": [ + 14616, + 14675 + ], + "loc": { + "start": { + "line": 400, + "column": 6 + }, + "end": { + "line": 400, + "column": 65 + } + } + } + ] + } + ], + "range": [ + 14056, + 14841 + ], + "loc": { + "start": { + "line": 382, + "column": 46 + }, + "end": { + "line": 404, + "column": 5 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 14043, + 14841 + ], + "loc": { + "start": { + "line": 382, + "column": 33 + }, + "end": { + "line": 404, + "column": 5 + } + } + } + ], + "range": [ + 14014, + 14842 + ], + "loc": { + "start": { + "line": 382, + "column": 4 + }, + "end": { + "line": 404, + "column": 6 + } + } + }, + "range": [ + 14014, + 14843 + ], + "loc": { + "start": { + "line": 382, + "column": 4 + }, + "end": { + "line": 404, + "column": 7 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "UnaryExpression", + "operator": "delete", + "argument": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 14855, + 14859 + ], + "loc": { + "start": { + "line": 405, + "column": 11 + }, + "end": { + "line": 405, + "column": 15 + } + } + }, + "property": { + "type": "Identifier", + "name": "_data", + "range": [ + 14860, + 14865 + ], + "loc": { + "start": { + "line": 405, + "column": 16 + }, + "end": { + "line": 405, + "column": 21 + } + } + }, + "range": [ + 14855, + 14865 + ], + "loc": { + "start": { + "line": 405, + "column": 11 + }, + "end": { + "line": 405, + "column": 21 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "resource", + "range": [ + 14866, + 14874 + ], + "loc": { + "start": { + "line": 405, + "column": 22 + }, + "end": { + "line": 405, + "column": 30 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 14875, + 14879 + ], + "loc": { + "start": { + "line": 405, + "column": 31 + }, + "end": { + "line": 405, + "column": 35 + } + } + }, + "range": [ + 14866, + 14879 + ], + "loc": { + "start": { + "line": 405, + "column": 22 + }, + "end": { + "line": 405, + "column": 35 + } + } + }, + "range": [ + 14855, + 14880 + ], + "loc": { + "start": { + "line": 405, + "column": 11 + }, + "end": { + "line": 405, + "column": 36 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "resource", + "range": [ + 14881, + 14889 + ], + "loc": { + "start": { + "line": 405, + "column": 37 + }, + "end": { + "line": 405, + "column": 45 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 14890, + 14892 + ], + "loc": { + "start": { + "line": 405, + "column": 46 + }, + "end": { + "line": 405, + "column": 48 + } + } + }, + "range": [ + 14881, + 14892 + ], + "loc": { + "start": { + "line": 405, + "column": 37 + }, + "end": { + "line": 405, + "column": 48 + } + } + }, + "range": [ + 14855, + 14893 + ], + "loc": { + "start": { + "line": 405, + "column": 11 + }, + "end": { + "line": 405, + "column": 49 + } + } + }, + "prefix": true, + "range": [ + 14848, + 14893 + ], + "loc": { + "start": { + "line": 405, + "column": 4 + }, + "end": { + "line": 405, + "column": 49 + } + } + }, + "range": [ + 14848, + 14894 + ], + "loc": { + "start": { + "line": 405, + "column": 4 + }, + "end": { + "line": 405, + "column": 50 + } + } + } + ], + "range": [ + 14008, + 14898 + ], + "loc": { + "start": { + "line": 381, + "column": 20 + }, + "end": { + "line": 406, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 13997, + 14898 + ], + "loc": { + "start": { + "line": 381, + "column": 9 + }, + "end": { + "line": 406, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 13990, + 14898 + ], + "loc": { + "start": { + "line": 381, + "column": 2 + }, + "end": { + "line": 406, + "column": 3 + } + }, + "static": false + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_removeInverseRelationship", + "range": [ + 14902, + 14928 + ], + "loc": { + "start": { + "line": 408, + "column": 2 + }, + "end": { + "line": 408, + "column": 28 + } + } + }, + "value": { + "type": "FunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 14929, + 14943 + ], + "loc": { + "start": { + "line": 408, + "column": 29 + }, + "end": { + "line": 408, + "column": 43 + } + } + }, + { + "type": "Identifier", + "name": "sourceFieldName", + "range": [ + 14945, + 14960 + ], + "loc": { + "start": { + "line": 408, + "column": 45 + }, + "end": { + "line": 408, + "column": 60 + } + } + }, + { + "type": "Identifier", + "name": "targetResource", + "range": [ + 14962, + 14976 + ], + "loc": { + "start": { + "line": 408, + "column": 62 + }, + "end": { + "line": 408, + "column": 76 + } + } + }, + { + "type": "Identifier", + "name": "sourceField", + "range": [ + 14978, + 14989 + ], + "loc": { + "start": { + "line": 408, + "column": 78 + }, + "end": { + "line": 408, + "column": 89 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "targetDefinition", + "range": [ + 15001, + 15017 + ], + "loc": { + "start": { + "line": 409, + "column": 8 + }, + "end": { + "line": 409, + "column": 24 + } + } + }, + "init": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "ThisExpression", + "range": [ + 15020, + 15024 + ], + "loc": { + "start": { + "line": 409, + "column": 27 + }, + "end": { + "line": 409, + "column": 31 + } + } + }, + "property": { + "type": "Identifier", + "name": "_types", + "range": [ + 15025, + 15031 + ], + "loc": { + "start": { + "line": 409, + "column": 32 + }, + "end": { + "line": 409, + "column": 38 + } + } + }, + "range": [ + 15020, + 15031 + ], + "loc": { + "start": { + "line": 409, + "column": 27 + }, + "end": { + "line": 409, + "column": 38 + } + } + }, + "property": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 15032, + 15046 + ], + "loc": { + "start": { + "line": 409, + "column": 39 + }, + "end": { + "line": 409, + "column": 53 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 15047, + 15051 + ], + "loc": { + "start": { + "line": 409, + "column": 54 + }, + "end": { + "line": 409, + "column": 58 + } + } + }, + "range": [ + 15032, + 15051 + ], + "loc": { + "start": { + "line": 409, + "column": 39 + }, + "end": { + "line": 409, + "column": 58 + } + } + }, + "range": [ + 15020, + 15052 + ], + "loc": { + "start": { + "line": 409, + "column": 27 + }, + "end": { + "line": 409, + "column": 59 + } + } + }, + "range": [ + 15001, + 15052 + ], + "loc": { + "start": { + "line": 409, + "column": 8 + }, + "end": { + "line": 409, + "column": 59 + } + } + } + ], + "kind": "var", + "range": [ + 14997, + 15053 + ], + "loc": { + "start": { + "line": 409, + "column": 4 + }, + "end": { + "line": 409, + "column": 60 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 15062, + 15077 + ], + "loc": { + "start": { + "line": 410, + "column": 8 + }, + "end": { + "line": 410, + "column": 23 + } + } + }, + "init": { + "type": "LogicalExpression", + "operator": "||", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceField", + "range": [ + 15080, + 15091 + ], + "loc": { + "start": { + "line": 410, + "column": 26 + }, + "end": { + "line": 410, + "column": 37 + } + } + }, + "property": { + "type": "Identifier", + "name": "inverse", + "range": [ + 15092, + 15099 + ], + "loc": { + "start": { + "line": 410, + "column": 38 + }, + "end": { + "line": 410, + "column": 45 + } + } + }, + "range": [ + 15080, + 15099 + ], + "loc": { + "start": { + "line": 410, + "column": 26 + }, + "end": { + "line": 410, + "column": 45 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 15103, + 15117 + ], + "loc": { + "start": { + "line": 410, + "column": 49 + }, + "end": { + "line": 410, + "column": 63 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 15118, + 15122 + ], + "loc": { + "start": { + "line": 410, + "column": 64 + }, + "end": { + "line": 410, + "column": 68 + } + } + }, + "range": [ + 15103, + 15122 + ], + "loc": { + "start": { + "line": 410, + "column": 49 + }, + "end": { + "line": 410, + "column": 68 + } + } + }, + "range": [ + 15080, + 15122 + ], + "loc": { + "start": { + "line": 410, + "column": 26 + }, + "end": { + "line": 410, + "column": 68 + } + } + }, + "range": [ + 15062, + 15122 + ], + "loc": { + "start": { + "line": 410, + "column": 8 + }, + "end": { + "line": 410, + "column": 68 + } + } + } + ], + "kind": "var", + "range": [ + 15058, + 15123 + ], + "loc": { + "start": { + "line": 410, + "column": 4 + }, + "end": { + "line": 410, + "column": 69 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "targetField", + "range": [ + 15132, + 15143 + ], + "loc": { + "start": { + "line": 411, + "column": 8 + }, + "end": { + "line": 411, + "column": 19 + } + } + }, + "init": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "Identifier", + "name": "targetDefinition", + "range": [ + 15146, + 15162 + ], + "loc": { + "start": { + "line": 411, + "column": 22 + }, + "end": { + "line": 411, + "column": 38 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "targetDefinition", + "range": [ + 15166, + 15182 + ], + "loc": { + "start": { + "line": 411, + "column": 42 + }, + "end": { + "line": 411, + "column": 58 + } + } + }, + "property": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 15183, + 15198 + ], + "loc": { + "start": { + "line": 411, + "column": 59 + }, + "end": { + "line": 411, + "column": 74 + } + } + }, + "range": [ + 15166, + 15199 + ], + "loc": { + "start": { + "line": 411, + "column": 42 + }, + "end": { + "line": 411, + "column": 75 + } + } + }, + "range": [ + 15146, + 15199 + ], + "loc": { + "start": { + "line": 411, + "column": 22 + }, + "end": { + "line": 411, + "column": 75 + } + } + }, + "range": [ + 15132, + 15199 + ], + "loc": { + "start": { + "line": 411, + "column": 8 + }, + "end": { + "line": 411, + "column": 75 + } + } + } + ], + "kind": "var", + "range": [ + 15128, + 15200 + ], + "loc": { + "start": { + "line": 411, + "column": 4 + }, + "end": { + "line": 411, + "column": 76 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 15205, + 15219 + ], + "loc": { + "start": { + "line": 412, + "column": 4 + }, + "end": { + "line": 412, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 15220, + 15231 + ], + "loc": { + "start": { + "line": 412, + "column": 19 + }, + "end": { + "line": 412, + "column": 30 + } + } + }, + "range": [ + 15205, + 15231 + ], + "loc": { + "start": { + "line": 412, + "column": 4 + }, + "end": { + "line": 412, + "column": 30 + } + } + }, + "right": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 15234, + 15248 + ], + "loc": { + "start": { + "line": 412, + "column": 33 + }, + "end": { + "line": 412, + "column": 47 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 15249, + 15260 + ], + "loc": { + "start": { + "line": 412, + "column": 48 + }, + "end": { + "line": 412, + "column": 59 + } + } + }, + "range": [ + 15234, + 15260 + ], + "loc": { + "start": { + "line": 412, + "column": 33 + }, + "end": { + "line": 412, + "column": 59 + } + } + }, + "property": { + "type": "Identifier", + "name": "filter", + "range": [ + 15261, + 15267 + ], + "loc": { + "start": { + "line": 412, + "column": 60 + }, + "end": { + "line": 412, + "column": 66 + } + } + }, + "range": [ + 15234, + 15267 + ], + "loc": { + "start": { + "line": 412, + "column": 33 + }, + "end": { + "line": 412, + "column": 66 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "r", + "range": [ + 15268, + 15269 + ], + "loc": { + "start": { + "line": 412, + "column": 67 + }, + "end": { + "line": 412, + "column": 68 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "UnaryExpression", + "operator": "!", + "argument": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "r", + "range": [ + 15290, + 15291 + ], + "loc": { + "start": { + "line": 413, + "column": 15 + }, + "end": { + "line": 413, + "column": 16 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 15292, + 15296 + ], + "loc": { + "start": { + "line": 413, + "column": 17 + }, + "end": { + "line": 413, + "column": 21 + } + } + }, + "range": [ + 15290, + 15296 + ], + "loc": { + "start": { + "line": 413, + "column": 15 + }, + "end": { + "line": 413, + "column": 21 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 15301, + 15315 + ], + "loc": { + "start": { + "line": 413, + "column": 26 + }, + "end": { + "line": 413, + "column": 40 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 15316, + 15320 + ], + "loc": { + "start": { + "line": 413, + "column": 41 + }, + "end": { + "line": 413, + "column": 45 + } + } + }, + "range": [ + 15301, + 15320 + ], + "loc": { + "start": { + "line": 413, + "column": 26 + }, + "end": { + "line": 413, + "column": 45 + } + } + }, + "range": [ + 15290, + 15320 + ], + "loc": { + "start": { + "line": 413, + "column": 15 + }, + "end": { + "line": 413, + "column": 45 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "r", + "range": [ + 15324, + 15325 + ], + "loc": { + "start": { + "line": 413, + "column": 49 + }, + "end": { + "line": 413, + "column": 50 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 15326, + 15328 + ], + "loc": { + "start": { + "line": 413, + "column": 51 + }, + "end": { + "line": 413, + "column": 53 + } + } + }, + "range": [ + 15324, + 15328 + ], + "loc": { + "start": { + "line": 413, + "column": 49 + }, + "end": { + "line": 413, + "column": 53 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 15333, + 15347 + ], + "loc": { + "start": { + "line": 413, + "column": 58 + }, + "end": { + "line": 413, + "column": 72 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 15348, + 15350 + ], + "loc": { + "start": { + "line": 413, + "column": 73 + }, + "end": { + "line": 413, + "column": 75 + } + } + }, + "range": [ + 15333, + 15350 + ], + "loc": { + "start": { + "line": 413, + "column": 58 + }, + "end": { + "line": 413, + "column": 75 + } + } + }, + "range": [ + 15324, + 15350 + ], + "loc": { + "start": { + "line": 413, + "column": 49 + }, + "end": { + "line": 413, + "column": 75 + } + } + }, + "range": [ + 15290, + 15350 + ], + "loc": { + "start": { + "line": 413, + "column": 15 + }, + "end": { + "line": 413, + "column": 75 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "r", + "range": [ + 15354, + 15355 + ], + "loc": { + "start": { + "line": 413, + "column": 79 + }, + "end": { + "line": 413, + "column": 80 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 15356, + 15365 + ], + "loc": { + "start": { + "line": 413, + "column": 81 + }, + "end": { + "line": 413, + "column": 90 + } + } + }, + "range": [ + 15354, + 15365 + ], + "loc": { + "start": { + "line": 413, + "column": 79 + }, + "end": { + "line": 413, + "column": 90 + } + } + }, + "right": { + "type": "Identifier", + "name": "sourceFieldName", + "range": [ + 15370, + 15385 + ], + "loc": { + "start": { + "line": 413, + "column": 95 + }, + "end": { + "line": 413, + "column": 110 + } + } + }, + "range": [ + 15354, + 15385 + ], + "loc": { + "start": { + "line": 413, + "column": 79 + }, + "end": { + "line": 413, + "column": 110 + } + } + }, + "range": [ + 15290, + 15385 + ], + "loc": { + "start": { + "line": 413, + "column": 15 + }, + "end": { + "line": 413, + "column": 110 + } + } + }, + "prefix": true, + "range": [ + 15288, + 15386 + ], + "loc": { + "start": { + "line": 413, + "column": 13 + }, + "end": { + "line": 413, + "column": 111 + } + } + }, + "range": [ + 15281, + 15387 + ], + "loc": { + "start": { + "line": 413, + "column": 6 + }, + "end": { + "line": 413, + "column": 112 + } + } + } + ], + "range": [ + 15273, + 15393 + ], + "loc": { + "start": { + "line": 412, + "column": 72 + }, + "end": { + "line": 414, + "column": 5 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 15268, + 15393 + ], + "loc": { + "start": { + "line": 412, + "column": 67 + }, + "end": { + "line": 414, + "column": 5 + } + } + } + ], + "range": [ + 15234, + 15394 + ], + "loc": { + "start": { + "line": 412, + "column": 33 + }, + "end": { + "line": 414, + "column": 6 + } + } + }, + "range": [ + 15205, + 15394 + ], + "loc": { + "start": { + "line": 412, + "column": 4 + }, + "end": { + "line": 414, + "column": 6 + } + } + }, + "range": [ + 15205, + 15395 + ], + "loc": { + "start": { + "line": 412, + "column": 4 + }, + "end": { + "line": 414, + "column": 7 + } + } + }, + { + "type": "IfStatement", + "test": { + "type": "Identifier", + "name": "targetField", + "range": [ + 15404, + 15415 + ], + "loc": { + "start": { + "line": 415, + "column": 8 + }, + "end": { + "line": 415, + "column": 19 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetField", + "range": [ + 15429, + 15440 + ], + "loc": { + "start": { + "line": 416, + "column": 10 + }, + "end": { + "line": 416, + "column": 21 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 15441, + 15445 + ], + "loc": { + "start": { + "line": 416, + "column": 22 + }, + "end": { + "line": 416, + "column": 26 + } + } + }, + "range": [ + 15429, + 15445 + ], + "loc": { + "start": { + "line": 416, + "column": 10 + }, + "end": { + "line": 416, + "column": 26 + } + } + }, + "right": { + "type": "Literal", + "value": "has-one", + "raw": "\"has-one\"", + "range": [ + 15450, + 15459 + ], + "loc": { + "start": { + "line": 416, + "column": 31 + }, + "end": { + "line": 416, + "column": 40 + } + } + }, + "range": [ + 15429, + 15459 + ], + "loc": { + "start": { + "line": 416, + "column": 10 + }, + "end": { + "line": 416, + "column": 40 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 15471, + 15485 + ], + "loc": { + "start": { + "line": 417, + "column": 8 + }, + "end": { + "line": 417, + "column": 22 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 15486, + 15497 + ], + "loc": { + "start": { + "line": 417, + "column": 23 + }, + "end": { + "line": 417, + "column": 34 + } + } + }, + "range": [ + 15471, + 15497 + ], + "loc": { + "start": { + "line": 417, + "column": 8 + }, + "end": { + "line": 417, + "column": 34 + } + } + }, + "right": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 15500, + 15514 + ], + "loc": { + "start": { + "line": 417, + "column": 37 + }, + "end": { + "line": 417, + "column": 51 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 15515, + 15526 + ], + "loc": { + "start": { + "line": 417, + "column": 52 + }, + "end": { + "line": 417, + "column": 63 + } + } + }, + "range": [ + 15500, + 15526 + ], + "loc": { + "start": { + "line": 417, + "column": 37 + }, + "end": { + "line": 417, + "column": 63 + } + } + }, + "property": { + "type": "Identifier", + "name": "filter", + "range": [ + 15527, + 15533 + ], + "loc": { + "start": { + "line": 417, + "column": 64 + }, + "end": { + "line": 417, + "column": 70 + } + } + }, + "range": [ + 15500, + 15533 + ], + "loc": { + "start": { + "line": 417, + "column": 37 + }, + "end": { + "line": 417, + "column": 70 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "r", + "range": [ + 15534, + 15535 + ], + "loc": { + "start": { + "line": 417, + "column": 71 + }, + "end": { + "line": 417, + "column": 72 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "UnaryExpression", + "operator": "!", + "argument": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "r", + "range": [ + 15560, + 15561 + ], + "loc": { + "start": { + "line": 418, + "column": 19 + }, + "end": { + "line": 418, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 15562, + 15566 + ], + "loc": { + "start": { + "line": 418, + "column": 21 + }, + "end": { + "line": 418, + "column": 25 + } + } + }, + "range": [ + 15560, + 15566 + ], + "loc": { + "start": { + "line": 418, + "column": 19 + }, + "end": { + "line": 418, + "column": 25 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 15571, + 15585 + ], + "loc": { + "start": { + "line": 418, + "column": 30 + }, + "end": { + "line": 418, + "column": 44 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 15586, + 15590 + ], + "loc": { + "start": { + "line": 418, + "column": 45 + }, + "end": { + "line": 418, + "column": 49 + } + } + }, + "range": [ + 15571, + 15590 + ], + "loc": { + "start": { + "line": 418, + "column": 30 + }, + "end": { + "line": 418, + "column": 49 + } + } + }, + "range": [ + 15560, + 15590 + ], + "loc": { + "start": { + "line": 418, + "column": 19 + }, + "end": { + "line": 418, + "column": 49 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "r", + "range": [ + 15594, + 15595 + ], + "loc": { + "start": { + "line": 418, + "column": 53 + }, + "end": { + "line": 418, + "column": 54 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 15596, + 15598 + ], + "loc": { + "start": { + "line": 418, + "column": 55 + }, + "end": { + "line": 418, + "column": 57 + } + } + }, + "range": [ + 15594, + 15598 + ], + "loc": { + "start": { + "line": 418, + "column": 53 + }, + "end": { + "line": 418, + "column": 57 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 15603, + 15617 + ], + "loc": { + "start": { + "line": 418, + "column": 62 + }, + "end": { + "line": 418, + "column": 76 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 15618, + 15620 + ], + "loc": { + "start": { + "line": 418, + "column": 77 + }, + "end": { + "line": 418, + "column": 79 + } + } + }, + "range": [ + 15603, + 15620 + ], + "loc": { + "start": { + "line": 418, + "column": 62 + }, + "end": { + "line": 418, + "column": 79 + } + } + }, + "range": [ + 15594, + 15620 + ], + "loc": { + "start": { + "line": 418, + "column": 53 + }, + "end": { + "line": 418, + "column": 79 + } + } + }, + "range": [ + 15560, + 15620 + ], + "loc": { + "start": { + "line": 418, + "column": 19 + }, + "end": { + "line": 418, + "column": 79 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "r", + "range": [ + 15624, + 15625 + ], + "loc": { + "start": { + "line": 418, + "column": 83 + }, + "end": { + "line": 418, + "column": 84 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 15626, + 15635 + ], + "loc": { + "start": { + "line": 418, + "column": 85 + }, + "end": { + "line": 418, + "column": 94 + } + } + }, + "range": [ + 15624, + 15635 + ], + "loc": { + "start": { + "line": 418, + "column": 83 + }, + "end": { + "line": 418, + "column": 94 + } + } + }, + "right": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 15640, + 15655 + ], + "loc": { + "start": { + "line": 418, + "column": 99 + }, + "end": { + "line": 418, + "column": 114 + } + } + }, + "range": [ + 15624, + 15655 + ], + "loc": { + "start": { + "line": 418, + "column": 83 + }, + "end": { + "line": 418, + "column": 114 + } + } + }, + "range": [ + 15560, + 15655 + ], + "loc": { + "start": { + "line": 418, + "column": 19 + }, + "end": { + "line": 418, + "column": 114 + } + } + }, + "prefix": true, + "range": [ + 15558, + 15656 + ], + "loc": { + "start": { + "line": 418, + "column": 17 + }, + "end": { + "line": 418, + "column": 115 + } + } + }, + "range": [ + 15551, + 15657 + ], + "loc": { + "start": { + "line": 418, + "column": 10 + }, + "end": { + "line": 418, + "column": 116 + } + } + } + ], + "range": [ + 15539, + 15667 + ], + "loc": { + "start": { + "line": 417, + "column": 76 + }, + "end": { + "line": 419, + "column": 9 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 15534, + 15667 + ], + "loc": { + "start": { + "line": 417, + "column": 71 + }, + "end": { + "line": 419, + "column": 9 + } + } + } + ], + "range": [ + 15500, + 15668 + ], + "loc": { + "start": { + "line": 417, + "column": 37 + }, + "end": { + "line": 419, + "column": 10 + } + } + }, + "range": [ + 15471, + 15668 + ], + "loc": { + "start": { + "line": 417, + "column": 8 + }, + "end": { + "line": 419, + "column": 10 + } + } + }, + "range": [ + 15471, + 15669 + ], + "loc": { + "start": { + "line": 417, + "column": 8 + }, + "end": { + "line": 419, + "column": 11 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 15678, + 15692 + ], + "loc": { + "start": { + "line": 420, + "column": 8 + }, + "end": { + "line": 420, + "column": 22 + } + } + }, + "property": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 15693, + 15708 + ], + "loc": { + "start": { + "line": 420, + "column": 23 + }, + "end": { + "line": 420, + "column": 38 + } + } + }, + "range": [ + 15678, + 15709 + ], + "loc": { + "start": { + "line": 420, + "column": 8 + }, + "end": { + "line": 420, + "column": 39 + } + } + }, + "right": { + "type": "Literal", + "value": null, + "raw": "null", + "range": [ + 15712, + 15716 + ], + "loc": { + "start": { + "line": 420, + "column": 42 + }, + "end": { + "line": 420, + "column": 46 + } + } + }, + "range": [ + 15678, + 15716 + ], + "loc": { + "start": { + "line": 420, + "column": 8 + }, + "end": { + "line": 420, + "column": 46 + } + } + }, + "range": [ + 15678, + 15717 + ], + "loc": { + "start": { + "line": 420, + "column": 8 + }, + "end": { + "line": 420, + "column": 47 + } + } + } + ], + "range": [ + 15461, + 15725 + ], + "loc": { + "start": { + "line": 416, + "column": 42 + }, + "end": { + "line": 421, + "column": 7 + } + } + }, + "alternate": { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetField", + "range": [ + 15735, + 15746 + ], + "loc": { + "start": { + "line": 421, + "column": 17 + }, + "end": { + "line": 421, + "column": 28 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 15747, + 15751 + ], + "loc": { + "start": { + "line": 421, + "column": 29 + }, + "end": { + "line": 421, + "column": 33 + } + } + }, + "range": [ + 15735, + 15751 + ], + "loc": { + "start": { + "line": 421, + "column": 17 + }, + "end": { + "line": 421, + "column": 33 + } + } + }, + "right": { + "type": "Literal", + "value": "has-many", + "raw": "\"has-many\"", + "range": [ + 15756, + 15766 + ], + "loc": { + "start": { + "line": 421, + "column": 38 + }, + "end": { + "line": 421, + "column": 48 + } + } + }, + "range": [ + 15735, + 15766 + ], + "loc": { + "start": { + "line": 421, + "column": 17 + }, + "end": { + "line": 421, + "column": 48 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 15778, + 15792 + ], + "loc": { + "start": { + "line": 422, + "column": 8 + }, + "end": { + "line": 422, + "column": 22 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 15793, + 15804 + ], + "loc": { + "start": { + "line": 422, + "column": 23 + }, + "end": { + "line": 422, + "column": 34 + } + } + }, + "range": [ + 15778, + 15804 + ], + "loc": { + "start": { + "line": 422, + "column": 8 + }, + "end": { + "line": 422, + "column": 34 + } + } + }, + "right": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 15807, + 15821 + ], + "loc": { + "start": { + "line": 422, + "column": 37 + }, + "end": { + "line": 422, + "column": 51 + } + } + }, + "property": { + "type": "Identifier", + "name": "_dependents", + "range": [ + 15822, + 15833 + ], + "loc": { + "start": { + "line": 422, + "column": 52 + }, + "end": { + "line": 422, + "column": 63 + } + } + }, + "range": [ + 15807, + 15833 + ], + "loc": { + "start": { + "line": 422, + "column": 37 + }, + "end": { + "line": 422, + "column": 63 + } + } + }, + "property": { + "type": "Identifier", + "name": "filter", + "range": [ + 15834, + 15840 + ], + "loc": { + "start": { + "line": 422, + "column": 64 + }, + "end": { + "line": 422, + "column": 70 + } + } + }, + "range": [ + 15807, + 15840 + ], + "loc": { + "start": { + "line": 422, + "column": 37 + }, + "end": { + "line": 422, + "column": 70 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "r", + "range": [ + 15841, + 15842 + ], + "loc": { + "start": { + "line": 422, + "column": 71 + }, + "end": { + "line": 422, + "column": 72 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "UnaryExpression", + "operator": "!", + "argument": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "LogicalExpression", + "operator": "&&", + "left": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "r", + "range": [ + 15867, + 15868 + ], + "loc": { + "start": { + "line": 423, + "column": 19 + }, + "end": { + "line": 423, + "column": 20 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 15869, + 15873 + ], + "loc": { + "start": { + "line": 423, + "column": 21 + }, + "end": { + "line": 423, + "column": 25 + } + } + }, + "range": [ + 15867, + 15873 + ], + "loc": { + "start": { + "line": 423, + "column": 19 + }, + "end": { + "line": 423, + "column": 25 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 15878, + 15892 + ], + "loc": { + "start": { + "line": 423, + "column": 30 + }, + "end": { + "line": 423, + "column": 44 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 15893, + 15897 + ], + "loc": { + "start": { + "line": 423, + "column": 45 + }, + "end": { + "line": 423, + "column": 49 + } + } + }, + "range": [ + 15878, + 15897 + ], + "loc": { + "start": { + "line": 423, + "column": 30 + }, + "end": { + "line": 423, + "column": 49 + } + } + }, + "range": [ + 15867, + 15897 + ], + "loc": { + "start": { + "line": 423, + "column": 19 + }, + "end": { + "line": 423, + "column": 49 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "r", + "range": [ + 15901, + 15902 + ], + "loc": { + "start": { + "line": 423, + "column": 53 + }, + "end": { + "line": 423, + "column": 54 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 15903, + 15905 + ], + "loc": { + "start": { + "line": 423, + "column": 55 + }, + "end": { + "line": 423, + "column": 57 + } + } + }, + "range": [ + 15901, + 15905 + ], + "loc": { + "start": { + "line": 423, + "column": 53 + }, + "end": { + "line": 423, + "column": 57 + } + } + }, + "right": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 15910, + 15924 + ], + "loc": { + "start": { + "line": 423, + "column": 62 + }, + "end": { + "line": 423, + "column": 76 + } + } + }, + "property": { + "type": "Identifier", + "name": "id", + "range": [ + 15925, + 15927 + ], + "loc": { + "start": { + "line": 423, + "column": 77 + }, + "end": { + "line": 423, + "column": 79 + } + } + }, + "range": [ + 15910, + 15927 + ], + "loc": { + "start": { + "line": 423, + "column": 62 + }, + "end": { + "line": 423, + "column": 79 + } + } + }, + "range": [ + 15901, + 15927 + ], + "loc": { + "start": { + "line": 423, + "column": 53 + }, + "end": { + "line": 423, + "column": 79 + } + } + }, + "range": [ + 15867, + 15927 + ], + "loc": { + "start": { + "line": 423, + "column": 19 + }, + "end": { + "line": 423, + "column": 79 + } + } + }, + "right": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "r", + "range": [ + 15931, + 15932 + ], + "loc": { + "start": { + "line": 423, + "column": 83 + }, + "end": { + "line": 423, + "column": 84 + } + } + }, + "property": { + "type": "Identifier", + "name": "fieldName", + "range": [ + 15933, + 15942 + ], + "loc": { + "start": { + "line": 423, + "column": 85 + }, + "end": { + "line": 423, + "column": 94 + } + } + }, + "range": [ + 15931, + 15942 + ], + "loc": { + "start": { + "line": 423, + "column": 83 + }, + "end": { + "line": 423, + "column": 94 + } + } + }, + "right": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 15947, + 15962 + ], + "loc": { + "start": { + "line": 423, + "column": 99 + }, + "end": { + "line": 423, + "column": 114 + } + } + }, + "range": [ + 15931, + 15962 + ], + "loc": { + "start": { + "line": 423, + "column": 83 + }, + "end": { + "line": 423, + "column": 114 + } + } + }, + "range": [ + 15867, + 15962 + ], + "loc": { + "start": { + "line": 423, + "column": 19 + }, + "end": { + "line": 423, + "column": 114 + } + } + }, + "prefix": true, + "range": [ + 15865, + 15963 + ], + "loc": { + "start": { + "line": 423, + "column": 17 + }, + "end": { + "line": 423, + "column": 115 + } + } + }, + "range": [ + 15858, + 15964 + ], + "loc": { + "start": { + "line": 423, + "column": 10 + }, + "end": { + "line": 423, + "column": 116 + } + } + } + ], + "range": [ + 15846, + 15974 + ], + "loc": { + "start": { + "line": 422, + "column": 76 + }, + "end": { + "line": 424, + "column": 9 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 15841, + 15974 + ], + "loc": { + "start": { + "line": 422, + "column": 71 + }, + "end": { + "line": 424, + "column": 9 + } + } + } + ], + "range": [ + 15807, + 15975 + ], + "loc": { + "start": { + "line": 422, + "column": 37 + }, + "end": { + "line": 424, + "column": 10 + } + } + }, + "range": [ + 15778, + 15975 + ], + "loc": { + "start": { + "line": 422, + "column": 8 + }, + "end": { + "line": 424, + "column": 10 + } + } + }, + "range": [ + 15778, + 15976 + ], + "loc": { + "start": { + "line": 422, + "column": 8 + }, + "end": { + "line": 424, + "column": 11 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 15985, + 15999 + ], + "loc": { + "start": { + "line": 425, + "column": 8 + }, + "end": { + "line": 425, + "column": 22 + } + } + }, + "property": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 16000, + 16015 + ], + "loc": { + "start": { + "line": 425, + "column": 23 + }, + "end": { + "line": 425, + "column": 38 + } + } + }, + "range": [ + 15985, + 16016 + ], + "loc": { + "start": { + "line": 425, + "column": 8 + }, + "end": { + "line": 425, + "column": 39 + } + } + }, + "right": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "MemberExpression", + "computed": true, + "object": { + "type": "Identifier", + "name": "targetResource", + "range": [ + 16019, + 16033 + ], + "loc": { + "start": { + "line": 425, + "column": 42 + }, + "end": { + "line": 425, + "column": 56 + } + } + }, + "property": { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 16034, + 16049 + ], + "loc": { + "start": { + "line": 425, + "column": 57 + }, + "end": { + "line": 425, + "column": 72 + } + } + }, + "range": [ + 16019, + 16050 + ], + "loc": { + "start": { + "line": 425, + "column": 42 + }, + "end": { + "line": 425, + "column": 73 + } + } + }, + "property": { + "type": "Identifier", + "name": "filter", + "range": [ + 16051, + 16057 + ], + "loc": { + "start": { + "line": 425, + "column": 74 + }, + "end": { + "line": 425, + "column": 80 + } + } + }, + "range": [ + 16019, + 16057 + ], + "loc": { + "start": { + "line": 425, + "column": 42 + }, + "end": { + "line": 425, + "column": 80 + } + } + }, + "arguments": [ + { + "type": "ArrowFunctionExpression", + "id": null, + "params": [ + { + "type": "Identifier", + "name": "r", + "range": [ + 16058, + 16059 + ], + "loc": { + "start": { + "line": 425, + "column": 81 + }, + "end": { + "line": 425, + "column": 82 + } + } + } + ], + "body": { + "type": "BlockStatement", + "body": [ + { + "type": "ReturnStatement", + "argument": { + "type": "BinaryExpression", + "operator": "!==", + "left": { + "type": "Identifier", + "name": "r", + "range": [ + 16082, + 16083 + ], + "loc": { + "start": { + "line": 426, + "column": 17 + }, + "end": { + "line": 426, + "column": 18 + } + } + }, + "right": { + "type": "Identifier", + "name": "sourceResource", + "range": [ + 16088, + 16102 + ], + "loc": { + "start": { + "line": 426, + "column": 23 + }, + "end": { + "line": 426, + "column": 37 + } + } + }, + "range": [ + 16082, + 16102 + ], + "loc": { + "start": { + "line": 426, + "column": 17 + }, + "end": { + "line": 426, + "column": 37 + } + } + }, + "range": [ + 16075, + 16103 + ], + "loc": { + "start": { + "line": 426, + "column": 10 + }, + "end": { + "line": 426, + "column": 38 + } + } + } + ], + "range": [ + 16063, + 16113 + ], + "loc": { + "start": { + "line": 425, + "column": 86 + }, + "end": { + "line": 427, + "column": 9 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 16058, + 16113 + ], + "loc": { + "start": { + "line": 425, + "column": 81 + }, + "end": { + "line": 427, + "column": 9 + } + } + } + ], + "range": [ + 16019, + 16114 + ], + "loc": { + "start": { + "line": 425, + "column": 42 + }, + "end": { + "line": 427, + "column": 10 + } + } + }, + "range": [ + 15985, + 16114 + ], + "loc": { + "start": { + "line": 425, + "column": 8 + }, + "end": { + "line": 427, + "column": 10 + } + } + }, + "range": [ + 15985, + 16115 + ], + "loc": { + "start": { + "line": 425, + "column": 8 + }, + "end": { + "line": 427, + "column": 11 + } + } + } + ], + "range": [ + 15768, + 16123 + ], + "loc": { + "start": { + "line": 421, + "column": 50 + }, + "end": { + "line": 428, + "column": 7 + } + } + }, + "alternate": { + "type": "IfStatement", + "test": { + "type": "BinaryExpression", + "operator": "===", + "left": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "targetField", + "range": [ + 16133, + 16144 + ], + "loc": { + "start": { + "line": 428, + "column": 17 + }, + "end": { + "line": 428, + "column": 28 + } + } + }, + "property": { + "type": "Identifier", + "name": "type", + "range": [ + 16145, + 16149 + ], + "loc": { + "start": { + "line": 428, + "column": 29 + }, + "end": { + "line": 428, + "column": 33 + } + } + }, + "range": [ + 16133, + 16149 + ], + "loc": { + "start": { + "line": 428, + "column": 17 + }, + "end": { + "line": 428, + "column": 33 + } + } + }, + "right": { + "type": "Literal", + "value": "attr", + "raw": "\"attr\"", + "range": [ + 16154, + 16160 + ], + "loc": { + "start": { + "line": 428, + "column": 38 + }, + "end": { + "line": 428, + "column": 44 + } + } + }, + "range": [ + 16133, + 16160 + ], + "loc": { + "start": { + "line": 428, + "column": 17 + }, + "end": { + "line": 428, + "column": 44 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "Error", + "range": [ + 16182, + 16187 + ], + "loc": { + "start": { + "line": 429, + "column": 18 + }, + "end": { + "line": 429, + "column": 23 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "The the inverse relationship for '", + "cooked": "The the inverse relationship for '" + }, + "tail": false, + "range": [ + 16188, + 16225 + ], + "loc": { + "start": { + "line": 429, + "column": 24 + }, + "end": { + "line": 429, + "column": 61 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "' is an attribute ('", + "cooked": "' is an attribute ('" + }, + "tail": false, + "range": [ + 16240, + 16263 + ], + "loc": { + "start": { + "line": 429, + "column": 76 + }, + "end": { + "line": 429, + "column": 99 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "')", + "cooked": "')" + }, + "tail": true, + "range": [ + 16278, + 16282 + ], + "loc": { + "start": { + "line": 429, + "column": 114 + }, + "end": { + "line": 429, + "column": 118 + } + } + } + ], + "expressions": [ + { + "type": "Identifier", + "name": "sourceFieldName", + "range": [ + 16225, + 16240 + ], + "loc": { + "start": { + "line": 429, + "column": 61 + }, + "end": { + "line": 429, + "column": 76 + } + } + }, + { + "type": "Identifier", + "name": "targetFieldName", + "range": [ + 16263, + 16278 + ], + "loc": { + "start": { + "line": 429, + "column": 99 + }, + "end": { + "line": 429, + "column": 114 + } + } + } + ], + "range": [ + 16188, + 16282 + ], + "loc": { + "start": { + "line": 429, + "column": 24 + }, + "end": { + "line": 429, + "column": 118 + } + } + } + ], + "range": [ + 16178, + 16283 + ], + "loc": { + "start": { + "line": 429, + "column": 14 + }, + "end": { + "line": 429, + "column": 119 + } + } + }, + "range": [ + 16172, + 16284 + ], + "loc": { + "start": { + "line": 429, + "column": 8 + }, + "end": { + "line": 429, + "column": 120 + } + } + } + ], + "range": [ + 16162, + 16292 + ], + "loc": { + "start": { + "line": 428, + "column": 46 + }, + "end": { + "line": 430, + "column": 7 + } + } + }, + "alternate": null, + "range": [ + 16129, + 16292 + ], + "loc": { + "start": { + "line": 428, + "column": 13 + }, + "end": { + "line": 430, + "column": 7 + } + } + }, + "range": [ + 15731, + 16292 + ], + "loc": { + "start": { + "line": 421, + "column": 13 + }, + "end": { + "line": 430, + "column": 7 + } + } + }, + "range": [ + 15425, + 16292 + ], + "loc": { + "start": { + "line": 416, + "column": 6 + }, + "end": { + "line": 430, + "column": 7 + } + } + } + ], + "range": [ + 15417, + 16298 + ], + "loc": { + "start": { + "line": 415, + "column": 21 + }, + "end": { + "line": 431, + "column": 5 + } + } + }, + "alternate": { + "type": "IfStatement", + "test": { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceField", + "range": [ + 16308, + 16319 + ], + "loc": { + "start": { + "line": 431, + "column": 15 + }, + "end": { + "line": 431, + "column": 26 + } + } + }, + "property": { + "type": "Identifier", + "name": "inverse", + "range": [ + 16320, + 16327 + ], + "loc": { + "start": { + "line": 431, + "column": 27 + }, + "end": { + "line": 431, + "column": 34 + } + } + }, + "range": [ + 16308, + 16327 + ], + "loc": { + "start": { + "line": 431, + "column": 15 + }, + "end": { + "line": 431, + "column": 34 + } + } + }, + "consequent": { + "type": "BlockStatement", + "body": [ + { + "type": "ThrowStatement", + "argument": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "Error", + "range": [ + 16347, + 16352 + ], + "loc": { + "start": { + "line": 432, + "column": 16 + }, + "end": { + "line": 432, + "column": 21 + } + } + }, + "arguments": [ + { + "type": "TemplateLiteral", + "quasis": [ + { + "type": "TemplateElement", + "value": { + "raw": "The the inverse relationship for '", + "cooked": "The the inverse relationship for '" + }, + "tail": false, + "range": [ + 16353, + 16390 + ], + "loc": { + "start": { + "line": 432, + "column": 22 + }, + "end": { + "line": 432, + "column": 59 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "' is missing ('", + "cooked": "' is missing ('" + }, + "tail": false, + "range": [ + 16405, + 16423 + ], + "loc": { + "start": { + "line": 432, + "column": 74 + }, + "end": { + "line": 432, + "column": 92 + } + } + }, + { + "type": "TemplateElement", + "value": { + "raw": "')", + "cooked": "')" + }, + "tail": true, + "range": [ + 16442, + 16446 + ], + "loc": { + "start": { + "line": 432, + "column": 111 + }, + "end": { + "line": 432, + "column": 115 + } + } + } + ], + "expressions": [ + { + "type": "Identifier", + "name": "sourceFieldName", + "range": [ + 16390, + 16405 + ], + "loc": { + "start": { + "line": 432, + "column": 59 + }, + "end": { + "line": 432, + "column": 74 + } + } + }, + { + "type": "MemberExpression", + "computed": false, + "object": { + "type": "Identifier", + "name": "sourceField", + "range": [ + 16423, + 16434 + ], + "loc": { + "start": { + "line": 432, + "column": 92 + }, + "end": { + "line": 432, + "column": 103 + } + } + }, + "property": { + "type": "Identifier", + "name": "inverse", + "range": [ + 16435, + 16442 + ], + "loc": { + "start": { + "line": 432, + "column": 104 + }, + "end": { + "line": 432, + "column": 111 + } + } + }, + "range": [ + 16423, + 16442 + ], + "loc": { + "start": { + "line": 432, + "column": 92 + }, + "end": { + "line": 432, + "column": 111 + } + } + } + ], + "range": [ + 16353, + 16446 + ], + "loc": { + "start": { + "line": 432, + "column": 22 + }, + "end": { + "line": 432, + "column": 115 + } + } + } + ], + "range": [ + 16343, + 16447 + ], + "loc": { + "start": { + "line": 432, + "column": 12 + }, + "end": { + "line": 432, + "column": 116 + } + } + }, + "range": [ + 16337, + 16448 + ], + "loc": { + "start": { + "line": 432, + "column": 6 + }, + "end": { + "line": 432, + "column": 117 + } + } + } + ], + "range": [ + 16329, + 16454 + ], + "loc": { + "start": { + "line": 431, + "column": 36 + }, + "end": { + "line": 433, + "column": 5 + } + } + }, + "alternate": null, + "range": [ + 16304, + 16454 + ], + "loc": { + "start": { + "line": 431, + "column": 11 + }, + "end": { + "line": 433, + "column": 5 + } + } + }, + "range": [ + 15400, + 16454 + ], + "loc": { + "start": { + "line": 415, + "column": 4 + }, + "end": { + "line": 433, + "column": 5 + } + } + } + ], + "range": [ + 14991, + 16458 + ], + "loc": { + "start": { + "line": 408, + "column": 91 + }, + "end": { + "line": 434, + "column": 3 + } + } + }, + "generator": false, + "expression": false, + "range": [ + 14928, + 16458 + ], + "loc": { + "start": { + "line": 408, + "column": 28 + }, + "end": { + "line": 434, + "column": 3 + } + } + }, + "kind": "method", + "computed": false, + "range": [ + 14902, + 16458 + ], + "loc": { + "start": { + "line": 408, + "column": 2 + }, + "end": { + "line": 434, + "column": 3 + } + }, + "static": false + } + ], + "range": [ + 59, + 16461 + ], + "loc": { + "start": { + "line": 3, + "column": 27 + }, + "end": { + "line": 436, + "column": 1 + } + } + }, + "range": [ + 47, + 16461 + ], + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 436, + "column": 1 + } + }, + "leadingComments": [], + "trailingComments": [] + }, + "range": [ + 32, + 16461 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 436, + "column": 1 + } + } + } + ], + "sourceType": "module", + "range": [ + 0, + 16461 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 436, + "column": 1 + } + }, + "comments": [ + { + "type": "Block", + "value": "*\n * Creates a field definition for an attribute.\n *\n * @since 0.1.0\n * @param {string} [name] - Name of the property to map this field from.\n * @param {Object} [options] - An options object.\n * @param {string} [options.default] - Default value for this field.\n * @return {Object} - Field definition.\n ", + "range": [ + 64, + 386 + ], + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 13, + "column": 5 + } + } + }, + { + "type": "Block", + "value": "*\n * Creates a field definition for an has-one relationship.\n *\n * @since 0.1.0\n * @param {string} [name] - Name of the property to map this field from.\n * @param {Object} [options] - An options object.\n * @param {string} [options.inverse] - Name of the inverse relationship.\n * @return {Object} - Field definition.\n ", + "range": [ + 736, + 1073 + ], + "loc": { + "start": { + "line": 28, + "column": 2 + }, + "end": { + "line": 36, + "column": 5 + } + } + }, + { + "type": "Block", + "value": "*\n * Creates a field definition for an has-many relationship.\n *\n * @since 0.1.0\n * @param {string} [name] - Name of the property to map this field from.\n * @param {Object} [options] - An options object.\n * @param {string} [options.inverse] - Name of the inverse relationship.\n * @return {Object} - Field definition.\n ", + "range": [ + 1727, + 2065 + ], + "loc": { + "start": { + "line": 58, + "column": 2 + }, + "end": { + "line": 66, + "column": 5 + } + } + }, + { + "type": "Block", + "value": "*\n * Add an individual resource to the store. This is used internally by the\n * `push()` method.\n *\n * @since 0.1.0\n * @param {!Object} object - Resource Object to add. See:\n http://jsonapi.org/format/#document-resource-objects\n * @return {undefined} - Nothing.\n ", + "range": [ + 2991, + 3283 + ], + "loc": { + "start": { + "line": 98, + "column": 2 + }, + "end": { + "line": 106, + "column": 5 + } + } + }, + { + "type": "Block", + "value": "*\n * Defines a type of resource.\n *\n * @since 0.2.0\n * @param {!string|string[]} names - Name(s) of the resource.\n * @param {!Object} definition - The resource's definition.\n * @return {undefined} - Nothing.\n ", + "range": [ + 4331, + 4558 + ], + "loc": { + "start": { + "line": 132, + "column": 2 + }, + "end": { + "line": 139, + "column": 5 + } + } + }, + { + "type": "Block", + "value": "*\n * Find a resource or entire collection of resources.\n *\n * NOTE: If the resource hasn't been loaded via an add() or push() call it\n * will be automatically created when find is called.\n *\n * @since 0.1.0\n * @param {!string} type - Type of the resource(s) to find.\n * @param {string} [id] - The id of the resource to find. If omitted all\n * resources of the type will be returned.\n * @return {Object|Object[]} - Either the resource or an array of resources.\n ", + "range": [ + 4894, + 5404 + ], + "loc": { + "start": { + "line": 152, + "column": 2 + }, + "end": { + "line": 163, + "column": 5 + } + } + }, + { + "type": "Block", + "value": "*\n * Unregister an event listener that was registered with on().\n *\n * @since 0.4.0\n * @param {string} event - Name of the event.\n * @param {string} type - Name of resource to originally passed to on().\n * @param {string} [id] - ID of the resource to originally passed to on().\n * @param {function} callback - Function originally passed to on().\n * @return {undefined} - Nothing.\n ", + "range": [ + 6341, + 6744 + ], + "loc": { + "start": { + "line": 197, + "column": 2 + }, + "end": { + "line": 206, + "column": 5 + } + } + }, + { + "type": "Line", + "value": " TODO: Performance-wise, this can be made way better. There shouldn't be a need to maintain separate lists.", + "range": [ + 7048, + 7157 + ], + "loc": { + "start": { + "line": 213, + "column": 10 + }, + "end": { + "line": 213, + "column": 119 + } + } + }, + { + "type": "Block", + "value": "*\n * Register an event listener: \"added\", \"updated\" or \"removed\".\n *\n * @since 0.4.0\n * @param {string} event - Name of the event.\n * @param {string} type - Name of resource to watch.\n * @param {string} [id] - ID of the resource to watch.\n * @param {function} callback - Function to call when the event occurs.\n * @param {Object} [context] - Context in which to call the callback.\n * @return {undefined} - Nothing.\n ", + "range": [ + 7951, + 8391 + ], + "loc": { + "start": { + "line": 236, + "column": 2 + }, + "end": { + "line": 246, + "column": 5 + } + } + }, + { + "type": "Line", + "value": " TODO: Performance-wise, this can be made way better. There shouldn't be a need to maintain separate lists.", + "range": [ + 8702, + 8811 + ], + "loc": { + "start": { + "line": 253, + "column": 10 + }, + "end": { + "line": 253, + "column": 119 + } + } + }, + { + "type": "Block", + "value": "*\n * Add a JSON API response to the store. This method can be used to handle a\n * successful GET or POST response from the server.\n *\n * @since 0.1.0\n * @param {Object} root - Top Level Object to push. See:\n http://jsonapi.org/format/#document-top-level\n * @return {undefined} - Nothing.\n ", + "range": [ + 9784, + 10118 + ], + "loc": { + "start": { + "line": 277, + "column": 2 + }, + "end": { + "line": 285, + "column": 5 + } + } + }, + { + "type": "Block", + "value": "*\n * Remove a resource or collection of resources from the store.\n *\n * @since 0.1.0\n * @param {!string} type - Type of the resource(s) to remove.\n * @param {string} [id] - The id of the resource to remove. If omitted all\n * resources of the type will be removed.\n * @return {undefined} - Nothing.\n ", + "range": [ + 10351, + 10693 + ], + "loc": { + "start": { + "line": 297, + "column": 2 + }, + "end": { + "line": 305, + "column": 5 + } + } + }, + { + "type": "Line", + "value": " TODO: This only needs to be run once for each dependent.", + "range": [ + 14616, + 14675 + ], + "loc": { + "start": { + "line": 400, + "column": 6 + }, + "end": { + "line": 400, + "column": 65 + } + } + } + ] +} \ No newline at end of file diff --git a/docs/v0.4.1/badge.svg b/docs/v0.4.1/badge.svg new file mode 100644 index 0000000..1f8ff9a --- /dev/null +++ b/docs/v0.4.1/badge.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + document + document + 83% + 83% + + diff --git a/docs/v0.4.1/class/src/store.js~Store.html b/docs/v0.4.1/class/src/store.js~Store.html new file mode 100644 index 0000000..58b3711 --- /dev/null +++ b/docs/v0.4.1/class/src/store.js~Store.html @@ -0,0 +1,1263 @@ + + + + + + Store | API Document + + + + + + + + +
+ Home + Identifier + Source + + + +
+ + + +
+
import Store from 'json-api-store/src/store.js'
+ public + class + + + + | source +
+ +
+

Store

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

Static Method Summary

+ + + + + + + + + + + + + + + + + + + +
Static Public Methods
+ public + static + + + + +
+

+ attr(name: string, options: Object): Object +

+
+
+ + +

Creates a field definition for an attribute.

+
+
+ + since 0.1.0 +
+ public + static + + + + +
+

+ hasMany(name: string, options: Object): Object +

+
+
+ + +

Creates a field definition for an has-many relationship.

+
+
+ + since 0.1.0 +
+ public + static + + + + +
+

+ hasOne(name: string, options: Object): Object +

+
+
+ + +

Creates a field definition for an has-one relationship.

+
+
+ + since 0.1.0 +
+
+

Constructor Summary

+ + + + + + + + + +
Public Constructor
+ public + + + + + +
+

+ constructor +

+
+
+ + + +
+
+ + +
+
+ +

Method Summary

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Public Methods
+ public + + + + + +
+

+ add(object: Object): undefined +

+
+
+ + +

Add an individual resource to the store.

+
+
+ + since 0.1.0 +
+ public + + + + + +
+

+ define(names: string | string[], definition: Object): undefined +

+
+
+ + +

Defines a type of resource.

+
+
+ + since 0.2.0 +
+ public + + + + + +
+

+ find(type: string, id: string): Object | Object[] +

+
+
+ + +

Find a resource or entire collection of resources.

+
+
+ + since 0.1.0 +
+ public + + + + + +
+

+ off(event: string, type: string, id: string, callback: function): undefined +

+
+
+ + +

Unregister an event listener that was registered with on().

+
+
+ + since 0.4.0 +
+ public + + + + + +
+

+ on(event: string, type: string, id: string, callback: function, context: Object): undefined +

+
+
+ + +

Register an event listener: "added", "updated" or "removed".

+
+
+ + since 0.4.0 +
+ public + + + + + +
+

+ push(root: Object): undefined +

+
+
+ + +

Add a JSON API response to the store.

+
+
+ + since 0.1.0 +
+ public + + + + + +
+

+ remove(type: string, id: string): undefined +

+
+
+ + +

Remove a resource or collection of resources from the store.

+
+
+ + since 0.1.0 +
+
+ + + + +

Static Public Methods

+ +
+

+ public + static + + + + attr(name: string, options: Object): Object + + + since 0.1.0 + source + +

+ + + + +

Creates a field definition for an attribute.

+
+ + + +
+

Params:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributeDescription
namestring
  • optional

Name of the property to map this field from.

+
optionsObject
  • optional

An options object.

+
options.defaultstring
  • optional

Default value for this field.

+
+
+
+ +
+

Return:

+ + + + + +
Object

Field definition.

+
+
+
+
+ + + + + + + + + + + + + +
+
+

+ public + static + + + + hasMany(name: string, options: Object): Object + + + since 0.1.0 + source + +

+ + + + +

Creates a field definition for an has-many relationship.

+
+ + + +
+

Params:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributeDescription
namestring
  • optional

Name of the property to map this field from.

+
optionsObject
  • optional

An options object.

+
options.inversestring
  • optional

Name of the inverse relationship.

+
+
+
+ +
+

Return:

+ + + + + +
Object

Field definition.

+
+
+
+
+ + + + + + + + + + + + + +
+
+

+ public + static + + + + hasOne(name: string, options: Object): Object + + + since 0.1.0 + source + +

+ + + + +

Creates a field definition for an has-one relationship.

+
+ + + +
+

Params:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributeDescription
namestring
  • optional

Name of the property to map this field from.

+
optionsObject
  • optional

An options object.

+
options.inversestring
  • optional

Name of the inverse relationship.

+
+
+
+ +
+

Return:

+ + + + + +
Object

Field definition.

+
+
+
+
+ + + + + + + + + + + + + +
+
+

Public Constructors

+ +
+

+ public + + + + + constructor + + + + source + +

+ + + + + + + + +
+
+ + + + + + + + + + + + + + + +
+
+ +

Public Methods

+ +
+

+ public + + + + + add(object: Object): undefined + + + since 0.1.0 + source + +

+ + + + +

Add an individual resource to the store. This is used internally by the +push() method.

+
+ + + +
+

Params:

+ + + + + + + + + + + + + +
NameTypeAttributeDescription
objectObject
  • nullable: false

Resource Object to add. See: + http://jsonapi.org/format/#document-resource-objects

+
+
+
+ +
+

Return:

+ + + + + +
undefined

Nothing.

+
+
+
+
+ + + + + + + + + + + + + +
+
+

+ public + + + + + define(names: string | string[], definition: Object): undefined + + + since 0.2.0 + source + +

+ + + + +

Defines a type of resource.

+
+ + + +
+

Params:

+ + + + + + + + + + + + + + + + + + + +
NameTypeAttributeDescription
namesstring | string[]
  • nullable: false

Name(s) of the resource.

+
definitionObject
  • nullable: false

The resource's definition.

+
+
+
+ +
+

Return:

+ + + + + +
undefined

Nothing.

+
+
+
+
+ + + + + + + + + + + + + +
+
+

+ public + + + + + find(type: string, id: string): Object | Object[] + + + since 0.1.0 + source + +

+ + + + +

Find a resource or entire collection of resources.

+

NOTE: If the resource hasn't been loaded via an add() or push() call it +will be automatically created when find is called.

+
+ + + +
+

Params:

+ + + + + + + + + + + + + + + + + + + +
NameTypeAttributeDescription
typestring
  • nullable: false

Type of the resource(s) to find.

+
idstring
  • optional

The id of the resource to find. If omitted all + resources of the type will be returned.

+
+
+
+ +
+

Return:

+ + + + + +
Object | Object[]

Either the resource or an array of resources.

+
+
+
+
+ + + + + + + + + + + + + +
+
+

+ public + + + + + off(event: string, type: string, id: string, callback: function): undefined + + + since 0.4.0 + source + +

+ + + + +

Unregister an event listener that was registered with on().

+
+ + + +
+

Params:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributeDescription
eventstring

Name of the event.

+
typestring

Name of resource to originally passed to on().

+
idstring
  • optional

ID of the resource to originally passed to on().

+
callbackfunction

Function originally passed to on().

+
+
+
+ +
+

Return:

+ + + + + +
undefined

Nothing.

+
+
+
+
+ + + + + + + + + + + + + +
+
+

+ public + + + + + on(event: string, type: string, id: string, callback: function, context: Object): undefined + + + since 0.4.0 + source + +

+ + + + +

Register an event listener: "added", "updated" or "removed".

+
+ + + +
+

Params:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributeDescription
eventstring

Name of the event.

+
typestring

Name of resource to watch.

+
idstring
  • optional

ID of the resource to watch.

+
callbackfunction

Function to call when the event occurs.

+
contextObject
  • optional

Context in which to call the callback.

+
+
+
+ +
+

Return:

+ + + + + +
undefined

Nothing.

+
+
+
+
+ + + + + + + + + + + + + +
+
+

+ public + + + + + push(root: Object): undefined + + + since 0.1.0 + source + +

+ + + + +

Add a JSON API response to the store. This method can be used to handle a +successful GET or POST response from the server.

+
+ + + +
+

Params:

+ + + + + + + + + + + + + +
NameTypeAttributeDescription
rootObject

Top Level Object to push. See: + http://jsonapi.org/format/#document-top-level

+
+
+
+ +
+

Return:

+ + + + + +
undefined

Nothing.

+
+
+
+
+ + + + + + + + + + + + + +
+
+

+ public + + + + + remove(type: string, id: string): undefined + + + since 0.1.0 + source + +

+ + + + +

Remove a resource or collection of resources from the store.

+
+ + + +
+

Params:

+ + + + + + + + + + + + + + + + + + + +
NameTypeAttributeDescription
typestring
  • nullable: false

Type of the resource(s) to remove.

+
idstring
  • optional

The id of the resource to remove. If omitted all + resources of the type will be removed.

+
+
+
+ +
+

Return:

+ + + + + +
undefined

Nothing.

+
+
+
+
+ + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + diff --git a/docs/v0.4.1/coverage.json b/docs/v0.4.1/coverage.json new file mode 100644 index 0000000..c91bc49 --- /dev/null +++ b/docs/v0.4.1/coverage.json @@ -0,0 +1,11 @@ +{ + "coverage": "83.33%", + "expectCount": 12, + "actualCount": 10, + "files": { + "src/store.js": { + "expectCount": 12, + "actualCount": 10 + } + } +} \ No newline at end of file diff --git a/docs/v0.4.1/css/prettify-tomorrow.css b/docs/v0.4.1/css/prettify-tomorrow.css new file mode 100644 index 0000000..b6f92a7 --- /dev/null +++ b/docs/v0.4.1/css/prettify-tomorrow.css @@ -0,0 +1,132 @@ +/* Tomorrow Theme */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* Pretty printing styles. Used with prettify.js. */ +/* SPAN elements with the classes below are added by prettyprint. */ +/* plain text */ +.pln { + color: #4d4d4c; } + +@media screen { + /* string content */ + .str { + color: #718c00; } + + /* a keyword */ + .kwd { + color: #8959a8; } + + /* a comment */ + .com { + color: #8e908c; } + + /* a type name */ + .typ { + color: #4271ae; } + + /* a literal value */ + .lit { + color: #f5871f; } + + /* punctuation */ + .pun { + color: #4d4d4c; } + + /* lisp open bracket */ + .opn { + color: #4d4d4c; } + + /* lisp close bracket */ + .clo { + color: #4d4d4c; } + + /* a markup tag name */ + .tag { + color: #c82829; } + + /* a markup attribute name */ + .atn { + color: #f5871f; } + + /* a markup attribute value */ + .atv { + color: #3e999f; } + + /* a declaration */ + .dec { + color: #f5871f; } + + /* a variable name */ + .var { + color: #c82829; } + + /* a function name */ + .fun { + color: #4271ae; } } +/* Use higher contrast and text-weight for printable form. */ +@media print, projection { + .str { + color: #060; } + + .kwd { + color: #006; + font-weight: bold; } + + .com { + color: #600; + font-style: italic; } + + .typ { + color: #404; + font-weight: bold; } + + .lit { + color: #044; } + + .pun, .opn, .clo { + color: #440; } + + .tag { + color: #006; + font-weight: bold; } + + .atn { + color: #404; } + + .atv { + color: #060; } } +/* Style */ +/* +pre.prettyprint { + background: white; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 12px; + line-height: 1.5; + border: 1px solid #ccc; + padding: 10px; } +*/ + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; } + +/* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L4, +li.L5, +li.L6, +li.L7, +li.L8, +li.L9 { + /* */ } + +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { + /* */ } diff --git a/docs/v0.4.1/css/style.css b/docs/v0.4.1/css/style.css new file mode 100644 index 0000000..939ea95 --- /dev/null +++ b/docs/v0.4.1/css/style.css @@ -0,0 +1,717 @@ +@import url(https://fonts.googleapis.com/css?family=Roboto:400,300,700); + +* { + margin: 0; + padding: 0; + text-decoration: none; +} + +html +{ + font-family: 'Roboto', sans-serif; + overflow: auto; + font-size: 14px; + color: #4d4e53; + background-color: #F9F9F9; +} + +a { + /*color: #0095dd;*/ + color:rgb(37, 138, 175); +} + +code a:hover { + text-decoration: underline; +} + +ul, ol { + padding-left: 20px; +} + +ul li { + list-style: disc; + margin: 4px 0; +} + +ol li { + margin: 4px 0; +} + +h1 { + margin-bottom: 10px; + font-size: 34px; + font-weight: 300; + border-bottom: solid 1px #ddd; +} + +h2 { + margin-top: 24px; + margin-bottom: 10px; + font-size: 20px; + border-bottom: solid 1px #ddd; + font-weight: 300; +} + +h3 { + position: relative; + font-size: 16px; + margin-bottom: 12px; + background-color: #E2E2E2; + padding: 4px; + font-weight: 300; +} + +p { + margin-bottom: 15px; + line-height: 19px; +} + +pre.prettyprint { + padding: 4px; + border: solid 1px #ddd; + margin: 4px 0; +} + +p > code, +li > code { + padding: 0 4px; + background: #ddd; +} + +.import-path pre.prettyprint { + border: none; + padding: 0; +} + +.layout-container { + /*display: flex;*/ + /*flex-direction: row;*/ + /*justify-content: flex-start;*/ + /*align-items: stretch;*/ +} + +.layout-container > header { + height: 40px; + line-height: 40px; + font-size: 16px; + padding: 0 10px; + margin: 0; + position: fixed; + width: 100%; + z-index: 1; + background-color: #F9F9F9; + top: 0; + border-bottom: solid 1px #E02130; +} +.layout-container > header > a{ + margin: 0 5px; +} + +.layout-container > header > a.repo-url-github { + font-size: 0; + display: inline-block; + width: 20px; + height: 38px; + background: url("../image/github.png") no-repeat center; + background-size: 20px; + vertical-align: top; +} + +.navigation { + position: fixed; + top: 0; + left: 0; + box-sizing: border-box; + width: 200px; + height: 100%; + padding-top: 40px; + padding-left: 15px; + padding-bottom: 20px; + overflow-x: scroll; + box-shadow: rgba(255, 255, 255, 1) -1px 0 0 inset; + border-right: 1px solid rgba(0, 0, 0, 0.1); +} + +.navigation h1 { + border: none; + font-size: 18px; +} + +.navigation h2 { + margin: 15px 0 4px; + font-size: 16px; + border: none; +} + +.navigation h2 a { + color: inherit; +} + +.navigation ul { + padding: 0; +} + +.navigation li { + list-style: none; + margin: 4px 0; +} + +h1 .version, +h1 .url a { + font-size: 14px; + color: #aaa; +} + +.content { + margin-top: 40px; + margin-left: 200px; + padding: 10px 50px 10px 20px; +} + +.header-notice { + font-size: 14px; + color: #aaa; + margin: 0; +} + +.expression-extends .prettyprint { + margin-left: 10px; + background: white; +} + +.extends-chain { + border-bottom: 1px solid#ddd; + padding-bottom: 10px; + margin-bottom: 10px; +} + +.extends-chain span:nth-of-type(1) { + padding-left: 10px; +} + +.extends-chain > div { + margin: 5px 0; +} + +.description table { + font-size: 14px; + border-spacing: 0; + border: 0; + border-collapse: collapse; +} + +.description thead { + background: #999; + color: white; +} + +.description table td, +.description table th { + border: solid 1px #ddd; + padding: 4px; + font-weight: normal; +} + +.flat-list ul { + padding-left: 0; +} + +.flat-list li { + display: inline; + list-style: none; +} + +table.summary { + width: 100%; + margin: 10px 0; + border-spacing: 0; + border: 0; + border-collapse: collapse; +} + +table.summary thead { + background: #999; + color: white; +} + +table.summary td { + border: solid 1px #ddd; + padding: 4px 10px; +} + +table.summary tbody td:nth-child(1) { + text-align: right; + white-space: nowrap; + min-width: 64px; + vertical-align: top; +} + +table.summary tbody td:nth-child(2) { + width: 100%; + border-right: none; +} + +table.summary tbody td:nth-child(3) { + white-space: nowrap; + border-left: none; + vertical-align: top; +} + +table.summary td > div:nth-of-type(2) { + padding-top: 4px; + padding-left: 15px; +} + +table.summary td p { + margin-bottom: 0; +} + +.inherited-summary thead td { + padding-left: 2px; +} + +.inherited-summary thead a { + color: white; +} + +.inherited-summary .summary tbody { + display: none; +} + +.inherited-summary .summary .toggle { + padding: 0 4px; + font-size: 12px; + cursor: pointer; +} +.inherited-summary .summary .toggle.closed:before { + content: "â–¶"; +} +.inherited-summary .summary .toggle.opened:before { + content: "â–¼"; +} + +.member, .method { + margin-bottom: 24px; +} + +table.params { + width: 100%; + margin: 10px 0; + border-spacing: 0; + border: 0; + border-collapse: collapse; +} + +table.params thead { + background: #eee; + color: #aaa; +} + +table.params td { + padding: 4px; + border: solid 1px #ddd; +} + +table.params td p { + margin: 0; +} + +.content .detail > * { + margin: 15px 0; +} + +.content .detail > h3 { + color: black; +} + +.content .detail > div { + margin-left: 10px; +} + +.content .detail > .import-path { + margin-top: -8px; +} + +.content .detail + .detail { + margin-top: 30px; +} + +.content .detail .throw td:first-child { + padding-right: 10px; +} + +.content .detail h4 + :not(pre) { + padding-left: 0; + margin-left: 10px; +} + +.content .detail h4 + ul li { + list-style: none; +} + +.return-param * { + display: inline; +} + +.argument-params { + margin-bottom: 20px; +} + +.return-type { + padding-right: 10px; + font-weight: normal; +} + +.return-desc { + margin-left: 10px; + margin-top: 4px; +} + +.return-desc p { + margin: 0; +} + +.deprecated, .experimental, .instance-docs { + border-left: solid 5px orange; + padding-left: 4px; + margin: 4px 0; +} + +tr.listen p, +tr.throw p, +tr.emit p{ + margin-bottom: 10px; +} + +.version, .since { + color: #aaa; +} + +h3 .right-info { + position: absolute; + right: 4px; + font-size: 14px; +} + +.version + .since:before { + content: '| '; +} + +.see { + margin-top: 10px; +} + +.see h4 { + margin: 4px 0; +} + +.content .detail h4 + .example-doc { + margin: 6px 0; +} + +.example-caption { + position: relative; + bottom: -1px; + display: inline-block; + padding: 4px; + border: solid 1px #ddd; + border-bottom: none; + font-style: italic; + background-color: #eee; + font-weight: bold; +} + +.example-caption + pre.source-code { + margin-top: 0; +} + +footer, .file-footer { + text-align: right; + font-style: italic; + font-weight: 100; + font-size: 13px; + margin-right: 50px; + margin-left: 220px; + border-top: 1px solid #ddd; + padding-top: 30px; + margin-top: 20px; + padding-bottom: 10px; +} + +pre.source-code { + background: white; + border: solid 1px #ddd; + padding: 4px; +} + +pre.source-code.line-number { + padding: 0; +} + +pre.source-code ol { + background: #eee; + padding-left: 40px; +} + +pre.source-code li { + background: white; + padding-left: 4px; + list-style: decimal; + margin: 0; +} + +pre.source-code.line-number li.active { + background: rgb(255, 255, 150); +} + +table.files-summary { + width: 100%; + margin: 10px 0; + border-spacing: 0; + border: 0; + border-collapse: collapse; + text-align: right; +} + +table.files-summary tbody tr:hover { + background: #eee; +} + +table.files-summary td:first-child, +table.files-summary td:nth-of-type(2) { + text-align: left; +} + +table.files-summary[data-use-coverage="false"] td.coverage { + display: none; +} + +table.files-summary thead { + background: #999; + color: white; +} + +table.files-summary td { + border: solid 1px #ddd; + padding: 4px 10px; + vertical-align: top; +} + +table.files-summary td.identifiers > span { + display: block; + margin-top: 4px; +} +table.files-summary td.identifiers > span:first-child { + margin-top: 0; +} + +table.files-summary .coverage-count { + font-size: 12px; + color: #aaa; + display: inline-block; + min-width: 40px; +} + +.total-coverage-count { + position: relative; + bottom: 2px; + font-size: 12px; + color: #666; + font-weight: 500; + padding-left: 5px; +} + +table.test-summary thead { + background: #999; + color: white; +} + +table.test-summary thead .test-description { + width: 50%; +} + +table.test-summary { + width: 100%; + margin: 10px 0; + border-spacing: 0; + border: 0; + border-collapse: collapse; +} + +table.test-summary thead .test-count { + width: 3em; +} + +table.test-summary tbody tr:hover { + background-color: #eee; +} + +table.test-summary td { + border: solid 1px #ddd; + padding: 4px 10px; + vertical-align: top; +} + +table.test-summary td p { + margin: 0; +} + +table.test-summary tr.test-describe .toggle { + display: inline-block; + float: left; + margin-right: 4px; + cursor: pointer; +} + +table.test-summary tr.test-describe .toggle.opened:before { + content: 'â–¼'; +} + +table.test-summary tr.test-describe .toggle.closed:before { + content: 'â–¶'; +} + +table.test-summary .test-target > span { + display: block; + margin-top: 4px; +} +table.test-summary .test-target > span:first-child { + margin-top: 0; +} + +.inner-link-active { + background: rgb(255, 255, 150); +} + +/* search box */ +.search-box { + position: absolute; + top: 10px; + right: 50px; + padding-right: 8px; + padding-bottom: 10px; + line-height: normal; + font-size: 12px; +} + +.search-box img { + width: 20px; + vertical-align: top; +} + +.search-input { + display: inline; + visibility: hidden; + width: 0; + padding: 2px; + height: 1.5em; + outline: none; + background: transparent; + border: 1px #0af; + border-style: none none solid none; + vertical-align: bottom; +} + +.search-input-edge { + display: none; + width: 1px; + height: 5px; + background-color: #0af; + vertical-align: bottom; +} + +.search-result { + position: absolute; + display: none; + height: 600px; + width: 100%; + padding: 0; + margin-top: 5px; + margin-left: 24px; + background: white; + box-shadow: 1px 1px 4px rgb(0,0,0); + white-space: nowrap; + overflow-y: scroll; +} + +.search-result-import-path { + color: #aaa; + font-size: 12px; +} + +.search-result li { + list-style: none; + padding: 2px 4px; +} + +.search-result li a { + display: block; +} + +.search-result li.selected { + background: #ddd; +} + +.search-result li.search-separator { + background: rgb(37, 138, 175); + color: white; +} + +.search-box.active .search-input { + visibility: visible; + transition: width 0.2s ease-out; + width: 300px; +} + +.search-box.active .search-input-edge { + display: inline-block; +} + +/* coverage badge */ +.esdoc-coverage { + display: inline-block; + height: 20px; + vertical-align: top; +} + +h1 .esdoc-coverage { + position: relative; + top: -4px; +} + +.esdoc-coverage-wrap { + color: white; + font-size: 12px; + font-weight: 500; +} + +.esdoc-coverage-label { + padding: 3px 4px 3px 6px; + background: linear-gradient(to bottom, #5e5e5e 0%,#4c4c4c 100%); + border-radius: 4px 0 0 4px; + display: inline-block; + height: 20px; + box-sizing: border-box; + line-height: 14px; +} + +.esdoc-coverage-ratio { + padding: 3px 6px 3px 4px; + border-radius: 0 4px 4px 0; + display: inline-block; + height: 20px; + box-sizing: border-box; + line-height: 14px; +} + +.esdoc-coverage-low { + background: linear-gradient(to bottom, #db654f 0%,#c9533d 100%); +} + +.esdoc-coverage-middle { + background: linear-gradient(to bottom, #dab226 0%,#c9a179 100%); +} + +.esdoc-coverage-high { + background: linear-gradient(to bottom, #4fc921 0%,#3eb810 100%); +} diff --git a/docs/v0.4.1/dump.json b/docs/v0.4.1/dump.json new file mode 100644 index 0000000..032b812 --- /dev/null +++ b/docs/v0.4.1/dump.json @@ -0,0 +1,1390 @@ +[ + { + "kind": "file", + "static": true, + "variation": null, + "name": "src/store.js", + "memberof": null, + "longname": "src/store.js", + "access": null, + "description": null, + "lineNumber": 1, + "content": "import \"array.prototype.find\";\n\nexport default class Store {\n\n /**\n * Creates a field definition for an attribute.\n *\n * @since 0.1.0\n * @param {string} [name] - Name of the property to map this field from.\n * @param {Object} [options] - An options object.\n * @param {string} [options.default] - Default value for this field.\n * @return {Object} - Field definition.\n */\n static attr(name, options) {\n if (name && typeof name === 'object') {\n return Store.attr(null, name);\n } else {\n return {\n type: \"attr\",\n default: options && options.default,\n deserialize: function (data, key) {\n return data.attributes && data.attributes[name || key];\n }\n };\n }\n }\n\n /**\n * Creates a field definition for an has-one relationship.\n *\n * @since 0.1.0\n * @param {string} [name] - Name of the property to map this field from.\n * @param {Object} [options] - An options object.\n * @param {string} [options.inverse] - Name of the inverse relationship.\n * @return {Object} - Field definition.\n */\n static hasOne(name, options) {\n if (name && typeof name === 'object') {\n return Store.hasOne(null, name);\n } else {\n return {\n type: \"has-one\",\n inverse: options && options.inverse,\n deserialize: function (data, key) {\n name = name || key;\n if (data.relationships && data.relationships[name]) {\n if (data.relationships[name].data === null) {\n return null;\n } else if (data.relationships[name].data) {\n return this.find(data.relationships[name].data.type, data.relationships[name].data.id);\n }\n }\n }\n };\n }\n }\n\n /**\n * Creates a field definition for an has-many relationship.\n *\n * @since 0.1.0\n * @param {string} [name] - Name of the property to map this field from.\n * @param {Object} [options] - An options object.\n * @param {string} [options.inverse] - Name of the inverse relationship.\n * @return {Object} - Field definition.\n */\n static hasMany(name, options) {\n if (name && typeof name === 'object') {\n return Store.hasMany(null, name);\n } else {\n return {\n type: \"has-many\",\n default: [],\n inverse: options && options.inverse,\n deserialize: function (data, key) {\n name = name || key;\n if (data.relationships && data.relationships[name]) {\n if (data.relationships[name].data === null) {\n return [];\n } else if (data.relationships[name].data) {\n return data.relationships[name].data.map((c) => {\n return this.find(c.type, c.id);\n });\n }\n }\n }\n };\n }\n }\n\n constructor() {\n this._collectionListeners = { \"added\": {}, \"updated\": {}, \"removed\": {} };\n this._data = {};\n this._resourceListeners = { \"added\": {}, \"updated\": {}, \"removed\": {} };\n this._types = {};\n }\n\n /**\n * Add an individual resource to the store. This is used internally by the\n * `push()` method.\n *\n * @since 0.1.0\n * @param {!Object} object - Resource Object to add. See:\n http://jsonapi.org/format/#document-resource-objects\n * @return {undefined} - Nothing.\n */\n add(object) {\n if (object) {\n if (object.type && object.id) {\n let event = this._data[object.type] && this._data[object.type][object.id] ? \"updated\" : \"added\";\n let resource = this.find(object.type, object.id);\n let definition = this._types[object.type];\n Object.keys(definition).forEach(fieldName => {\n if (fieldName[0] !== \"_\") {\n this._addField(object, resource, definition, fieldName);\n }\n });\n if (this._resourceListeners[event][object.type] && this._resourceListeners[event][object.type][object.id]) {\n this._resourceListeners[event][object.type][object.id].forEach(x => x[0].call(x[1], resource));\n }\n if (this._collectionListeners[event][object.type]) {\n this._collectionListeners[event][object.type].forEach(x => x[0].call(x[1], resource));\n }\n } else {\n throw new TypeError(`The data must have a type and id`);\n }\n } else {\n throw new TypeError(`You must provide data to add`);\n }\n }\n\n /**\n * Defines a type of resource.\n *\n * @since 0.2.0\n * @param {!string|string[]} names - Name(s) of the resource.\n * @param {!Object} definition - The resource's definition.\n * @return {undefined} - Nothing.\n */\n define(names, definition) {\n names = (names.constructor === Array) ? names : [ names ];\n definition._names = names;\n names.forEach(name => {\n if (!this._types[name]) {\n this._types[name] = definition;\n } else {\n throw new Error(`The type '${name}' has already been defined.`);\n }\n });\n }\n\n /**\n * Find a resource or entire collection of resources.\n *\n * NOTE: If the resource hasn't been loaded via an add() or push() call it\n * will be automatically created when find is called.\n *\n * @since 0.1.0\n * @param {!string} type - Type of the resource(s) to find.\n * @param {string} [id] - The id of the resource to find. If omitted all\n * resources of the type will be returned.\n * @return {Object|Object[]} - Either the resource or an array of resources.\n */\n find(type, id) {\n if (type) {\n let definition = this._types[type];\n if (definition) {\n if (!this._data[type]) {\n let collection = {};\n definition._names.forEach(t => this._data[t] = collection);\n }\n if (id) {\n if (!this._data[type][id]) {\n this._data[type][id] = {\n _dependents: [],\n type: type,\n id: id\n };\n Object.keys(definition).forEach(key => {\n if (key[0] !== \"_\") {\n this._data[type][id][key] = definition[key].default;\n }\n });\n }\n return this._data[type][id];\n } else {\n return Object.keys(this._data[type]).map(x => this._data[type][x]);\n }\n } else {\n throw new TypeError(`Unknown type '${type}'`);\n }\n } else {\n throw new TypeError(`You must provide a type`);\n }\n }\n\n /**\n * Unregister an event listener that was registered with on().\n *\n * @since 0.4.0\n * @param {string} event - Name of the event.\n * @param {string} type - Name of resource to originally passed to on().\n * @param {string} [id] - ID of the resource to originally passed to on().\n * @param {function} callback - Function originally passed to on().\n * @return {undefined} - Nothing.\n */\n off(event, type, id, callback) {\n if (this._resourceListeners[event] && this._collectionListeners[event]) {\n if (this._types[type]) {\n if (id && ({}).toString.call(id) === '[object Function]') {\n this.off.call(this, event, type, null, id, callback);\n } else {\n // TODO: Performance-wise, this can be made way better. There shouldn't be a need to maintain separate lists.\n this._types[type]._names.forEach(type => {\n if (id) {\n if (this._resourceListeners[event][type] && this._resourceListeners[event][type][id]) {\n this._resourceListeners[event][type][id] = this._resourceListeners[event][type][id].filter(x => {\n return x[0] !== callback;\n });\n }\n } else if (this._collectionListeners[event][type]) {\n this._collectionListeners[event][type] = this._collectionListeners[event][type].filter(x => {\n return x[0] !== callback;\n });\n }\n });\n }\n } else {\n throw new Error(`Unknown type '${type}'`);\n }\n } else {\n throw new Error(`Unknown event '${event}'`);\n }\n }\n\n /**\n * Register an event listener: \"added\", \"updated\" or \"removed\".\n *\n * @since 0.4.0\n * @param {string} event - Name of the event.\n * @param {string} type - Name of resource to watch.\n * @param {string} [id] - ID of the resource to watch.\n * @param {function} callback - Function to call when the event occurs.\n * @param {Object} [context] - Context in which to call the callback.\n * @return {undefined} - Nothing.\n */\n on(event, type, id, callback, context) {\n if (this._resourceListeners[event] && this._collectionListeners[event]) {\n if (this._types[type]) {\n if (id && ({}).toString.call(id) === '[object Function]') {\n this.on.call(this, event, type, null, id, callback);\n } else {\n // TODO: Performance-wise, this can be made way better. There shouldn't be a need to maintain separate lists.\n this._types[type]._names.forEach(type => {\n if (id) {\n this._resourceListeners[event][type] = this._resourceListeners[event][type] || {};\n this._resourceListeners[event][type][id] = this._resourceListeners[event][type][id] || [];\n if (!this._resourceListeners[event][type][id].find(x => x[0] === callback)) {\n this._resourceListeners[event][type][id].push([ callback, context ]);\n }\n } else {\n this._collectionListeners[event][type] = this._collectionListeners[event][type] || [];\n if (!this._collectionListeners[event][type].find(x => x[0] === callback)) {\n this._collectionListeners[event][type].push([ callback, context ]);\n }\n }\n });\n }\n } else {\n throw new Error(`Unknown type '${type}'`);\n }\n } else {\n throw new Error(`Unknown event '${event}'`);\n }\n }\n\n /**\n * Add a JSON API response to the store. This method can be used to handle a\n * successful GET or POST response from the server.\n *\n * @since 0.1.0\n * @param {Object} root - Top Level Object to push. See:\n http://jsonapi.org/format/#document-top-level\n * @return {undefined} - Nothing.\n */\n push(root) {\n if (root.data.constructor === Array) {\n root.data.forEach(x => this.add(x));\n } else {\n this.add(root.data);\n }\n if (root.included) {\n root.included.forEach(x => this.add(x));\n }\n }\n\n /**\n * Remove a resource or collection of resources from the store.\n *\n * @since 0.1.0\n * @param {!string} type - Type of the resource(s) to remove.\n * @param {string} [id] - The id of the resource to remove. If omitted all\n * resources of the type will be removed.\n * @return {undefined} - Nothing.\n */\n remove(type, id) {\n if (type) {\n if (this._types[type]) {\n if (id) {\n let resource = this._data[type][id];\n if (resource) {\n this._remove(resource);\n if (this._resourceListeners[\"removed\"][type] && this._resourceListeners[\"removed\"][type][id]) {\n this._resourceListeners[\"removed\"][type][id].forEach(x => x[0].call(x[1], resource));\n }\n if (this._collectionListeners[\"removed\"][type]) {\n this._collectionListeners[\"removed\"][type].forEach(x => x[0].call(x[1], resource));\n }\n }\n } else {\n Object.keys(this._data[type]).forEach(id => this.remove(type, id));\n }\n } else {\n throw new TypeError(`Unknown type '${type}'`);\n }\n } else {\n throw new TypeError(`You must provide a type to remove`);\n }\n }\n\n _addField(object, resource, definition, fieldName) {\n var field = definition[fieldName];\n var newValue = field.deserialize.call(this, object, fieldName);\n if (typeof newValue !== \"undefined\") {\n if (field.type === \"has-one\") {\n if (resource[fieldName]) {\n this._removeInverseRelationship(resource, fieldName, resource[fieldName], field);\n }\n if (newValue) {\n this._addInverseRelationship(resource, fieldName, newValue, field);\n }\n } else if (field.type === \"has-many\") {\n resource[fieldName].forEach(r => {\n if (resource[fieldName].indexOf(r) !== -1) {\n this._removeInverseRelationship(resource, fieldName, r, field);\n }\n });\n newValue.forEach(r => {\n this._addInverseRelationship(resource, fieldName, r, field);\n });\n }\n resource[fieldName] = newValue;\n }\n }\n\n _addInverseRelationship(sourceResource, sourceFieldName, targetResource, sourceField) {\n var targetDefinition = this._types[targetResource.type];\n var sourceDefinition = this._types[sourceResource.type];\n if (targetDefinition) {\n let targetFieldName = [ sourceField.inverse ].concat(sourceDefinition._names).find(x => targetDefinition[x]);\n let targetField = targetDefinition && targetDefinition[targetFieldName];\n targetResource._dependents.push({ type: sourceResource.type, id: sourceResource.id, fieldName: sourceFieldName });\n if (targetField) {\n if (targetField.type === \"has-one\") {\n sourceResource._dependents.push({ type: targetResource.type, id: targetResource.id, fieldName: targetFieldName });\n targetResource[targetFieldName] = sourceResource;\n } else if (targetField.type === \"has-many\") {\n sourceResource._dependents.push({ type: targetResource.type, id: targetResource.id, fieldName: targetFieldName });\n if (targetResource[targetFieldName].indexOf(sourceResource) === -1) {\n targetResource[targetFieldName].push(sourceResource);\n }\n } else if (targetField.type === \"attr\") {\n throw new Error(`The the inverse relationship for '${sourceFieldName}' is an attribute ('${targetFieldName}')`);\n }\n } else if (sourceField.inverse) {\n throw new Error(`The the inverse relationship for '${sourceFieldName}' is missing ('${sourceField.inverse}')`);\n }\n }\n }\n\n _remove(resource) {\n resource._dependents.forEach(dependent => {\n let dependentResource = this._data[dependent.type][dependent.id];\n switch (this._types[dependent.type][dependent.fieldName].type) {\n case \"has-one\": {\n dependentResource[dependent.fieldName] = null;\n break;\n }\n case \"has-many\": {\n let index = dependentResource[dependent.fieldName].indexOf(resource);\n if (index !== -1) {\n dependentResource[dependent.fieldName].splice(index, 1);\n }\n break;\n }\n default: {\n break;\n }\n }\n // TODO: This only needs to be run once for each dependent.\n dependentResource._dependents = dependentResource._dependents.filter(d => {\n return !(d.type === resource.type && d.id === resource.id);\n });\n });\n delete this._data[resource.type][resource.id];\n }\n\n _removeInverseRelationship(sourceResource, sourceFieldName, targetResource, sourceField) {\n var targetDefinition = this._types[targetResource.type];\n var targetFieldName = sourceField.inverse || sourceResource.type;\n var targetField = targetDefinition && targetDefinition[targetFieldName];\n targetResource._dependents = targetResource._dependents.filter(r => {\n return !(r.type === sourceResource.type && r.id === sourceResource.id && r.fieldName === sourceFieldName);\n });\n if (targetField) {\n if (targetField.type === \"has-one\") {\n sourceResource._dependents = sourceResource._dependents.filter(r => {\n return !(r.type === targetResource.type && r.id === targetResource.id && r.fieldName === targetFieldName);\n });\n targetResource[targetFieldName] = null;\n } else if (targetField.type === \"has-many\") {\n sourceResource._dependents = sourceResource._dependents.filter(r => {\n return !(r.type === targetResource.type && r.id === targetResource.id && r.fieldName === targetFieldName);\n });\n targetResource[targetFieldName] = targetResource[targetFieldName].filter(r => {\n return r !== sourceResource;\n });\n } else if (targetField.type === \"attr\") {\n throw new Error(`The the inverse relationship for '${sourceFieldName}' is an attribute ('${targetFieldName}')`);\n }\n } else if (sourceField.inverse) {\n throw new Error(`The the inverse relationship for '${sourceFieldName}' is missing ('${sourceField.inverse}')`);\n }\n }\n\n}\n" + }, + { + "kind": "class", + "static": true, + "variation": null, + "name": "Store", + "memberof": "src/store.js", + "longname": "src/store.js~Store", + "access": null, + "export": true, + "importPath": "json-api-store/src/store.js", + "importStyle": "Store", + "description": null, + "lineNumber": 3, + "undocument": true, + "interface": false + }, + { + "kind": "method", + "static": true, + "variation": null, + "name": "attr", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store.attr", + "access": null, + "description": "Creates a field definition for an attribute.", + "lineNumber": 14, + "since": "0.1.0", + "params": [ + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": true, + "name": "name", + "description": "Name of the property to map this field from." + }, + { + "nullable": null, + "types": [ + "Object" + ], + "spread": false, + "optional": true, + "name": "options", + "description": "An options object." + }, + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": true, + "name": "options.default", + "description": "Default value for this field." + } + ], + "return": { + "nullable": null, + "types": [ + "Object" + ], + "spread": false, + "description": "Field definition." + }, + "generator": false + }, + { + "kind": "method", + "static": true, + "variation": null, + "name": "hasOne", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store.hasOne", + "access": null, + "description": "Creates a field definition for an has-one relationship.", + "lineNumber": 37, + "since": "0.1.0", + "params": [ + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": true, + "name": "name", + "description": "Name of the property to map this field from." + }, + { + "nullable": null, + "types": [ + "Object" + ], + "spread": false, + "optional": true, + "name": "options", + "description": "An options object." + }, + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": true, + "name": "options.inverse", + "description": "Name of the inverse relationship." + } + ], + "return": { + "nullable": null, + "types": [ + "Object" + ], + "spread": false, + "description": "Field definition." + }, + "generator": false + }, + { + "kind": "method", + "static": true, + "variation": null, + "name": "hasMany", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store.hasMany", + "access": null, + "description": "Creates a field definition for an has-many relationship.", + "lineNumber": 67, + "since": "0.1.0", + "params": [ + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": true, + "name": "name", + "description": "Name of the property to map this field from." + }, + { + "nullable": null, + "types": [ + "Object" + ], + "spread": false, + "optional": true, + "name": "options", + "description": "An options object." + }, + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": true, + "name": "options.inverse", + "description": "Name of the inverse relationship." + } + ], + "return": { + "nullable": null, + "types": [ + "Object" + ], + "spread": false, + "description": "Field definition." + }, + "generator": false + }, + { + "kind": "constructor", + "static": false, + "variation": null, + "name": "constructor", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#constructor", + "access": null, + "description": null, + "lineNumber": 91, + "undocument": true, + "params": [], + "generator": false + }, + { + "kind": "member", + "static": false, + "variation": null, + "name": "_collectionListeners", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#_collectionListeners", + "access": null, + "description": null, + "lineNumber": 92, + "undocument": true, + "type": { + "types": [ + "*" + ] + } + }, + { + "kind": "member", + "static": false, + "variation": null, + "name": "_data", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#_data", + "access": null, + "description": null, + "lineNumber": 93, + "undocument": true, + "type": { + "types": [ + "*" + ] + } + }, + { + "kind": "member", + "static": false, + "variation": null, + "name": "_resourceListeners", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#_resourceListeners", + "access": null, + "description": null, + "lineNumber": 94, + "undocument": true, + "type": { + "types": [ + "*" + ] + } + }, + { + "kind": "member", + "static": false, + "variation": null, + "name": "_types", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#_types", + "access": null, + "description": null, + "lineNumber": 95, + "undocument": true, + "type": { + "types": [ + "*" + ] + } + }, + { + "kind": "method", + "static": false, + "variation": null, + "name": "add", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#add", + "access": null, + "description": "Add an individual resource to the store. This is used internally by the\n`push()` method.", + "lineNumber": 107, + "since": "0.1.0", + "params": [ + { + "nullable": false, + "types": [ + "Object" + ], + "spread": false, + "optional": false, + "name": "object", + "description": "Resource Object to add. See:\n http://jsonapi.org/format/#document-resource-objects" + } + ], + "return": { + "nullable": null, + "types": [ + "undefined" + ], + "spread": false, + "description": "Nothing." + }, + "generator": false + }, + { + "kind": "method", + "static": false, + "variation": null, + "name": "define", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#define", + "access": null, + "description": "Defines a type of resource.", + "lineNumber": 140, + "since": "0.2.0", + "params": [ + { + "nullable": false, + "types": [ + "string", + "string[]" + ], + "spread": false, + "optional": false, + "name": "names", + "description": "Name(s) of the resource." + }, + { + "nullable": false, + "types": [ + "Object" + ], + "spread": false, + "optional": false, + "name": "definition", + "description": "The resource's definition." + } + ], + "return": { + "nullable": null, + "types": [ + "undefined" + ], + "spread": false, + "description": "Nothing." + }, + "generator": false + }, + { + "kind": "method", + "static": false, + "variation": null, + "name": "find", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#find", + "access": null, + "description": "Find a resource or entire collection of resources.\n\nNOTE: If the resource hasn't been loaded via an add() or push() call it\nwill be automatically created when find is called.", + "lineNumber": 164, + "since": "0.1.0", + "params": [ + { + "nullable": false, + "types": [ + "string" + ], + "spread": false, + "optional": false, + "name": "type", + "description": "Type of the resource(s) to find." + }, + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": true, + "name": "id", + "description": "The id of the resource to find. If omitted all\n resources of the type will be returned." + } + ], + "return": { + "nullable": null, + "types": [ + "Object", + "Object[]" + ], + "spread": false, + "description": "Either the resource or an array of resources." + }, + "generator": false + }, + { + "kind": "method", + "static": false, + "variation": null, + "name": "off", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#off", + "access": null, + "description": "Unregister an event listener that was registered with on().", + "lineNumber": 207, + "since": "0.4.0", + "params": [ + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": false, + "name": "event", + "description": "Name of the event." + }, + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": false, + "name": "type", + "description": "Name of resource to originally passed to on()." + }, + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": true, + "name": "id", + "description": "ID of the resource to originally passed to on()." + }, + { + "nullable": null, + "types": [ + "function" + ], + "spread": false, + "optional": false, + "name": "callback", + "description": "Function originally passed to on()." + } + ], + "return": { + "nullable": null, + "types": [ + "undefined" + ], + "spread": false, + "description": "Nothing." + }, + "generator": false + }, + { + "kind": "method", + "static": false, + "variation": null, + "name": "on", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#on", + "access": null, + "description": "Register an event listener: \"added\", \"updated\" or \"removed\".", + "lineNumber": 247, + "since": "0.4.0", + "params": [ + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": false, + "name": "event", + "description": "Name of the event." + }, + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": false, + "name": "type", + "description": "Name of resource to watch." + }, + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": true, + "name": "id", + "description": "ID of the resource to watch." + }, + { + "nullable": null, + "types": [ + "function" + ], + "spread": false, + "optional": false, + "name": "callback", + "description": "Function to call when the event occurs." + }, + { + "nullable": null, + "types": [ + "Object" + ], + "spread": false, + "optional": true, + "name": "context", + "description": "Context in which to call the callback." + } + ], + "return": { + "nullable": null, + "types": [ + "undefined" + ], + "spread": false, + "description": "Nothing." + }, + "generator": false + }, + { + "kind": "method", + "static": false, + "variation": null, + "name": "push", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#push", + "access": null, + "description": "Add a JSON API response to the store. This method can be used to handle a\nsuccessful GET or POST response from the server.", + "lineNumber": 286, + "since": "0.1.0", + "params": [ + { + "nullable": null, + "types": [ + "Object" + ], + "spread": false, + "optional": false, + "name": "root", + "description": "Top Level Object to push. See:\n http://jsonapi.org/format/#document-top-level" + } + ], + "return": { + "nullable": null, + "types": [ + "undefined" + ], + "spread": false, + "description": "Nothing." + }, + "generator": false + }, + { + "kind": "method", + "static": false, + "variation": null, + "name": "remove", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#remove", + "access": null, + "description": "Remove a resource or collection of resources from the store.", + "lineNumber": 306, + "since": "0.1.0", + "params": [ + { + "nullable": false, + "types": [ + "string" + ], + "spread": false, + "optional": false, + "name": "type", + "description": "Type of the resource(s) to remove." + }, + { + "nullable": null, + "types": [ + "string" + ], + "spread": false, + "optional": true, + "name": "id", + "description": "The id of the resource to remove. If omitted all\n resources of the type will be removed." + } + ], + "return": { + "nullable": null, + "types": [ + "undefined" + ], + "spread": false, + "description": "Nothing." + }, + "generator": false + }, + { + "kind": "method", + "static": false, + "variation": null, + "name": "_addField", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#_addField", + "access": null, + "description": null, + "lineNumber": 331, + "undocument": true, + "params": [ + { + "name": "object", + "types": [ + "*" + ] + }, + { + "name": "resource", + "types": [ + "*" + ] + }, + { + "name": "definition", + "types": [ + "*" + ] + }, + { + "name": "fieldName", + "types": [ + "*" + ] + } + ], + "generator": false + }, + { + "kind": "method", + "static": false, + "variation": null, + "name": "_addInverseRelationship", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#_addInverseRelationship", + "access": null, + "description": null, + "lineNumber": 356, + "undocument": true, + "params": [ + { + "name": "sourceResource", + "types": [ + "*" + ] + }, + { + "name": "sourceFieldName", + "types": [ + "*" + ] + }, + { + "name": "targetResource", + "types": [ + "*" + ] + }, + { + "name": "sourceField", + "types": [ + "*" + ] + } + ], + "generator": false + }, + { + "kind": "method", + "static": false, + "variation": null, + "name": "_remove", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#_remove", + "access": null, + "description": null, + "lineNumber": 381, + "undocument": true, + "params": [ + { + "name": "resource", + "types": [ + "*" + ] + } + ], + "generator": false + }, + { + "kind": "method", + "static": false, + "variation": null, + "name": "_removeInverseRelationship", + "memberof": "src/store.js~Store", + "longname": "src/store.js~Store#_removeInverseRelationship", + "access": null, + "description": null, + "lineNumber": 408, + "undocument": true, + "params": [ + { + "name": "sourceResource", + "types": [ + "*" + ] + }, + { + "name": "sourceFieldName", + "types": [ + "*" + ] + }, + { + "name": "targetResource", + "types": [ + "*" + ] + }, + { + "name": "sourceField", + "types": [ + "*" + ] + } + ], + "generator": false + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Infinity", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Infinity", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "NaN", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~NaN", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "undefined", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~undefined", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "null", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~null", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Object", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Object", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "object", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~object", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Function", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Function", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "function", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~function", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Boolean", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Boolean", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "boolean", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~boolean", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Symbol", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Symbol", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Error", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Error", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "EvalError", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~EvalError", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "InternalError", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~InternalError", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "RangeError", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~RangeError", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "ReferenceError", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~ReferenceError", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "SyntaxError", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~SyntaxError", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "TypeError", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~TypeError", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "URIError", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~URIError", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Number", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Number", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "number", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~number", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Date", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Date", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "String", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~String", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "string", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~string", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "RegExp", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~RegExp", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Array", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Array", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Int8Array", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Int8Array", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Uint8Array", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint8Array", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Uint8ClampedArray", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint8ClampedArray", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Int16Array", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Int16Array", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Uint16Array", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint16Array", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Int32Array", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Int32Array", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Uint32Array", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint32Array", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Float32Array", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Float32Array", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Float64Array", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Float64Array", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Map", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Map", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Set", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Set", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "WeakMap", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~WeakMap", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "WeakSet", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~WeakSet", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "ArrayBuffer", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~ArrayBuffer", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "DataView", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~DataView", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "JSON", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~JSON", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Promise", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Promise", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Generator", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Generator", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "GeneratorFunction", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~GeneratorFunction", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Reflect", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Reflect", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Proxy", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy", + "memberof": "BuiltinExternal/ECMAScriptExternal.js", + "longname": "BuiltinExternal/ECMAScriptExternal.js~Proxy", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "CanvasRenderingContext2D", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D", + "memberof": "BuiltinExternal/WebAPIExternal.js", + "longname": "BuiltinExternal/WebAPIExternal.js~CanvasRenderingContext2D", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "DocumentFragment", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment", + "memberof": "BuiltinExternal/WebAPIExternal.js", + "longname": "BuiltinExternal/WebAPIExternal.js~DocumentFragment", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Element", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Element", + "memberof": "BuiltinExternal/WebAPIExternal.js", + "longname": "BuiltinExternal/WebAPIExternal.js~Element", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Event", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Event", + "memberof": "BuiltinExternal/WebAPIExternal.js", + "longname": "BuiltinExternal/WebAPIExternal.js~Event", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "Node", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Node", + "memberof": "BuiltinExternal/WebAPIExternal.js", + "longname": "BuiltinExternal/WebAPIExternal.js~Node", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "NodeList", + "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/NodeList", + "memberof": "BuiltinExternal/WebAPIExternal.js", + "longname": "BuiltinExternal/WebAPIExternal.js~NodeList", + "access": null, + "description": null, + "builtinExternal": true + }, + { + "kind": "external", + "static": true, + "variation": null, + "name": "XMLHttpRequest", + "externalLink": "https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest", + "memberof": "BuiltinExternal/WebAPIExternal.js", + "longname": "BuiltinExternal/WebAPIExternal.js~XMLHttpRequest", + "access": null, + "description": null, + "builtinExternal": true + } +] \ No newline at end of file diff --git a/docs/v0.4.1/file/src/store.js.html b/docs/v0.4.1/file/src/store.js.html new file mode 100644 index 0000000..72a0c66 --- /dev/null +++ b/docs/v0.4.1/file/src/store.js.html @@ -0,0 +1,501 @@ + + + + + + src/store.js | API Document + + + + + + + + +
+ Home + Identifier + Source + + + +
+ + + +

src/store.js

+
import "array.prototype.find";
+
+export default class Store {
+
+  /**
+   * Creates a field definition for an attribute.
+   *
+   * @since 0.1.0
+   * @param {string} [name] - Name of the property to map this field from.
+   * @param {Object} [options] - An options object.
+   * @param {string} [options.default] - Default value for this field.
+   * @return {Object} - Field definition.
+   */
+  static attr(name, options) {
+    if (name && typeof name === 'object') {
+      return Store.attr(null, name);
+    } else {
+      return {
+        type: "attr",
+        default: options && options.default,
+        deserialize: function (data, key) {
+          return data.attributes && data.attributes[name || key];
+        }
+      };
+    }
+  }
+
+  /**
+   * Creates a field definition for an has-one relationship.
+   *
+   * @since 0.1.0
+   * @param {string} [name] - Name of the property to map this field from.
+   * @param {Object} [options] - An options object.
+   * @param {string} [options.inverse] - Name of the inverse relationship.
+   * @return {Object} - Field definition.
+   */
+  static hasOne(name, options) {
+    if (name && typeof name === 'object') {
+      return Store.hasOne(null, name);
+    } else {
+      return {
+        type: "has-one",
+        inverse: options && options.inverse,
+        deserialize: function (data, key) {
+          name = name || key;
+          if (data.relationships && data.relationships[name]) {
+            if (data.relationships[name].data === null) {
+              return null;
+            } else if (data.relationships[name].data) {
+              return this.find(data.relationships[name].data.type, data.relationships[name].data.id);
+            }
+          }
+        }
+      };
+    }
+  }
+
+  /**
+   * Creates a field definition for an has-many relationship.
+   *
+   * @since 0.1.0
+   * @param {string} [name] - Name of the property to map this field from.
+   * @param {Object} [options] - An options object.
+   * @param {string} [options.inverse] - Name of the inverse relationship.
+   * @return {Object} - Field definition.
+   */
+  static hasMany(name, options) {
+    if (name && typeof name === 'object') {
+      return Store.hasMany(null, name);
+    } else {
+      return {
+        type: "has-many",
+        default: [],
+        inverse: options && options.inverse,
+        deserialize: function (data, key) {
+          name = name || key;
+          if (data.relationships && data.relationships[name]) {
+            if (data.relationships[name].data === null) {
+              return [];
+            } else if (data.relationships[name].data) {
+              return data.relationships[name].data.map((c) => {
+                return this.find(c.type, c.id);
+              });
+            }
+          }
+        }
+      };
+    }
+  }
+
+  constructor() {
+    this._collectionListeners = { "added": {}, "updated": {}, "removed": {} };
+    this._data = {};
+    this._resourceListeners = { "added": {}, "updated": {}, "removed": {} };
+    this._types = {};
+  }
+
+  /**
+   * Add an individual resource to the store. This is used internally by the
+   * `push()` method.
+   *
+   * @since 0.1.0
+   * @param {!Object} object - Resource Object to add. See:
+            http://jsonapi.org/format/#document-resource-objects
+   * @return {undefined} - Nothing.
+   */
+  add(object) {
+    if (object) {
+      if (object.type && object.id) {
+        let event = this._data[object.type] && this._data[object.type][object.id] ? "updated" : "added";
+        let resource = this.find(object.type, object.id);
+        let definition = this._types[object.type];
+        Object.keys(definition).forEach(fieldName => {
+          if (fieldName[0] !== "_") {
+            this._addField(object, resource, definition, fieldName);
+          }
+        });
+        if (this._resourceListeners[event][object.type] && this._resourceListeners[event][object.type][object.id]) {
+           this._resourceListeners[event][object.type][object.id].forEach(x => x[0].call(x[1], resource));
+        }
+        if (this._collectionListeners[event][object.type]) {
+          this._collectionListeners[event][object.type].forEach(x => x[0].call(x[1], resource));
+        }
+      } else {
+        throw new TypeError(`The data must have a type and id`);
+      }
+    } else {
+      throw new TypeError(`You must provide data to add`);
+    }
+  }
+
+  /**
+   * Defines a type of resource.
+   *
+   * @since 0.2.0
+   * @param {!string|string[]} names - Name(s) of the resource.
+   * @param {!Object} definition - The resource's definition.
+   * @return {undefined} - Nothing.
+   */
+  define(names, definition) {
+    names = (names.constructor === Array) ? names : [ names ];
+    definition._names = names;
+    names.forEach(name => {
+      if (!this._types[name]) {
+        this._types[name] = definition;
+      } else {
+        throw new Error(`The type '${name}' has already been defined.`);
+      }
+    });
+  }
+
+  /**
+   * Find a resource or entire collection of resources.
+   *
+   * NOTE: If the resource hasn't been loaded via an add() or push() call it
+   * will be automatically created when find is called.
+   *
+   * @since 0.1.0
+   * @param {!string} type - Type of the resource(s) to find.
+   * @param {string} [id] - The id of the resource to find. If omitted all
+   *                        resources of the type will be returned.
+   * @return {Object|Object[]} - Either the resource or an array of resources.
+   */
+  find(type, id) {
+    if (type) {
+      let definition = this._types[type];
+      if (definition) {
+        if (!this._data[type]) {
+          let collection = {};
+          definition._names.forEach(t => this._data[t] = collection);
+        }
+        if (id) {
+          if (!this._data[type][id]) {
+            this._data[type][id] = {
+              _dependents: [],
+              type: type,
+              id: id
+            };
+            Object.keys(definition).forEach(key => {
+              if (key[0] !== "_") {
+                this._data[type][id][key] = definition[key].default;
+              }
+            });
+          }
+          return this._data[type][id];
+        } else {
+          return Object.keys(this._data[type]).map(x => this._data[type][x]);
+        }
+      } else {
+        throw new TypeError(`Unknown type '${type}'`);
+      }
+    } else {
+      throw new TypeError(`You must provide a type`);
+    }
+  }
+
+  /**
+   * Unregister an event listener that was registered with on().
+   *
+   * @since 0.4.0
+   * @param {string} event - Name of the event.
+   * @param {string} type - Name of resource to originally passed to on().
+   * @param {string} [id] - ID of the resource to originally passed to on().
+   * @param {function} callback - Function originally passed to on().
+   * @return {undefined} - Nothing.
+   */
+  off(event, type, id, callback) {
+    if (this._resourceListeners[event] && this._collectionListeners[event]) {
+      if (this._types[type]) {
+        if (id && ({}).toString.call(id) === '[object Function]') {
+          this.off.call(this, event, type, null, id, callback);
+        } else {
+          // TODO: Performance-wise, this can be made way better. There shouldn't be a need to maintain separate lists.
+          this._types[type]._names.forEach(type => {
+            if (id) {
+              if (this._resourceListeners[event][type] && this._resourceListeners[event][type][id]) {
+                this._resourceListeners[event][type][id] = this._resourceListeners[event][type][id].filter(x => {
+                  return x[0] !== callback;
+                });
+              }
+            } else if (this._collectionListeners[event][type]) {
+              this._collectionListeners[event][type] = this._collectionListeners[event][type].filter(x => {
+                return x[0] !== callback;
+              });
+            }
+          });
+        }
+      } else {
+        throw new Error(`Unknown type '${type}'`);
+      }
+    } else {
+      throw new Error(`Unknown event '${event}'`);
+    }
+  }
+
+  /**
+   * Register an event listener: "added", "updated" or "removed".
+   *
+   * @since 0.4.0
+   * @param {string} event - Name of the event.
+   * @param {string} type - Name of resource to watch.
+   * @param {string} [id] - ID of the resource to watch.
+   * @param {function} callback - Function to call when the event occurs.
+   * @param {Object} [context] - Context in which to call the callback.
+   * @return {undefined} - Nothing.
+   */
+  on(event, type, id, callback, context) {
+    if (this._resourceListeners[event] && this._collectionListeners[event]) {
+      if (this._types[type]) {
+        if (id && ({}).toString.call(id) === '[object Function]') {
+          this.on.call(this, event, type, null, id, callback);
+        } else {
+          // TODO: Performance-wise, this can be made way better. There shouldn't be a need to maintain separate lists.
+          this._types[type]._names.forEach(type => {
+            if (id) {
+              this._resourceListeners[event][type] = this._resourceListeners[event][type] || {};
+              this._resourceListeners[event][type][id] = this._resourceListeners[event][type][id] || [];
+              if (!this._resourceListeners[event][type][id].find(x => x[0] === callback)) {
+                this._resourceListeners[event][type][id].push([ callback, context ]);
+              }
+            } else {
+              this._collectionListeners[event][type] = this._collectionListeners[event][type] || [];
+              if (!this._collectionListeners[event][type].find(x => x[0] === callback)) {
+                this._collectionListeners[event][type].push([ callback, context ]);
+              }
+            }
+          });
+        }
+      } else {
+        throw new Error(`Unknown type '${type}'`);
+      }
+    } else {
+      throw new Error(`Unknown event '${event}'`);
+    }
+  }
+
+  /**
+   * Add a JSON API response to the store. This method can be used to handle a
+   * successful GET or POST response from the server.
+   *
+   * @since 0.1.0
+   * @param {Object} root - Top Level Object to push. See:
+                            http://jsonapi.org/format/#document-top-level
+   * @return {undefined} - Nothing.
+   */
+  push(root) {
+    if (root.data.constructor === Array) {
+      root.data.forEach(x => this.add(x));
+    } else {
+      this.add(root.data);
+    }
+    if (root.included) {
+      root.included.forEach(x => this.add(x));
+    }
+  }
+
+  /**
+   * Remove a resource or collection of resources from the store.
+   *
+   * @since 0.1.0
+   * @param {!string} type - Type of the resource(s) to remove.
+   * @param {string} [id] - The id of the resource to remove. If omitted all
+   *                        resources of the type will be removed.
+   * @return {undefined} - Nothing.
+   */
+  remove(type, id) {
+    if (type) {
+      if (this._types[type]) {
+        if (id) {
+          let resource = this._data[type][id];
+          if (resource) {
+            this._remove(resource);
+            if (this._resourceListeners["removed"][type] && this._resourceListeners["removed"][type][id]) {
+               this._resourceListeners["removed"][type][id].forEach(x => x[0].call(x[1], resource));
+            }
+            if (this._collectionListeners["removed"][type]) {
+              this._collectionListeners["removed"][type].forEach(x => x[0].call(x[1], resource));
+            }
+          }
+        } else {
+          Object.keys(this._data[type]).forEach(id => this.remove(type, id));
+        }
+      } else {
+        throw new TypeError(`Unknown type '${type}'`);
+      }
+    } else {
+      throw new TypeError(`You must provide a type to remove`);
+    }
+  }
+
+  _addField(object, resource, definition, fieldName) {
+    var field = definition[fieldName];
+    var newValue = field.deserialize.call(this, object, fieldName);
+    if (typeof newValue !== "undefined") {
+      if (field.type === "has-one") {
+        if (resource[fieldName]) {
+          this._removeInverseRelationship(resource, fieldName, resource[fieldName], field);
+        }
+        if (newValue) {
+          this._addInverseRelationship(resource, fieldName, newValue, field);
+        }
+      } else if (field.type === "has-many") {
+        resource[fieldName].forEach(r => {
+          if (resource[fieldName].indexOf(r) !== -1) {
+            this._removeInverseRelationship(resource, fieldName, r, field);
+          }
+        });
+        newValue.forEach(r => {
+          this._addInverseRelationship(resource, fieldName, r, field);
+        });
+      }
+      resource[fieldName] = newValue;
+    }
+  }
+
+  _addInverseRelationship(sourceResource, sourceFieldName, targetResource, sourceField) {
+    var targetDefinition = this._types[targetResource.type];
+    var sourceDefinition = this._types[sourceResource.type];
+    if (targetDefinition) {
+      let targetFieldName = [ sourceField.inverse ].concat(sourceDefinition._names).find(x => targetDefinition[x]);
+      let targetField = targetDefinition && targetDefinition[targetFieldName];
+      targetResource._dependents.push({ type: sourceResource.type, id: sourceResource.id, fieldName: sourceFieldName });
+      if (targetField) {
+        if (targetField.type === "has-one") {
+          sourceResource._dependents.push({ type: targetResource.type, id: targetResource.id, fieldName: targetFieldName });
+          targetResource[targetFieldName] = sourceResource;
+        } else if (targetField.type === "has-many") {
+          sourceResource._dependents.push({ type: targetResource.type, id: targetResource.id, fieldName: targetFieldName });
+          if (targetResource[targetFieldName].indexOf(sourceResource) === -1) {
+            targetResource[targetFieldName].push(sourceResource);
+          }
+        } else if (targetField.type === "attr") {
+          throw new Error(`The the inverse relationship for '${sourceFieldName}' is an attribute ('${targetFieldName}')`);
+        }
+      } else if (sourceField.inverse) {
+        throw new Error(`The the inverse relationship for '${sourceFieldName}' is missing ('${sourceField.inverse}')`);
+      }
+    }
+  }
+
+  _remove(resource) {
+    resource._dependents.forEach(dependent => {
+      let dependentResource = this._data[dependent.type][dependent.id];
+      switch (this._types[dependent.type][dependent.fieldName].type) {
+        case "has-one": {
+          dependentResource[dependent.fieldName] = null;
+          break;
+        }
+        case "has-many": {
+          let index = dependentResource[dependent.fieldName].indexOf(resource);
+          if (index !== -1) {
+            dependentResource[dependent.fieldName].splice(index, 1);
+          }
+          break;
+        }
+        default: {
+          break;
+        }
+      }
+      // TODO: This only needs to be run once for each dependent.
+      dependentResource._dependents = dependentResource._dependents.filter(d => {
+        return !(d.type === resource.type && d.id === resource.id);
+      });
+    });
+    delete this._data[resource.type][resource.id];
+  }
+
+  _removeInverseRelationship(sourceResource, sourceFieldName, targetResource, sourceField) {
+    var targetDefinition = this._types[targetResource.type];
+    var targetFieldName = sourceField.inverse || sourceResource.type;
+    var targetField = targetDefinition && targetDefinition[targetFieldName];
+    targetResource._dependents = targetResource._dependents.filter(r => {
+      return !(r.type === sourceResource.type && r.id === sourceResource.id && r.fieldName === sourceFieldName);
+    });
+    if (targetField) {
+      if (targetField.type === "has-one") {
+        sourceResource._dependents = sourceResource._dependents.filter(r => {
+          return !(r.type === targetResource.type && r.id === targetResource.id && r.fieldName === targetFieldName);
+        });
+        targetResource[targetFieldName] = null;
+      } else if (targetField.type === "has-many") {
+        sourceResource._dependents = sourceResource._dependents.filter(r => {
+          return !(r.type === targetResource.type && r.id === targetResource.id && r.fieldName === targetFieldName);
+        });
+        targetResource[targetFieldName] = targetResource[targetFieldName].filter(r => {
+          return r !== sourceResource;
+        });
+      } else if (targetField.type === "attr") {
+        throw new Error(`The the inverse relationship for '${sourceFieldName}' is an attribute ('${targetFieldName}')`);
+      }
+    } else if (sourceField.inverse) {
+      throw new Error(`The the inverse relationship for '${sourceFieldName}' is missing ('${sourceField.inverse}')`);
+    }
+  }
+
+}
+
+
+ + + + + + + + + + + + diff --git a/docs/v0.4.1/identifiers.html b/docs/v0.4.1/identifiers.html new file mode 100644 index 0000000..19025ae --- /dev/null +++ b/docs/v0.4.1/identifiers.html @@ -0,0 +1,100 @@ + + + + + + Index | API Document + + + + + + + + +
+ Home + Identifier + Source + + + +
+ + + +

Identifier

+

Class Summary

+ + + + + + + + + +
Static Public Class Summary
+ public + + + + + +
+

+ Store +

+
+
+ + + +
+
+ + +
+
+ + + + +
+ + + + + + + + + + + + diff --git a/docs/v0.4.1/image/badge.svg b/docs/v0.4.1/image/badge.svg new file mode 100644 index 0000000..324db4c --- /dev/null +++ b/docs/v0.4.1/image/badge.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + document + document + @ratio@ + @ratio@ + + diff --git a/docs/v0.4.1/image/github.png b/docs/v0.4.1/image/github.png new file mode 100644 index 0000000000000000000000000000000000000000..ea6ff545a246caa64074ba809bbc86fcb8589071 GIT binary patch literal 4268 zcmeAS@N?(olHy`uVBq!ia0y~yV5k6L4mJh`2Fnz)OAHJQk|nMYCBgY=CFO}lsSJ)O z`AMk?p1FzXsX?iUDV2pMQ*9U+m{l@EB1$5BeXNr6bM+EIYV;~{3m8Da#=fE;F*!T6 zL?J0PJu}Z%>HY5gN(z}Nwo2iqz6QPp&Z!xh9#uuD!Bu`C$yM3OmMKd1b_zBXRu#Dg zxv3?I3Kh9IdBs*0wn|`gt@4VkK*IV;3ScEA*|tg$M@9GsC^+XAr7D=}8S5q+7#b>= znduptn3|ax>L?f)7#ist80j0B=^C0?nVMM{nJYknlAVH0QA(Oskc%7CuA-DQTcwPW zk^(Dz{qpj1y>er{{GxPyLrY6bkQqisxCgqow*eWSOjjhNnfE$}v3=O8_{9OHt!~%UoJp+)JAb!m)@b$&7G&dKny0|1L z72#g21{a4^7NqJ2r55Lx7A2}6#Z40`Tsp!z zltV&xG&#&-oVK7NaS>zC6t`)YIXL_}k9Az?X8cr@J z4p(R_U}}ol`}hBw(!Aes=Pb+L7k|4|J->LL>E^WJnbrG`|9bn^_WJgHE}@}QHwNvP zq|xHFCFkBEQ@Obdjwazhn~j zr!%JWZ)KHpUU=PU_wg+=v=?k%=+E>`j{Ao64ZDh-mN?ej3F^8J4PSh|(9T%Z$XcUx zoFZ^EM&sdfk$Sk(u@Pfw+-*V@)eae4v_fk!`m~6s?F`$x=YE;JKV|2&3Cfoi`Le!PwTGE!N6i0Po~qu| znSt{f`xu@yS29Z!SU)gizjgA{XBFuM%#1(dH?s5WxNmfBm0$4bv(w)QpXhG(*`kuL zqxoY*!oxJxEjO7qCME>wJM2*YFoSb#e&o|5k6#^Iy40Fa)^3ZMSp(yDHJfEKnF=1v{O#3jOlU{vOcUt$6p(x{9ek zT26~6?P`_oyzuODYvVZuZrOilEAGrncI0=k%vhjrw4Il`R=DYF>g8R`QL~b3cYgWJ z$QG;3oWCgb^n2dPzvJGC=DlZIa=WdWTe|v!8blTt7YTy6H@QFn&z5T|`Zn?y9_wKlA`jY;xr+DLvQs{8Q>VsMhBmvd-*W<-#4Dr@t`I+;`^t$MSBbQ}uf` zoYaUjW0NyE_%q;VRJ5pndwSr+oklx$D?3Ntn|$#0?hA7-e0Q~+VXad8IPm9Pw@cTH zFC0Fcxz=@mnvDMW%?p;NzhG8(eDC_RFD0@0I`gJf<;2f>*ZfW>%>C=`z?$?qWLEd) znK~P6xNN0&g+#H`3BGRn)-mDdKg)o1H)3<-R zJHGO6J;$>`;da1;%ghEgr{_3C#kbs)Q@$^h8M=={VeQ+BEu1Sd<}{UhJ&&2cvQth> zA?DON1)+&))?b2OGwu)g&nr;Co@jdbvx4`mi66N>J8So`)E=9`ysoXz?V=6GwR=S; zq!m|Z|7F-0x=`Sn{;&UwHb$9W6HcgkRoi<`>(a|<*;}`SdVH2i41X^Er+96n23JAR z#>t}6TSC14E$eAe%{esHYi4oP<)d|bj^{3T`pCpVV%guOcFDUNIBRv|L#0gw+Ad%((?Nu5c;x-Z|$-BdfweCf86@|Hu-=PZ7B_HM$?Ycn<$L{ExSkV@aV zW9iK)iQ<#v3-lL@nfiCtI#%a{7EZ}aXL`3_%8#Vex<%2Y3J;8y9tn@in|OPb54S;V^7hEQ zd9B-4U17T8rTFlzL_%%e&dPaug75rVmqZH|7`L|AZ@f`+nz7Ynb|&M$6Q4fmvTtR` z{^5Cb^PZaSW6KVoWLYDqx_sl)r_m;Nx}>LRh;F;`>67mA43$-^H;$d_>O8xJVf!a( z-eogf{q(k7V2WA!#cbQQ7dG6vOCPR_iCko{)beoAXPviGF8y8MlG(I2@`aPg+WvOJz=9Je{`Sb?DVq49=j!_2LHAQ zb+-Ll7{sRYBcR)8El+66?*5#~-cwhLY8zTfx}5RqT|fPH^J3A>7IJ1rnLn0xNq(Gg zwO{9w@RO>=)xUolnLkiHHFc)S#szCho;#nIq4?+7;zf761@vCqoNp<9d18(*!{f2 zyz0WYrYzlH^N@SlAJZjPn-__$_`#B~mx(Q!|I`N0Vo`CEtkXK*`L{CuKWp*4>yW^+ zztJz8Bp%*jYPs#YZ2tDyAM(;|)p&xLk1gMO{cc^micH0tHphP~xzP*>=NtYVwb1rV z>^FUOg>U9WkH7=oA1bas@8WdN^_g*zX-DN*-3`AY_cgvz``6R7?u_z^EstG~bzV6g z&=go|y*F`txG~c-rq5ivKijIDxb5t>wsw+0{e7AKzzc?I)%EdhaaCS%^Gu7vo!9&d ze|+clkp;;;6Xdr}ei*&sV&&HV#uF2b-kJV7oj>8j`>elzl_EW7YQ{hLX(=}E`oX7i{d^{xlb;>UDPHP9_ znv_H0NgPIzkG-1jac%byKKAU}qXz9`dXJRK=P^3J(^7uurgqPW$!x~Nyj7F@Zn&)f zJdtzzzG(+E-mSj&g6~Ln=1p@Rql4|)Qj1x`(?sv6%ZnH9c)e8HN3%3G_qeFU{)ZDP z?1SPZ(lfih{5rkFeu5+GmhNx78AdZ6b<16kKL2~O_L(g=CcNZbXYlX6-jk@;_wSao zZ;)>*TG>~79eTd)w?g_{O?j^1rxGnTh&6qeH(dc0T^-{#a($ET+F_+-J$m+%M7?_*m%5 z9G)$xB^u*##Gf!Rl^)vP5eEZbPyiaXAW1j7feKu$7+$Z)1eb$1%-*cxr z{ZC_QyDKGpV6jTn9`%oVdt23}oldNqd$W2`!0Ag%+;?0~S(u_z+xem1w`X(xE_wTU zrTyW0+-mxpR`TCobz(nH|9=;ra;v82Cc-PfPy-_vj0c#Nxd(@*~Y zm{poru}0vATO89iHgmU>JI#WJW7W5ruWIk~ zWnYbNKk4@LyI3K9A@#z1my`#mI38}Ay(`G=^FEbqf98*UF$sSxC;k;`tvT^z;evg4 zEN{tQT%h&z)PgYKxqm)Q^PK-8-855+$277m>yz&y4dYyEmFOLojAAGB9~jy7f zL~ullakwP}Y`v*w{r>N_W4qZs@0dR*mJEnhkBwIldT}sEq$j%jzF}Yc(q(f(8VWKu z+c_TMmD%91tUtv3#q48U;SUc5ZZBC~yOBv}LZw;TY_9(3vQnzuho3bb62YD*+f2qAt}xC2J#S{J_)I&t;ucLK6Tg Cd!TIq literal 0 HcmV?d00001 diff --git a/docs/v0.4.1/image/search.png b/docs/v0.4.1/image/search.png new file mode 100644 index 0000000000000000000000000000000000000000..f5d84b697dad0c856a822c2df0a0da46ee3e9be3 GIT binary patch literal 12704 zcmeAS@N?(olHy`uVBq!ia0y~yV6iFfq_LO)7d$|)7e=epeR2r zGbfdS!9uV#^nU*B5D~l1{GcUb_6ia1?OjLLhXzOQl$Kh1jLmcM(zjk>OJCm5Qh8!! z-nmkm{r1aktNg1Q&Ds7iI^1OD_pnjqWlO5Q`R%|K&){~gRh}NzFOKjls=Z|meYm?U zNj>;T%-3J1E$>@Cw|*XX+r>6MbL%Y0(2i-V*UdezGIjEDu_^O>yDn|M;>~Kl|?= zncLa!e3toe*^Gs0HPiIkIYJc|kE`4IDcW=PUC??hx|U-Po6VjZY5Lm}|cKNNdtR>{g$mHsm}ncJ~ff|9l^ zKH&bs#YNdqOgHK3N-ygr0rQNe9NFt;W}|9!qNVll=|n>%|4TwScPlOXA0Kb&*(APK zcTwO{>*MPS_MhAsVIO>x@sE7c<~Ih?>B37knBSQFhQs@y)j>X1uA*EkQLW3h8ec!} z@h=S#v+@i0^v9uAqa*O#&G%Bj&i4Ono3+7P`-`&w1w)hQx55hS!WpIJm+Y2jXWPHw zvpL1K`^UMr`?9l3{uF-hz1y98+-yVMv2BNb+*rR+_fKvRlXXH>*R+MFK9n8etWcJ< zjbXg3%KJM1LF9#7LAN$8Ui#{1;{|24gZ3xv&Rp90@WQHpi~g<5TM@rP{K|dntQJY@ zWh%8=wc39*YSnA?|N3;5MD9}hs}ehP-$XrD%iZty&R4xry*@rs_-dWbKb`Vt&!0^;(i=o}#>-7!{$%fmH=N(j^8A(ED^bF=Im>rzweCk22@`%*wz+KA zkA)mYeV`@B6r;(n-Y zSjPPI-(+C}E2{^&IzFl=j33RlDhzY|!c{W+!r9n5w)=dGJXe=pGdm?3esle*^_rYD zr*;^{UUhF5J!>L*{;7sp`HsDZx)-bLYgX!e;dt-&KG(9lJh|_pUE2R2vVI+w5xqjV z_N~Cz{ZhBuKKRu8C@j-16JEZk@Yk?b_ULtQOje%wmQU(kALQ&NfOv zH>Yst&Yk9tE7Y8?tYcijDX=>G!+(~X$~-2Qo#`87-FCiTbmy?Z;qs6F4?cVL%=Y#5 z_4x&x^`^P9#VJ-;yd^fcYwQjt-be*0M;l?mJBxBTcSh?ui_x#JJ1zz1<159AW6 zWp~6y?ksxxdtKO}Lnj&+ENmE3A#<#tO?O`YoC}$%0c1to&yd?*5fp68_xrMOtETq5Qd(&cU|)i>`O% zD(~9+`oi14wX2?ftT9^9*?58L-l0}*^|Z9KbFIeDlqT;En;g6)!SUI5z71DON=mM* ziQN3GKdL~GU9#Ym!wnYwxBq^>-!GkF+u@Vf7JTVYh1{lnZ#Vp2zB+8}FJ8Odhfgr( zn$2(Az!CRrlB#!_;^b-xr}D)=^SIA3am@EAugv-S>Z)|(B5ezmH8Xis&Np0bGB15~ zWzC{Ri++EYa_GL(3pI6r{_`D28Cu>eJX8FaaeZB^|MlzFPcLBqf1;s^ZH>sDNs}hc z@tmxt>*V%bU>nodI0FfVO?#DZ$k~^?2)KG}ZFDq`S?dMo0}Z)N(>vF_E>|qFcW^5Y z<@mGwm`h5Hyu**Wo^|iI8eRo3_c)wzkY`&XXw$Q+PBhqi-V@thcK3K6tiJR3@RVs! zC9c+*HoS^dm6Vvm_?XpS?&l#bmHx#G&$_3j@3C#JIz2&t;>(khW&9IEr?>y$n62o? z&3T5W`K`}!k;%Ue6+SXaU7x-o@XZv9;F`w$PCwEt6ozd#?q**~7_X?=33-=+IW@npf$2*L3r6Ft0MUd3mT$#`07AMGvuy zvEK|Ea@N1PvNHI7viNno`&nB();>5p*ZTYCiic<2I_~mDom5_TMY7?=+r!T%K=Ul_7OwDd_{dw&>OJ^H!S?3k}_;a;{t-w*b`L^iOif20$pP!ri|9(kz zN4z=nEf)VU)1RzT2a+>5ZthyCY_(lNApY^AZ_@?#8Vc;Kci%Z@^K-GCI?LsmvvzIS zw5Q6^@!(~Sf7QPfpV%)YwolhJ2v}57qgSK$(_s9?6<=$s#f0( zw)*&U(!-NByH7B%9`#F?k!bePn<3;a6nv~fEx?qg!tP_lyagRTTK^_Vt>!$E!FFM< zZ1>5N+mnhuZJsgbPUaRvmiOAsGv%&NldFt*Q`Z05a9PEjntZor+n)268EVDmr%&8E z=jfI0dH#khvD*?)B(X4;%f2I6`N&GSMWqb$*+0BG#H_2U%Wjr)qktvFqSnGL_uHGBtd^FR zn|^&3xnjtgTFduTJXu=MYEt3`9qIn^hjr#X+b%zQBKg7R!!*5Et@XY!vu#w2&o}&- zb9kHVZLyB?)4IC4?ru1;{*1D0jrgK>L05Ed^W;pQeKO_Kio!rm_WS;-^=juiq?zY& z%+t9ybN1}tY%K4MrwRX(le&F*hWxkaJ&Pam-ng~!$UUDu%qdpStnYEkp9p$2KeXwz zu*8RhKc78&_AJG6C8(!!Y~N8EbZw#v?I z*^^ctT~F%dUd?OsdB1jn z!G^fKJUfIQO#EH8-dUli-qTF#|Fmn@uCZTR7rQ%r{p~yMVR3PF%5ihPu(-T0`|kaH zyUULP{ddo6FJ6h}|F=nW-L06J6?5j#|G(p9Qu~<)7Tee_me#7pD1PYND%hy+y39_x zx{m3gbhZ}1P`A+J1OIJIz-@s{l$ z>x?+1$t^#{6BU&H+&^A2Eh|P~m10#Z+a%?UKUE6ucb#3&`GD<`h~5d!*u4|)-t9lO z;fl*CgHO9YJvi8$dfxtjO>^guzXy8CkJK6D+}N<(tw*Ae^^eWjeyh7{n8hEhUhX&d zmt$@1-mA?1c|~c}k$t+W_F>NM~#k(%2Hz^AanQXk>di=n$pf{8F!yfwVXl{`B zY9!kk*m?Dd?lVa=EIK%&`K7jc!NK40f9pbi^~cOmO=DayF?$-T+>}kJ=4+O)>lWxgujW|rbJ>Na zgPrY$umAm@(R5v8js(Y#?~4{KGCOieRxRP!*PmVwY+D;8W;z|+Kf!3ilm}C%OnK5H zXZy>NrT^E~YbkZI|E47=eLU~{D*F7{wu(Jb5fK`T@02U4$=v7vCX=y*DM9DRiqBn# z+xd-8f9@_x{i-6mWU`uXRLg>$UNd=_A9UPEoXxs%wbTdY@*Srd3Up$)pRW^pFVF#%(%JpY}TJoEyWM*{!Kh6r)a3N zQAUUBnw$u8CzsqKmA~wcjXqoAd~7S3J|C@{^5Ub-xmdQA>XO{6_lC~Q!Xs`1oteqcCLP<>vR~z} zL(IX$zZlB1_eCvEoO@8`S7c3-lH~U4>NP){YLxbU+@|(?ske`Jj8IOP_vJplBgvT`aPYA4X5m8BISa2E^>D3w;=~ZO z*Epr)hg;1O(S=909oZ39bL6QVb2FEm7)OA0P5+xj^J|+YKTrO-dYmWb#`}=K@!m2reQ(xKlvL^);>0UvH9BA-DT_bO*aaim+1IWFgab+LcbzS<=fop2aK;88#sLU z^!fAtwu!5Ca!(Yp)`du`Jt{ob;1=(7#`}%+=8p84hYm0tY<}#$wefiE{OKEnxZ;Z%leOzMr{KQMaPuK_h!J>8@BAd3v zU6o3dxH$QH=cn^dY+HVYCB@%rXbri%goF7n3xBvpsHW|QIhk2mmn;??XDDi9{J8eV zjn+jm+D_5Z1!oP!t{ir-KX~}XOtXX4>$Yv%Hgn&m$&4R$S)N(?Udzm8p0#5m<7wA} z(c5xvUiEmn{&I?l)L|>%ijJeTY+HUt+-lgu`dv4*Q%YioMumiF@YK7FbG~mlbs`V4 z>`j58(HC5LUPkC~$p!tKZ6et`{lK3vVY#G_eT=#Lu3Zz`lWbR`8ZTlqW8E{`MLX6P z=bfEpn%{C>_TiR@8eO~al)baIE$9%|UhswE-WTKg-kq-J5D+DKY04=*{WCP9?d(ay)NqHp)1A<&OX0&tEGxvifM!UhXU8x zYdG~ktcX?#61F!>y7;U(H}{a+eD=iP{s#}$-kLgw$gTCeb2@X)iWLvIs}@a6{%H4c z=a0DV&RMrw#Qbs&TvV)O@2b*{pXz%_gf(X!y8PSVLN$NB)BM`TI@dP$gWOk`4~DKg z`Tc;AqJ>(-=5U@R$+G`rEX>cZ=9;9teed46P1AKUr^&28`TdgGlH3R<-LoAA6Xs2v zSlFs&78MnxQ87#Ak+N9szU$Y_YD!wShA!ooHp`hJ_PXHylFGwvyzW~bDDu@y3f%YR z`4OG{=9bCU-WwV}y^VO5B&TxtO5WSeaGsTU(#Hj{$IBLLS4MPup1Rd07S(gC@ul0# zSw?#WfB*z znE8B|%PDdBVyna|R*gKN;163Yloe!VB{>A&<~SjHE%Y?cd8_HOas`ZSHve5NTYG+S z>Mchhc}WH4lmonMOT2GCb92m_(x}OK_>M+<>WtG3U^CBrU7`2n($d_kOq~6n0`MET zcNGtREJs?!E#+g$HM5c$B)6dTfRj$~v>-o8Pw!057#bq`zvmN;^#LVaS^~n@&alI8U|5hX= zaBxrk`XR*9R9!vYi{r1u?##rwvBD;Jb2&YnG6Z8Ed_cg6PXL(V$) zj2qtgU3K+~p8eq-^TQPj-9KDgAAi3=J8H4gz)Ya+zGrwoT%UyTiFNSpGld7T24zj+MW#;&j80sG4`Vx}Hr9GQI~nd zC8d4emX)wC&C2HH^Le0Y2r3s}1nm)eJYzvwec8!Lszv(!^&RnrUH)GN9 z3>|US{HLd;zE_@FA3fQWV^8I*4+7o4c``n4+`^d2{Vw{Hkf}jI;0G2Sx8>V17_N3R z_CB1qX_JxZY1Xfg9xb=#>Bv8N{N0pieww##HCTsjoD#?Oi&L)2fA)i?PoF=pUoEa< z|2D~?rhCTe%PCX0nJws)mfrA1c+an81^*ALRjTIl0OeY7K7A6~seO&n?Y%;IV?@MeZiArMSpn7QH zqR`T8R^hm1pE`D@ZQim#GT>Ek=|=f2^K(|$H#|^W8~(f`rgDGb|G(e;H~0S8a7%fg z$o#C$@yTzpAD<|(VP;vsa^=hNf|}iChYhNZ>G;nMmU(pXg?DFVXKlOMM-yiW35AM? zzfe3$-Y>(jp%n;zTqJ*<6w+lr>^7cP8IVsf}#6lgo|VD0>%H9gkW zHF=v3CxIIhrpOJ6J-c@83S&9w_I-8n(j)WF%&`o}LEp^T)aMzb378&t9XR%-rwW z)9Cnq=>qN|4#%q8B-fwiB5qf#3Pa~@tNQxt?!T+2X3a5b5Dk37YHKavE$Mgq!z-I3 zm#jraMJMmkn*a1wl0sUWcw^*Z?sw`LOCBy@44pn@%9D&E?mqL46zqiJGevfDcuh6@ zr`i1HnHqC5SDd?h`>g~AX016km7mVvQE5)ydA{L?N6pi^lkcXiusn8mUx}>WIA=7nSZcdrtM3eqMZjM}CanwYQH#j&HktY||b^=SN)kR)wyvYt~+P zYrDn6e*toFOq&HS%e7rvXeA*K-{F76+)9AgMbS`qqwNRrcN=Fm?r36vyxVZn*BNO- z7dCWpadE9`EW8kye%36aMc21R(e7eSu*$N~wSQO4)Q{evswMC;;^8A*mX9fC+a9m_ z%d+kkf5x#4YqKLK_bd4ATYuB<$jQhfCp8j6wtKXt-OD*J&7)1d>`~K=ugP!OyqypC ze%gPv?{Zkpp}l1rh2J$6-q@6S`r6~{Wo!2>h`lIzqGMn6gE*Fx`!*&YKX?53hsOP{ zZZ=ClEf*0JGkbGqXYq8okZ;NdxsG)g+<(W}th2Z7)|Slq_ctaVU*EX%w8EX1Sxn5F z-1j~{KEAuFtLv7c#(kfKcKiMI3P*f*{BrNh>O%(CnK%BP-_c#VLqhFV@&zYxSO0GH znnM#eJm8$SXV0F!i`{yodJgQnqh8aus?%gowL;Z<u7I^sI}!xmotUT`@6NpQqG$-CSd-p6 z*l5t|GF}J$7n=I|`vc=9@ybuD3f!lfx~V#QhjOf-&BKI;hgySEMEGYOOy_y-GOcZ5 z=_Rv;AMLwRTgqnSolp2-xHm(}B~DGCo_k-ht{mIy%OCD*RIyoKxXR%EcqhM7V6uTc z^8#m{xL0r9)NI+bspxluJny~6b+37P_SiAi*B(wVZff$o$ldi*@X+nZOeY+1Q&+qOvA11t~A#^uQ_15s4}C#|7TvHgQ(JD>-JUK9U0;s z#kMY8v?$5^-}h|Q*qID*96U<}cH9nJpHi~wx(?3?-?&iki=Vq9r=R}n^MOTuSCDo= za?Q@uGkP`n9$n_RxU!u=?!fcLZ{NNl23pxH-m)z}JI{8v0;p*h7IsYpG18jIV)(6T z$qUH`(f+Lb-%j5?SJ!#0qMtG52a}-ERUSJ&XO7t)D#iZKcMdBPQ$CpfG}z(6_QV|l zJd^!piY@yj+wOn*Xvz5h`7fp^Q!Nr37CmncbPmr3)V)?_b|tvbDyfH*{j7 zgT#UttWMQQQcf>_|GmmH-2rnoXatT@WxdR{wCcFODQ>D%<}_6RKF2-Z*eGVSi|eMdg*Udywgdi8%~CQ^E4q>*N=MR8^k*!(EU0{>d=0Wfgiq zpD*xUIpy%$xiv@rKi#ptmht}i$B*jy?w_A$U;poJ`uy5$j5QXuTIwtzYWYbIn$#ye zmF1c-=MU4I+UiegA9#!s)R|`-E0vojd*GYcw(A@B_M~rlYW-ivXo1rQmfbcJ0|Np+ zn5?U+;W@j|xH3vZ!lKLPLu$k>&eetgrR}Vp6SsQ1trFbRVf!+oz~Nq_)G1c>m`|GB zoSe)8`@Sb;U440Zx%S1swo*cygN=e`Klm!qytMDxNcf^(5Ox^n8QJnn_&OcLmCNL&4EKBCFc+H2-rMi`TjK}^?vV-p8A{H&)bEC%1S+q%h_D@-t^%5dd3D3 z+x|T&;-WeAy!*6mR~=fBbhRu~KXv22eQ~>XWN*B6svw2s@`v4qNwq6=760z%7S0Mc zF*B>%y=>XD<~Y6w*S9b8o2#YtBYejUN#XvzKepC4UCzlVU)*gi7IU33f5q+{Ze47< zc3i&TFt6oUN+?!YRD*{EqyB#V;z~yZm^*dw$_t zOJ83TTmIC=x_^;)uW0%AR^KmcME2a9aG<1Jhv)eD-jtfj)!#oGm$F?5;PY~8zxl^> z#=8sisyZ)vFL>el{OH-ei9)ukS=ajqoY2zQtWd-MSuS2aOs2;5@eS^U)jYA+do66= zomkzh#Wu(3qO?QjYwJTwRf&Ro?lE{C4w<(5uq)*Z{ zzw9cfE)u`*zEVz*?IQQ=2eCbzJ+J)EoH;Y6TlUh^z26@3|0$Ztm{RnKCyh7k{)&Su zUd!wM6SyGWHShb8+j>49nR9rot|(r(Zfat(Cn7xj z`mJ`c(s<3Pd%KT>U0nR&Xvf@5n>IcC`SWLd^NXpECIqn@fGi`hs1!<)e{-wpee|qZ zv+Ba5qpPjhM77F;zw9aR?p>7b%KYu#SLe19$~iB-O;h0TQWRS%u>bX+71!5VDdglc z{}xNQ-}LU)wG{cEMcnPPp9XxnlVV&Ixvf)6va>{H*8n*|U2& z51C6URq%GrYe?A1_TT@&wC72o&H?WvbJ_#n?bi5iaO7?5pZX0ucUGSN_4V~r)^iJg zf>M3fk!hmbd;uT!^iQ29Rp4(RKJ%LB;Wl3B)-xZtI38*IDX_HLEaxDa{}E z^4^brD(rNvE%y0`N}=cVHQ(OcoNVzw`A%{6wB(=PIhjRl-zy(vySVs4rM&u@gX(M= zRriE*cfAPwu%}<}+5=^f{7JLOFB%p1juY%eKGb|!2}&hDC0N#IS+HGTXlDzrw#dGwQ6;jc;8@a&HODv}wO){1dmtfq zk^8}50g;vmw#*Sh-A&JJ&jw~+P^l8xvqJBY-))Hl3s_n89hPSa+H%D;I38G4n|ffy zbdjH@di?ty^09qR--+>{rAAKr8+M;UW4OYB(ifcH@UeS22LDiNFg zd(Zr0N@n1Fv-N;h`q4ni57D47xO-r(nNdUew}0&K9+%$En0?ahr)HIi&1B`)8{{hVK!82=u472{84^F}?`ME{uA73a)6oB0A zSTV6QE8#)AfUTb7(u2Z<20JvXBnw|XI-hdDi|y6x*XMob+x;~*$ZMO*7L_LAl5est zUrbc=Z`Sj3bDz(hb)4tCX0grr3O2uaHa{&k?U{T`T1bfb&WSG?6^fieKd< zQ;zZIOKz)JGnFSHuu(O`K|V5b&QdqavtKkSrm?Y{^_s&N8N%SM@ArpCZe?R*$BVrt z#m~;{arsy<#Vl}H#hj}=30J2#{+pG)x{_qF z==GkpolAG0Wcc%y^~}ZB2W0l>NH z4rz6l&zj%=^J!h|ZnixYb0y~~`l*~rkVsf2&hvidm9BNUQE6$<^aGAD)F!u0=h|#z zF2ZAQ+4%g~6DN*~iHYrN54?T1_9B14fqnL$tR)qg=NlaGIlsrlVVOF&^OwsOX%)|Y zPV8V#YM2@4aKw6zSmZs8l*;M}Pxs!8cCr8Z`tC`8BL}uc#s_@#t@NY5E1j-hp>M_& z7jO1sE|1Cq23LK?NmFE)4*pK6to+%#w?Ly}ug{0cJSqnnT=h9OG1-}@tEZRgvv9@f z3;$7J_B3+1=sjse1K;sId#VFV&nF!h+0!uRK-SxYhDFQo_e<=Vu_5Q?rk71qnwH;> zcUduqv1?utJ7ZjUc=*Z%OCG%ZE-EN>fWg&&@8mq;77?4TbxIDw5({3u{3^0*YdqsF zo_$+=*7tXu31Hh`bMa}!#>ITSITyCxHMj~Cm3Ay4c5*U5CJON)G6+by9Sh1z2={eg( zoo1dTrx;xIL)jkBpFeS8;e^x9N1u1PPhh++@!(R>y@1{~>;C@u`1t3WOI3&Uy;Yg} zBodZA@7U(zcWYzi=V#m^dt6pLGE6z(&ZbfIZgMYUcW#gt>-pNeNF_;+nT%a=r$oMK zGsNCnyQ#V9dcW8|XSOc}4i}4$iwo?&e7sM#+SP0EgPn&py%m|~fy7&{#b3R8b*q=B zh)wv96vdPS)@&M8D+_O5y!g>4pL5Q%OQ%`vPc{^>S){5~vM;o*Ub1LWlG3?1Q#Q|h zsCr)UyaID0D1i#TwLctbo1~r|{6VJh#N-nW20Q^@gr3XZyu0$*vu9Up&o6lJHMRNv z$p%J{c-f_{S+iz+uI*n26;e@a4tD`7u=@tnY)|e%MPIv@mwX<+zuY zmHp#gwrI}IFC2ZB;!bh=S7&ZBJaF;$Kfc3zcmF?f;!XI5?YsZ$%WT;(h5w&FTTgPs z%zMlAoWr-V-n<+1MpB`yNM!ex`9(+bQw~J1X;jVM!PoTNAvE;rzKFh*>1JZacl_CS zQWVbIjqbQxygF>Hmh_q2GauNJ+xJgoJS@Rcxa|A0mBGu!ju(f!?P2}_%9Uw`8|wf6 z+tw+pe(l+_XZPC7OGRh2+Es3mSdw8;`|HbFY4f~48uxCB?5W`SSZ*(Taqjt z9Uc8XVt?J=g)Vno4tlq!$~m*~q%7!vaktCoy%e*rgvh22S+|t^k+HFRvoA3J{^N1* zwKLoPNsPB81TJQ0W>#)nupoiU<$YE3o5^`O)z#H6XPIUTiCJ%)+m!Cja)HlCpt(_4 z-LK@@_3QTWAt5G4wzhw}4f%}I%#C*ceSUtve&qJNyVfV0mOW5CEzz&eoMv=kZ}IbU zyAB;X#FkQ3-=urm#aN+izfIAT6Y)0x|9n=T^WeFSjry98GDZmo%-mu+Kb*?SzUeDg zna@aKYk9}C?fv748&8E87$5d-wVmh9#*>op{oP%4gWS|yKR-V+mnUKz^Rr|bj^&E$ z#q5x77S>fOtHkOanIBu6fZun`DdtPo)@n#%hEdH>lXcA__o=UkGrp~4(~ouYN4xt^YcIHckBP0I`RDF R7X}6f22WQ%mvv4FO#nljU3&lk literal 0 HcmV?d00001 diff --git a/docs/v0.4.1/index.html b/docs/v0.4.1/index.html new file mode 100644 index 0000000..d90dffd --- /dev/null +++ b/docs/v0.4.1/index.html @@ -0,0 +1,132 @@ + + + + + + API Document + + + + + + + + +
+ Home + Identifier + Source + + + +
+ + + +

JSON API Store Build Status

+

JSON API Store takes JSON API data and creates plain +JavaScript objects for the resources it describes. It will link-up +relationships automatically and update both sides of reciprocal relationships +when either side is modified.

+

Usage

+

At the moment you need to do your own AJAX requests, but there are plans to add +AJAX methods to create, read, update and destroy resources in the future. For +now you can just push the responses from your own requests to the store:

+

+// Create a new store instance.
+var store = new Store();
+
+// Define the "categories" type.
+store.define([ "categories", "category" ], {
+  title: Store.attr(),
+  products: Store.hasMany()
+});
+
+// Define the "products" type.
+store.define([ "products", "product" ], {
+  title: Store.attr(),
+  category: Store.hasOne()
+});
+
+// Add data - this can just be the response from a GET request to your API.
+store.push({
+  "data": {
+    "type": "products",
+    "id": "1",
+    "attributes": {
+      "title": "Example Book"
+    },
+    "relationships": {
+      "category": {
+        "data": {
+          "type": "categories",
+          "id": "1"
+        }
+      }
+    }
+  },
+  "included": [
+    {
+      "type": "categories",
+      "id": "1",
+      "attributes": {
+        "title": "Books"
+      }
+    }
+  ]
+});
+
+store.find("products", "1").title; // "Example Book"
+store.find("categories", "1").title; // "Books"
+
+store.find("products", "1").category === store.find("categories", "1"); // true
+store.find("categories", "1").products[0] === store.find("products", "1"); // true
+
+

Installing

+

NPM

+
npm i json-api-store
+

Bower

+
bower i json-api-store
+

Manually

+

Grab the store.js file.

+

Documentation

+

Documentation is available in the docs directory. Online documentation is coming soon.

+
+
+ + + + + + + + + + + + diff --git a/docs/v0.4.1/script/inherited-summary.js b/docs/v0.4.1/script/inherited-summary.js new file mode 100644 index 0000000..0a35b6d --- /dev/null +++ b/docs/v0.4.1/script/inherited-summary.js @@ -0,0 +1,28 @@ +(function(){ + function toggle(ev) { + var button = ev.target; + var parent = ev.target.parentElement; + while(parent) { + if (parent.tagName === 'TABLE' && parent.classList.contains('summary')) break; + parent = parent.parentElement; + } + + if (!parent) return; + + var tbody = parent.querySelector('tbody'); + if (button.classList.contains('opened')) { + button.classList.remove('opened'); + button.classList.add('closed'); + tbody.style.display = 'none'; + } else { + button.classList.remove('closed'); + button.classList.add('opened'); + tbody.style.display = 'block'; + } + } + + var buttons = document.querySelectorAll('.inherited-summary thead .toggle'); + for (var i = 0; i < buttons.length; i++) { + buttons[i].addEventListener('click', toggle); + } +})(); diff --git a/docs/v0.4.1/script/inner-link.js b/docs/v0.4.1/script/inner-link.js new file mode 100644 index 0000000..7762cb2 --- /dev/null +++ b/docs/v0.4.1/script/inner-link.js @@ -0,0 +1,18 @@ +// inner link(#foo) can not correctly scroll, because page has fixed header, +// so, I manually scroll. +(function(){ + function adjust() { + window.scrollBy(0, -55); + var el = document.querySelector('.inner-link-active'); + if (el) el.classList.remove('inner-link-active'); + + var el = document.querySelector(location.hash); + if (el) el.classList.add('inner-link-active'); + } + + window.addEventListener('hashchange', adjust); + + if (location.hash) { + setTimeout(adjust, 0); + } +})(); diff --git a/docs/v0.4.1/script/patch-for-local.js b/docs/v0.4.1/script/patch-for-local.js new file mode 100644 index 0000000..5756d13 --- /dev/null +++ b/docs/v0.4.1/script/patch-for-local.js @@ -0,0 +1,8 @@ +(function(){ + if (location.protocol === 'file:') { + var elms = document.querySelectorAll('a[href="./"]'); + for (var i = 0; i < elms.length; i++) { + elms[i].href = './index.html'; + } + } +})(); diff --git a/docs/v0.4.1/script/prettify/Apache-License-2.0.txt b/docs/v0.4.1/script/prettify/Apache-License-2.0.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/v0.4.1/script/prettify/Apache-License-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/v0.4.1/script/prettify/prettify.js b/docs/v0.4.1/script/prettify/prettify.js new file mode 100644 index 0000000..eef5ad7 --- /dev/null +++ b/docs/v0.4.1/script/prettify/prettify.js @@ -0,0 +1,28 @@ +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), +l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p' + pair[2] + ''); + } + } + + var innerHTML = ''; + for (kind in html) { + var list = html[kind]; + if (!list.length) continue; + innerHTML += '
  • ' + kind + '
  • \n' + list.join('\n'); + } + result.innerHTML = innerHTML; + if (innerHTML) result.style.display = 'block'; + selectedIndex = -1; + }); + + // down, up and enter key are pressed, select search result. + input.addEventListener('keydown', function(ev){ + if (ev.keyCode === 40) { + // arrow down + var current = result.children[selectedIndex]; + var selected = result.children[selectedIndex + 1]; + if (selected && selected.classList.contains('search-separator')) { + var selected = result.children[selectedIndex + 2]; + selectedIndex++; + } + + if (selected) { + if (current) current.classList.remove('selected'); + selectedIndex++; + selected.classList.add('selected'); + } + } else if (ev.keyCode === 38) { + // arrow up + var current = result.children[selectedIndex]; + var selected = result.children[selectedIndex - 1]; + if (selected && selected.classList.contains('search-separator')) { + var selected = result.children[selectedIndex - 2]; + selectedIndex--; + } + + if (selected) { + if (current) current.classList.remove('selected'); + selectedIndex--; + selected.classList.add('selected'); + } + } else if (ev.keyCode === 13) { + // enter + var current = result.children[selectedIndex]; + if (current) { + var link = current.querySelector('a'); + if (link) location.href = link.href; + } + } else { + return; + } + + ev.preventDefault(); + }); + + // select search result when search result is mouse over. + result.addEventListener('mousemove', function(ev){ + var current = result.children[selectedIndex]; + if (current) current.classList.remove('selected'); + + var li = ev.target; + while (li) { + if (li.nodeName === 'LI') break; + li = li.parentElement; + } + + if (li) { + selectedIndex = Array.prototype.indexOf.call(result.children, li); + li.classList.add('selected'); + } + }); + + // clear search result when body is clicked. + document.body.addEventListener('click', function(ev){ + selectedIndex = -1; + result.style.display = 'none'; + result.innerHTML = ''; + }); + +})(); diff --git a/docs/v0.4.1/script/search_index.js b/docs/v0.4.1/script/search_index.js new file mode 100644 index 0000000..62f4ee4 --- /dev/null +++ b/docs/v0.4.1/script/search_index.js @@ -0,0 +1,404 @@ +window.esdocSearchIndex = [ + [ + "json-api-store/src/store.js~store", + "class/src/store.js~Store.html", + "Store json-api-store/src/store.js", + "class" + ], + [ + "builtinexternal/ecmascriptexternal.js~array", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Array", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~arraybuffer", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~ArrayBuffer", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~boolean", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Boolean", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~dataview", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~DataView", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~date", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Date", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~error", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Error", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~evalerror", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~EvalError", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~float32array", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Float32Array", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~float64array", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Float64Array", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~function", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Function", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~generator", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Generator", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~generatorfunction", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~GeneratorFunction", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~infinity", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Infinity", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~int16array", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Int16Array", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~int32array", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Int32Array", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~int8array", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Int8Array", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~internalerror", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~InternalError", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~json", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~JSON", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~map", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Map", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~nan", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~NaN", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~number", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Number", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~object", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Object", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~promise", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Promise", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~proxy", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Proxy", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~rangeerror", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~RangeError", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~referenceerror", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~ReferenceError", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~reflect", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Reflect", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~regexp", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~RegExp", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~set", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Set", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~string", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~String", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~symbol", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Symbol", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~syntaxerror", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~SyntaxError", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~typeerror", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~TypeError", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~urierror", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~URIError", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~uint16array", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Uint16Array", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~uint32array", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Uint32Array", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~uint8array", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Uint8Array", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~uint8clampedarray", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~Uint8ClampedArray", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~weakmap", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~WeakMap", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~weakset", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~WeakSet", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~boolean", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~boolean", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~function", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~function", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~null", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~null", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~number", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~number", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~object", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~object", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~string", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~string", + "external" + ], + [ + "builtinexternal/ecmascriptexternal.js~undefined", + "external/index.html", + "BuiltinExternal/ECMAScriptExternal.js~undefined", + "external" + ], + [ + "builtinexternal/webapiexternal.js~canvasrenderingcontext2d", + "external/index.html", + "BuiltinExternal/WebAPIExternal.js~CanvasRenderingContext2D", + "external" + ], + [ + "builtinexternal/webapiexternal.js~documentfragment", + "external/index.html", + "BuiltinExternal/WebAPIExternal.js~DocumentFragment", + "external" + ], + [ + "builtinexternal/webapiexternal.js~element", + "external/index.html", + "BuiltinExternal/WebAPIExternal.js~Element", + "external" + ], + [ + "builtinexternal/webapiexternal.js~event", + "external/index.html", + "BuiltinExternal/WebAPIExternal.js~Event", + "external" + ], + [ + "builtinexternal/webapiexternal.js~node", + "external/index.html", + "BuiltinExternal/WebAPIExternal.js~Node", + "external" + ], + [ + "builtinexternal/webapiexternal.js~nodelist", + "external/index.html", + "BuiltinExternal/WebAPIExternal.js~NodeList", + "external" + ], + [ + "builtinexternal/webapiexternal.js~xmlhttprequest", + "external/index.html", + "BuiltinExternal/WebAPIExternal.js~XMLHttpRequest", + "external" + ], + [ + "src/store.js", + "file/src/store.js.html", + "src/store.js", + "file" + ], + [ + "src/store.js~store#add", + "class/src/store.js~Store.html#instance-method-add", + "src/store.js~Store#add", + "method" + ], + [ + "src/store.js~store#constructor", + "class/src/store.js~Store.html#instance-constructor-constructor", + "src/store.js~Store#constructor", + "method" + ], + [ + "src/store.js~store#define", + "class/src/store.js~Store.html#instance-method-define", + "src/store.js~Store#define", + "method" + ], + [ + "src/store.js~store#find", + "class/src/store.js~Store.html#instance-method-find", + "src/store.js~Store#find", + "method" + ], + [ + "src/store.js~store#off", + "class/src/store.js~Store.html#instance-method-off", + "src/store.js~Store#off", + "method" + ], + [ + "src/store.js~store#on", + "class/src/store.js~Store.html#instance-method-on", + "src/store.js~Store#on", + "method" + ], + [ + "src/store.js~store#push", + "class/src/store.js~Store.html#instance-method-push", + "src/store.js~Store#push", + "method" + ], + [ + "src/store.js~store#remove", + "class/src/store.js~Store.html#instance-method-remove", + "src/store.js~Store#remove", + "method" + ], + [ + "src/store.js~store.attr", + "class/src/store.js~Store.html#static-method-attr", + "src/store.js~Store.attr", + "method" + ], + [ + "src/store.js~store.hasmany", + "class/src/store.js~Store.html#static-method-hasMany", + "src/store.js~Store.hasMany", + "method" + ], + [ + "src/store.js~store.hasone", + "class/src/store.js~Store.html#static-method-hasOne", + "src/store.js~Store.hasOne", + "method" + ] +] \ No newline at end of file diff --git a/docs/v0.4.1/script/test-summary.js b/docs/v0.4.1/script/test-summary.js new file mode 100644 index 0000000..2f32cb0 --- /dev/null +++ b/docs/v0.4.1/script/test-summary.js @@ -0,0 +1,54 @@ +(function(){ + function toggle(ev) { + var button = ev.target; + var parent = ev.target.parentElement; + while(parent) { + if (parent.tagName === 'TR' && parent.classList.contains('test-describe')) break; + parent = parent.parentElement; + } + + if (!parent) return; + + var direction; + if (button.classList.contains('opened')) { + button.classList.remove('opened'); + button.classList.add('closed'); + direction = 'closed'; + } else { + button.classList.remove('closed'); + button.classList.add('opened'); + direction = 'opened'; + } + + var targetDepth = parseInt(parent.dataset.testDepth, 10) + 1; + var nextElement = parent.nextElementSibling; + while (nextElement) { + var depth = parseInt(nextElement.dataset.testDepth, 10); + if (depth >= targetDepth) { + if (direction === 'opened') { + if (depth === targetDepth) nextElement.style.display = ''; + } else if (direction === 'closed') { + nextElement.style.display = 'none'; + var innerButton = nextElement.querySelector('.toggle'); + if (innerButton && innerButton.classList.contains('opened')) { + innerButton.classList.remove('opened'); + innerButton.classList.add('closed'); + } + } + } else { + break; + } + nextElement = nextElement.nextElementSibling; + } + } + + var buttons = document.querySelectorAll('.test-summary tr.test-describe .toggle'); + for (var i = 0; i < buttons.length; i++) { + buttons[i].addEventListener('click', toggle); + } + + var topDescribes = document.querySelectorAll('.test-summary tr[data-test-depth="0"]'); + for (var i = 0; i < topDescribes.length; i++) { + topDescribes[i].style.display = ''; + } +})(); diff --git a/docs/v0.4.1/source.html b/docs/v0.4.1/source.html new file mode 100644 index 0000000..47ed750 --- /dev/null +++ b/docs/v0.4.1/source.html @@ -0,0 +1,88 @@ + + + + + + Source | API Document + + + + + + + + +
    + Home + Identifier + Source + + + +
    + + + +

    Source 10/12

    + + + + + + + + + + + + + + + + + + + + + + + +
    FileIdentifierDocumentSizeLinesUpdated
    src/store.jsStore83 %10/1216462 byte4362015-08-04 06:18:22 (UTC)
    +
    + + + + + + + + + + + + diff --git a/index.html b/index.html index cf8ee65..60c809a 100644 --- a/index.html +++ b/index.html @@ -176,14 +176,14 @@
    npm i json-api-store