diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a64dbe..8b3f03f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +##### 0.9.0 - xx May 2014 + +###### Backwards compatible API changes +- #30, #48 - DSCacheFactory integration + ##### 0.8.1 - 02 May 2014 ###### Backwards compatible Bug fixes diff --git a/bower.json b/bower.json index a143417..a3b2023 100644 --- a/bower.json +++ b/bower.json @@ -2,8 +2,8 @@ "author": "Jason Dobry", "name": "angular-data", "description": "Data store for Angular.js.", - "version": "0.8.1", - "homepage": "http://jmdobry.github.io/angular-data/", + "version": "0.9.0-SNAPSHOT", + "homepage": "http://angular-data.codetrain.io/", "repository": { "type": "git", "url": "git://github.com/jmdobry/angular-data.git" @@ -30,8 +30,5 @@ "angular-mocks": "~1.2.16", "angular-cache": "~3.0.0-beta.4", "observe-js": "~0.2.0" - }, - "resolutions": { - "angular": "~1.2.16" } } diff --git a/dist/angular-data.js b/dist/angular-data.js index b264339..0c92f4c 100644 --- a/dist/angular-data.js +++ b/dist/angular-data.js @@ -1,7 +1,7 @@ /** * @author Jason Dobry * @file angular-data.js - * @version 0.8.1 - Homepage + * @version 0.9.0-SNAPSHOT - Homepage * @copyright (c) 2014 Jason Dobry * @license MIT * @@ -588,16 +588,22 @@ var filter = require('./filter'); * Create slice of source array or array-like object */ function slice(arr, start, end){ + var len = arr.length; + if (start == null) { start = 0; } else if (start < 0) { - start = Math.max(arr.length + start, 0); + start = Math.max(len + start, 0); + } else { + start = Math.min(start, len); } if (end == null) { - end = arr.length; + end = len; } else if (end < 0) { - end = Math.max(arr.length + end, 0); + end = Math.max(len + end, 0); + } else { + end = Math.min(end, len); } var result = []; @@ -1717,14 +1723,15 @@ function destroy(resourceName, id, options) { deferred.reject(new this.errors.RuntimeError(errorPrefix + resourceName + ' is not a registered resource!')); } else if (!this.utils.isString(id) && !this.utils.isNumber(id)) { deferred.reject(new this.errors.IllegalArgumentError(errorPrefix + 'id: Must be a string or a number!', { id: { actual: typeof id, expected: 'string|number' } })); - } else if (!(id in this.store[resourceName].index)) { - deferred.reject(new this.errors.RuntimeError(errorPrefix + 'id: "' + id + '" not found!')); } else { - var definition = this.definitions[resourceName], - resource = this.store[resourceName], - _this = this; + var item = this.get(resourceName, id); + if (!item) { + deferred.reject(new this.errors.RuntimeError(errorPrefix + 'id: "' + id + '" not found!')); + } else { + var definition = this.definitions[resourceName], + resource = this.store[resourceName], + _this = this; - if (id in resource.index) { promise = promise .then(function (attrs) { return _this.$q.promisify(definition.beforeDestroy)(resourceName, attrs); @@ -1733,15 +1740,13 @@ function destroy(resourceName, id, options) { return _this.adapters[options.adapter || definition.defaultAdapter].destroy(definition, id, options); }) .then(function () { - return _this.$q.promisify(definition.afterDestroy)(resourceName, resource.index[id]); + return _this.$q.promisify(definition.afterDestroy)(resourceName, item); }) .then(function () { _this.eject(resourceName, id); return id; }); - deferred.resolve(resource.index[id]); - } else { - deferred.resolve(); + deferred.resolve(item); } } @@ -1964,12 +1969,7 @@ function processResults(utils, data, resourceName, queryHash) { resource.completedQueries[queryHash] = new Date().getTime(); // Merge the new values into the cache - for (var i = 0; i < data.length; i++) { - this.inject(resourceName, data[i]); - } - - // Update the data store's index for this resource - resource.index = utils.toLookup(resource.collection, this.definitions[resourceName].idAttribute); + this.inject(resourceName, data); // Update modified timestamp of collection resource.collectionModified = utils.updateTimestamp(resource.collectionModified); @@ -2252,7 +2252,7 @@ function refresh(resourceName, id, options) { } else { options.bypassCache = true; - if (id in this.store[resourceName].index) { + if (this.get(resourceName, id)) { return this.find(resourceName, id, options); } else { return false; @@ -2319,61 +2319,63 @@ function save(resourceName, id, options) { deferred.reject(new this.errors.IllegalArgumentError(errorPrefix + 'id: Must be a string or a number!', { id: { actual: typeof id, expected: 'string|number' } })); } else if (!this.utils.isObject(options)) { deferred.reject(new this.errors.IllegalArgumentError(errorPrefix + 'options: Must be an object!', { options: { actual: typeof options, expected: 'object' } })); - } else if (!(id in this.store[resourceName].index)) { - deferred.reject(new this.errors.RuntimeError(errorPrefix + 'id: "' + id + '" not found!')); } else { - var definition = this.definitions[resourceName], - resource = this.store[resourceName], - _this = this; + var item = this.get(resourceName, id); + if (!item) { + deferred.reject(new this.errors.RuntimeError(errorPrefix + 'id: "' + id + '" not found!')); + } else { + var definition = this.definitions[resourceName], + resource = this.store[resourceName], + _this = this; - promise = promise - .then(function (attrs) { - return _this.$q.promisify(definition.beforeValidate)(resourceName, attrs); - }) - .then(function (attrs) { - return _this.$q.promisify(definition.validate)(resourceName, attrs); - }) - .then(function (attrs) { - return _this.$q.promisify(definition.afterValidate)(resourceName, attrs); - }) - .then(function (attrs) { - return _this.$q.promisify(definition.beforeUpdate)(resourceName, attrs); - }) - .then(function (attrs) { - if (options.changesOnly) { - resource.observers[id].deliver(); - var toKeep = [], - changes = _this.changes(resourceName, id); - - for (var key in changes.added) { - toKeep.push(key); - } - for (key in changes.changed) { - toKeep.push(key); - } - changes = _this.utils.pick(attrs, toKeep); - if (_this.utils.isEmpty(changes)) { - // no changes, return - return attrs; - } else { - attrs = changes; + promise = promise + .then(function (attrs) { + return _this.$q.promisify(definition.beforeValidate)(resourceName, attrs); + }) + .then(function (attrs) { + return _this.$q.promisify(definition.validate)(resourceName, attrs); + }) + .then(function (attrs) { + return _this.$q.promisify(definition.afterValidate)(resourceName, attrs); + }) + .then(function (attrs) { + return _this.$q.promisify(definition.beforeUpdate)(resourceName, attrs); + }) + .then(function (attrs) { + if (options.changesOnly) { + resource.observers[id].deliver(); + var toKeep = [], + changes = _this.changes(resourceName, id); + + for (var key in changes.added) { + toKeep.push(key); + } + for (key in changes.changed) { + toKeep.push(key); + } + changes = _this.utils.pick(attrs, toKeep); + if (_this.utils.isEmpty(changes)) { + // no changes, return + return attrs; + } else { + attrs = changes; + } } - } - return _this.adapters[options.adapter || definition.defaultAdapter].update(definition, id, attrs, options); - }) - .then(function (data) { - return _this.$q.promisify(definition.afterUpdate)(resourceName, data); - }) - .then(function (data) { - _this.inject(definition.name, data, options); - resource.previousAttributes[id] = _this.utils.deepMixIn({}, data); - resource.saved[id] = _this.utils.updateTimestamp(resource.saved[id]); - return _this.get(resourceName, id); - }); + return _this.adapters[options.adapter || definition.defaultAdapter].update(definition, id, attrs, options); + }) + .then(function (data) { + return _this.$q.promisify(definition.afterUpdate)(resourceName, data); + }) + .then(function (data) { + _this.inject(definition.name, data, options); + resource.previousAttributes[id] = _this.utils.deepMixIn({}, data); + resource.saved[id] = _this.utils.updateTimestamp(resource.saved[id]); + return _this.get(resourceName, id); + }); - deferred.resolve(resource.index[id]); + deferred.resolve(item); + } } - return promise; } @@ -2468,11 +2470,21 @@ function DSProvider() { var defaults = this.defaults = new BaseConfig(); this.$get = [ - '$rootScope', '$log', '$q', 'DSHttpAdapter', 'DSUtils', 'DSErrors', - function ($rootScope, $log, $q, DSHttpAdapter, DSUtils, DSErrors) { + '$rootScope', '$log', '$q', 'DSHttpAdapter', 'DSUtils', 'DSErrors', 'DSCacheFactory', + function ($rootScope, $log, $q, DSHttpAdapter, DSUtils, DSErrors, DSCacheFactory) { var syncMethods = require('./sync_methods'), - asyncMethods = require('./async_methods'); + asyncMethods = require('./async_methods'), + cache; + + try { + cache = angular.injector(['angular-data.DSCacheFactory']).get('DSCacheFactory'); + } catch (err) { + $log.warn(err); + $log.warn('DSCacheFactory is unavailable. Resorting to the lesser capabilities of $cacheFactory.'); + cache = angular.injector(['ng']).get('$cacheFactory'); + } + /** * @doc interface @@ -2488,6 +2500,8 @@ function DSProvider() { $log: $log, $q: $q, + cacheFactory: cache, + /** * @doc property * @id DS.properties:defaults @@ -2615,12 +2629,11 @@ function changes(resourceName, id) { throw new this.errors.IllegalArgumentError(errorPrefix + 'id: Must be a string or a number!', { id: { actual: typeof id, expected: 'string|number' } }); } - var resource = this.store[resourceName]; - try { - if (resource.index[id]) { - resource.observers[id].deliver(); - return this.utils.diffObjectFromOldObject(resource.index[id], resource.previousAttributes[id]); + var item = this.get(resourceName, id); + if (item) { + this.store[resourceName].observers[id].deliver(); + return this.utils.diffObjectFromOldObject(item, this.store[resourceName].previousAttributes[id]); } } catch (err) { throw new this.errors.UnhandledError(err); @@ -2714,11 +2727,28 @@ function defineResource(definition) { Resource.prototype = this.defaults; this.definitions[definition.name] = new Resource(this.utils, definition); + var _this = this; + + var cache = this.cacheFactory('DS.' + definition.name, { + maxAge: definition.maxAge || null, + recycleFreq: definition.recycleFreq || 1000, + cacheFlushInterval: definition.cacheFlushInterval || null, + deleteOnExpire: definition.deleteOnExpire || 'none', + onExpire: function (id) { + _this.eject(definition.name, id); + }, + capacity: Number.MAX_VALUE, + storageMode: 'memory', + storageImpl: null, + disabled: false, + storagePrefix: 'DS.' + definition.name + }); + this.store[definition.name] = { collection: [], completedQueries: {}, pendingQueries: {}, - index: {}, + index: cache, modified: {}, saved: {}, previousAttributes: {}, @@ -2791,7 +2821,8 @@ function _eject(definition, resource, id) { resource.collection.splice(i, 1); resource.observers[id].close(); delete resource.observers[id]; - delete resource.index[id]; + + resource.index.remove(id); delete resource.previousAttributes[id]; delete resource.modified[id]; delete resource.saved[id]; @@ -3166,14 +3197,15 @@ function get(resourceName, id, options) { try { // cache miss, request resource from server - if (!(id in this.store[resourceName].index) && options.loadFromServer) { + var item = this.store[resourceName].index.get(id); + if (!item && options.loadFromServer) { this.find(resourceName, id).then(null, function (err) { throw err; }); } // return resource from cache - return this.store[resourceName].index[id]; + return item; } catch (err) { throw new this.errors.UnhandledError(err); } @@ -3232,7 +3264,7 @@ function hasChanges(resourceName, id) { try { // return resource from cache - if (id in this.store[resourceName].index) { + if (this.get(resourceName, id)) { return diffIsEmpty(this.utils, this.changes(resourceName, id)); } else { return false; @@ -3399,24 +3431,31 @@ function _inject(definition, resource, attrs) { if (!(definition.idAttribute in attrs)) { throw new _this.errors.RuntimeError(errorPrefix + 'attrs: Must contain the property specified by `idAttribute`!'); } else { - var id = attrs[definition.idAttribute]; + var id = attrs[definition.idAttribute], + item = this.get(definition.name, id); - if (!(id in resource.index)) { - resource.index[id] = {}; + if (!item) { + item = {}; resource.previousAttributes[id] = {}; - _this.utils.deepMixIn(resource.index[id], attrs); + _this.utils.deepMixIn(item, attrs); _this.utils.deepMixIn(resource.previousAttributes[id], attrs); - resource.collection.push(resource.index[id]); + resource.collection.push(item); - resource.observers[id] = new observe.ObjectObserver(resource.index[id], _react); + resource.observers[id] = new observe.ObjectObserver(item, _react); + resource.index.put(id, item); _react({}, {}, {}, function () { return id; }); } else { - _this.utils.deepMixIn(resource.index[id], attrs); + _this.utils.deepMixIn(item, attrs); + if (typeof resource.index.touch === 'function') { + resource.index.touch(id); + } else { + resource.index.put(id, resource.index.get(id)); + } resource.observers[id].deliver(); } resource.saved[id] = _this.utils.updateTimestamp(resource.saved[id]); @@ -3860,7 +3899,7 @@ module.exports = [function () { * @id angular-data * @name angular-data * @description - * __Version:__ 0.8.1 + * __Version:__ 0.9.0-SNAPSHOT * * ## Install * @@ -3879,7 +3918,7 @@ module.exports = [function () { * Load `dist/angular-data.js` or `dist/angular-data.min.js` onto your web page after Angular.js. * * #### Manual download - * Download angular-data.0.8.1.js from the [Releases](https://github.com/jmdobry/angular-data/releases) + * Download angular-data.0.9.0-SNAPSHOT.js from the [Releases](https://github.com/jmdobry/angular-data/releases) * section of the angular-data GitHub project. * * ## Load into Angular @@ -3896,7 +3935,7 @@ module.exports = [function () { * [DSUtils](/documentation/api/api/DSUtils) has some useful utility methods. * [DSErrors](/documentation/api/api/DSErrors) provides references to the various errors thrown by the data store. */ - angular.module('angular-data.DS', ['ng']) + angular.module('angular-data.DS', ['ng', 'angular-data.DSCacheFactory']) .service('DSUtils', require('./utils')) .service('DSErrors', require('./errors')) .provider('DSHttpAdapter', require('./adapters/http')) diff --git a/dist/angular-data.min.js b/dist/angular-data.min.js index a8a9c01..6258101 100644 --- a/dist/angular-data.min.js +++ b/dist/angular-data.min.js @@ -1,11 +1,11 @@ /** * @author Jason Dobry * @file angular-data.min.js -* @version 0.8.1 - Homepage +* @version 0.9.0-SNAPSHOT - Homepage * @copyright (c) 2014 Jason Dobry * @license MIT * * @overview Data store for Angular.js. */ -require=function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gb&&a.check();)a.report(),b++}function e(a){for(var b in a)return!1;return!0}function f(a){return e(a.added)&&e(a.removed)&&e(a.changed)}function g(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function h(a,b){var c=b||(Array.isArray(a)?[]:{});for(var d in a)c[d]=a[d];return Array.isArray(a)&&(c.length=a.length),c}function i(a,b,c,d){if(this.closed=!1,this.object=a,this.callback=b,this.target=c,this.token=d,this.reporting=!0,n){var e=this;this.boundInternalCallback=function(a){e.internalCallback(a)}}j(this),this.connect(),this.sync(!0)}function j(a){u&&(t.push(a),i._allObserversCount++)}function k(a,b,c,d){i.call(this,a,b,c,d)}function l(a){this.arr=[],this.callback=a,this.isObserved=!0}function m(a,b,c){for(var d={},e={},f=0;fa&&b.anyChanged);i._allObserversCount=t.length,v=!1}}},u&&(a.Platform.clearObservers=function(){t=[]}),k.prototype=r({__proto__:i.prototype,connect:function(){n&&Object.observe(this.object,this.boundInternalCallback)},sync:function(){n||(this.oldObject=h(this.object))},check:function(a){var b,c;if(n){if(!a)return!1;c={},b=m(this.object,a,c)}else c=this.oldObject,b=g(this.object,this.oldObject);return f(b)?!1:(this.reportArgs=[b.added||{},b.removed||{},b.changed||{}],this.reportArgs.push(function(a){return c[a]}),!0)},disconnect:function(){n?this.object&&Object.unobserve(this.object,this.boundInternalCallback):this.oldObject=void 0}});var x=Object.getPrototypeOf({}),y=Object.getPrototypeOf([]);l.prototype={reset:function(){this.isObserved=!this.isObserved},observe:function(a){if(c(a)&&a!==x&&a!==y){var b=this.arr.indexOf(a);b>=0&&this.arr[b+1]===this.isObserved||(0>b&&(b=this.arr.length,this.arr[b]=a,Object.observe(a,this.callback)),this.arr[b+1]=this.isObserved,this.observe(Object.getPrototypeOf(a)))}},cleanup:function(){for(var a=0,b=0,c=this.isObserved;ba&&(this.arr[a]=d,this.arr[a+1]=c),a+=2):Object.unobserve(d,this.callback),b+=2}this.arr.length=a}};var z={"new":!0,updated:!0,deleted:!0};a.Observer=i,a.Observer.hasObjectObserve=n,a.ObjectObserver=k}((c.Number={isNaN:window.isNaN})?c:c)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],observejs:[function(a,b){b.exports=a("QYwGEY")},{}],3:[function(a,b){function c(a,b){return-1!==d(a,b)}var d=a("./indexOf");b.exports=c},{"./indexOf":5}],4:[function(a,b){function c(a,b,c){b=d(b,c);var e=[];if(null==a)return e;for(var f,g=-1,h=a.length;++gc?d+c:c;d>e;){if(a[e]===b)return e;e++}return-1}b.exports=c},{}],6:[function(a,b){function c(a){return null!=a&&""!==a}function d(a,b){return b=b||"",e(a,c).join(b)}var e=a("./filter");b.exports=d},{"./filter":4}],7:[function(a,b){function c(a,b,c){null==b?b=0:0>b&&(b=Math.max(a.length+b,0)),null==c?c=a.length:0>c&&(c=Math.max(a.length+c,0));for(var d=[];c>b;)d.push(a[b++]);return d}b.exports=c},{}],8:[function(a,b){function c(a,b){if(null==a)return[];if(a.length<2)return a;null==b&&(b=d);var f,g,h;return f=~~(a.length/2),g=c(a.slice(0,f),b),h=c(a.slice(f,a.length),b),e(g,h,b)}function d(a,b){return b>a?-1:a>b?1:0}function e(a,b,c){for(var d=[];a.length&&b.length;)d.push(c(a[0],b[0])<=0?a.shift():b.shift());return a.length&&d.push.apply(d,a),b.length&&d.push.apply(d,b),d}b.exports=c},{}],9:[function(a,b){function c(a,b){var c={};if(null==a)return c;var e,f=-1,g=a.length;if(d(b))for(;++f"in a?d=d&&c[b]>a[">"]:">="in a?d=d&&c[b]>=a[">="]:"<"in a?d=d&&c[b]e?-1:e>d?1:0:e>d?-1:d>e?1:0})}}return this.utils.isNumber(b.query.limit)&&this.utils.isNumber(b.query.skip)?i=this.utils.slice(i,b.query.skip,Math.min(i.length,b.query.skip+b.query.limit)):this.utils.isNumber(b.query.limit)?i=this.utils.slice(i,0,Math.min(i.length,b.query.limit)):this.utils.isNumber(b.query.skip)&&(i=b.query.skip=b?a+1:b},deepFreeze:function b(a){if("function"==typeof Object.freeze){var c,d;Object.freeze(a);for(d in a)c=a[d],a.hasOwnProperty(d)&&"object"==typeof c&&!Object.isFrozen(c)&&b(c)}},diffObjectFromOldObject:function(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var h in a)h in b||(c[h]=a[h]);return{added:c,removed:d,changed:e}}}}]},{"mout/array/contains":3,"mout/array/filter":4,"mout/array/slice":7,"mout/array/sort":8,"mout/array/toLookup":9,"mout/lang/isEmpty":14,"mout/object/deepMixIn":21,"mout/object/forOwn":23,"mout/object/pick":25,"mout/string/makePath":26,"mout/string/upperCase":27}]},{},[53]); \ No newline at end of file +require=function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gb&&a.check();)a.report(),b++}function e(a){for(var b in a)return!1;return!0}function f(a){return e(a.added)&&e(a.removed)&&e(a.changed)}function g(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function h(a,b){var c=b||(Array.isArray(a)?[]:{});for(var d in a)c[d]=a[d];return Array.isArray(a)&&(c.length=a.length),c}function i(a,b,c,d){if(this.closed=!1,this.object=a,this.callback=b,this.target=c,this.token=d,this.reporting=!0,n){var e=this;this.boundInternalCallback=function(a){e.internalCallback(a)}}j(this),this.connect(),this.sync(!0)}function j(a){u&&(t.push(a),i._allObserversCount++)}function k(a,b,c,d){i.call(this,a,b,c,d)}function l(a){this.arr=[],this.callback=a,this.isObserved=!0}function m(a,b,c){for(var d={},e={},f=0;fa&&b.anyChanged);i._allObserversCount=t.length,v=!1}}},u&&(a.Platform.clearObservers=function(){t=[]}),k.prototype=r({__proto__:i.prototype,connect:function(){n&&Object.observe(this.object,this.boundInternalCallback)},sync:function(){n||(this.oldObject=h(this.object))},check:function(a){var b,c;if(n){if(!a)return!1;c={},b=m(this.object,a,c)}else c=this.oldObject,b=g(this.object,this.oldObject);return f(b)?!1:(this.reportArgs=[b.added||{},b.removed||{},b.changed||{}],this.reportArgs.push(function(a){return c[a]}),!0)},disconnect:function(){n?this.object&&Object.unobserve(this.object,this.boundInternalCallback):this.oldObject=void 0}});var x=Object.getPrototypeOf({}),y=Object.getPrototypeOf([]);l.prototype={reset:function(){this.isObserved=!this.isObserved},observe:function(a){if(c(a)&&a!==x&&a!==y){var b=this.arr.indexOf(a);b>=0&&this.arr[b+1]===this.isObserved||(0>b&&(b=this.arr.length,this.arr[b]=a,Object.observe(a,this.callback)),this.arr[b+1]=this.isObserved,this.observe(Object.getPrototypeOf(a)))}},cleanup:function(){for(var a=0,b=0,c=this.isObserved;ba&&(this.arr[a]=d,this.arr[a+1]=c),a+=2):Object.unobserve(d,this.callback),b+=2}this.arr.length=a}};var z={"new":!0,updated:!0,deleted:!0};a.Observer=i,a.Observer.hasObjectObserve=n,a.ObjectObserver=k}((c.Number={isNaN:window.isNaN})?c:c)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],observejs:[function(a,b){b.exports=a("QYwGEY")},{}],3:[function(a,b){function c(a,b){return-1!==d(a,b)}var d=a("./indexOf");b.exports=c},{"./indexOf":5}],4:[function(a,b){function c(a,b,c){b=d(b,c);var e=[];if(null==a)return e;for(var f,g=-1,h=a.length;++gc?d+c:c;d>e;){if(a[e]===b)return e;e++}return-1}b.exports=c},{}],6:[function(a,b){function c(a){return null!=a&&""!==a}function d(a,b){return b=b||"",e(a,c).join(b)}var e=a("./filter");b.exports=d},{"./filter":4}],7:[function(a,b){function c(a,b,c){var d=a.length;b=null==b?0:0>b?Math.max(d+b,0):Math.min(b,d),c=null==c?d:0>c?Math.max(d+c,0):Math.min(c,d);for(var e=[];c>b;)e.push(a[b++]);return e}b.exports=c},{}],8:[function(a,b){function c(a,b){if(null==a)return[];if(a.length<2)return a;null==b&&(b=d);var f,g,h;return f=~~(a.length/2),g=c(a.slice(0,f),b),h=c(a.slice(f,a.length),b),e(g,h,b)}function d(a,b){return b>a?-1:a>b?1:0}function e(a,b,c){for(var d=[];a.length&&b.length;)d.push(c(a[0],b[0])<=0?a.shift():b.shift());return a.length&&d.push.apply(d,a),b.length&&d.push.apply(d,b),d}b.exports=c},{}],9:[function(a,b){function c(a,b){var c={};if(null==a)return c;var e,f=-1,g=a.length;if(d(b))for(;++f"in a?d=d&&c[b]>a[">"]:">="in a?d=d&&c[b]>=a[">="]:"<"in a?d=d&&c[b]e?-1:e>d?1:0:e>d?-1:d>e?1:0})}}return this.utils.isNumber(b.query.limit)&&this.utils.isNumber(b.query.skip)?i=this.utils.slice(i,b.query.skip,Math.min(i.length,b.query.skip+b.query.limit)):this.utils.isNumber(b.query.limit)?i=this.utils.slice(i,0,Math.min(i.length,b.query.limit)):this.utils.isNumber(b.query.skip)&&(i=b.query.skip=b?a+1:b},deepFreeze:function b(a){if("function"==typeof Object.freeze){var c,d;Object.freeze(a);for(d in a)c=a[d],a.hasOwnProperty(d)&&"object"==typeof c&&!Object.isFrozen(c)&&b(c)}},diffObjectFromOldObject:function(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var h in a)h in b||(c[h]=a[h]);return{added:c,removed:d,changed:e}}}}]},{"mout/array/contains":3,"mout/array/filter":4,"mout/array/slice":7,"mout/array/sort":8,"mout/array/toLookup":9,"mout/lang/isEmpty":14,"mout/object/deepMixIn":21,"mout/object/forOwn":23,"mout/object/pick":25,"mout/string/makePath":26,"mout/string/upperCase":27}]},{},[53]); \ No newline at end of file diff --git a/guide/nav.html b/guide/nav.html index 628d943..1a7f2a8 100644 --- a/guide/nav.html +++ b/guide/nav.html @@ -58,7 +58,7 @@ API