From a7db943282c97dcc5a618c0bfe82a8de1948a694 Mon Sep 17 00:00:00 2001 From: crissdev Date: Sun, 28 Feb 2016 14:29:49 +0200 Subject: [PATCH] 2.6.0 --- HISTORY.md | 37 ++++++++++++++++++++------------ README.md | 2 +- bower.json | 2 +- dist/knockout.mapping.js | 5 +++-- dist/knockout.mapping.min.js | 6 +++--- dist/knockout.mapping.min.js.map | 2 +- package.json | 2 +- 7 files changed, 33 insertions(+), 23 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 2ceffc5..3a62e5d 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,14 +1,22 @@ +## 2.6.0 (2016-02-28) + +* Issue [#124](https://github.com/SteveSanderson/knockout.mapping/issues/124): Use hasOwnProperty to check for bucket existence +* Small performance improvements [e6c5631](https://github.com/crissdev/knockout.mapping/commit/e6c56313d22375e0e1ac7242f18dce9811577ad2), [f97d5cd](https://github.com/crissdev/knockout.mapping/commit/f97d5cde145962af919a6472d22418f9f0f43626), [57a0b56](https://github.com/crissdev/knockout.mapping/commit/57a0b56c6368bb3b8816fb0d78c35820aa719bf3) +* Issue [#96](https://github.com/SteveSanderson/knockout.mapping/issues/96): Fix incorrect handling of properties with periods +* Issue [#205](https://github.com/SteveSanderson/knockout.mapping/issues/205): Allow JSON.stringify parameters to be specified to ko.mapping.toJSON +* Issue [#9](https://github.com/crissdev/knockout.mapping/issues/9): Fix pure computeds are treated the same as deferred, not auto-evaluated after mapping + ## 2.5.0 (2015-02-12) * Remove deprecated methods (`updateFromJS` and `updateFromJSON`) -* Issue #1: Compatibility with Knockout 3.x may still be a problem -* Issue #4: Library is not exported in ko namespace for CommonJS/Node +* Issue [#1](https://github.com/crissdev/knockout.mapping/issues/1): Compatibility with Knockout 3.x may still be a problem +* Issue [#4](https://github.com/crissdev/knockout.mapping/issues/4): Library is not exported in ko namespace for CommonJS/Node ## 2.4.1 (2013-02-08) * Added mappedGet for observable arrays -* Issue #134: Throttle issue using mapping -* Issue #135: Why is custom update for observableArray firing twice when using mapping plugin? +* Issue [#134](https://github.com/SteveSanderson/knockout.mapping/issues/134): Throttle issue using mapping +* Issue [#135](https://github.com/SteveSanderson/knockout.mapping/issues/135): Why is custom update for observableArray firing twice when using mapping plugin? ## 2.4.0 (2013-02-04) @@ -17,29 +25,30 @@ ## 2.3.5 (2012-12-10) -* Issue #121: Added functionality so that explicit declared none observable members on a ViewModel will remain none observable after mapping +* Issue [#121](https://github.com/SteveSanderson/knockout.mapping/issues/121): Added functionality so that explicit declared none observable members on a ViewModel will remain none observable after mapping ## 2.3.4 (2012-11-22) -* Issue #114: Added new "observe" array to options +* Issue [#114](https://github.com/SteveSanderson/knockout.mapping/issues/114): Added new "observe" array to options ## 2.3.3 (2012-10-30) -* Fixed issue #105, #111: Update callback is not being called -* Fixed issue #107: String values in mapping cause infinite recursion in extendObject +* Fixed issue [#105](https://github.com/SteveSanderson/knockout.mapping/issues/105), [#111](https://github.com/SteveSanderson/knockout.mapping/issues/111): Update callback is not being called +* Fixed issue [#107](https://github.com/SteveSanderson/knockout.mapping/issues/107): String values in mapping cause infinite recursion in extendObject ## 2.3.2 (2012-08-20) -* Fixed issue #86: Don't update properties on object with update callback +* Fixed issue [#86](https://github.com/SteveSanderson/knockout.mapping/issues/86): Don't update properties on object with update callback ## 2.3.1 (2012-08-06) -* Fixed issue #33: Create method in mappings receive meaningless options.parent for observableArray properties -* Fixed issue #99: Updating throttled observable -* Fixed issue #100: private variable leaks onto window object +* Fixed issue [#33](https://github.com/SteveSanderson/knockout.mapping/issues/33): Create method in mappings receive meaningless options.parent for observableArray properties +* Fixed issue [#99](https://github.com/SteveSanderson/knockout.mapping/issues/99): Updating throttled observable +* Fixed issue [#100](https://github.com/SteveSanderson/knockout.mapping/issues/100): private variable leaks onto window object ## 2.3.0 (2012-07-31) * Added support for not mapping certain array elements (return "options.skip" from your create callback) -* Fixed issue #91: "wrap" function makes computed writable -* Fixed issue #94: Bug/problem with ignore argument in mapping.fromJS +* Fixed issue [#91](https://github.com/SteveSanderson/knockout.mapping/issues/91): "wrap" function makes computed writable +* Fixed issue [#94](https://github.com/SteveSanderson/knockout.mapping/issues/94): Bug/problem with ignore argument in mapping.fromJS + diff --git a/README.md b/README.md index 74652fe..64ba31c 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ var newData = ko.mapping.toJS(viewModel); ``` -Run this example in [JSFiddle](http://jsfiddle.net/wmeqx7ss/). +Run this example in [JSFiddle](http://jsfiddle.net/wmeqx7ss/141/). ## Test diff --git a/bower.json b/bower.json index cadaba9..644929c 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "bower-knockout-mapping", "main": "dist/knockout.mapping.js", - "version": "2.5.0", + "version": "2.6.0", "homepage": "https://github.com/crissdev/knockout.mapping", "authors": [ "Steven Sanderson", diff --git a/dist/knockout.mapping.js b/dist/knockout.mapping.js index c0bbf8b..91a075c 100644 --- a/dist/knockout.mapping.js +++ b/dist/knockout.mapping.js @@ -1,5 +1,5 @@ /*! - * Knockout Mapping plugin v2.5.0 + * Knockout Mapping plugin v2.6.0 * (c) 2013 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) */ @@ -282,6 +282,7 @@ } var realDeferEvaluation = options.deferEvaluation; + var realIsPure = options.pure; var isRemoved = false; @@ -315,7 +316,7 @@ options.deferEvaluation = true; // will either set for just options, or both read/options. var realDependentObservable = realKoDependentObservable(read, owner, options); - if (!realDeferEvaluation) { + if (!realDeferEvaluation && !realIsPure) { realDependentObservable = wrap(realDependentObservable); dependentObservables.push(realDependentObservable); } diff --git a/dist/knockout.mapping.min.js b/dist/knockout.mapping.min.js index 285f396..42eb683 100644 --- a/dist/knockout.mapping.min.js +++ b/dist/knockout.mapping.min.js @@ -1,7 +1,7 @@ /*! - * Knockout Mapping plugin v2.5.0 + * Knockout Mapping plugin v2.6.0 * (c) 2013 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) */ -!function(e){"use strict";if("function"==typeof require&&"object"==typeof exports&&"object"==typeof module)e(require("knockout"),exports);else if("function"==typeof define&&define.amd)define(["knockout","exports"],e);else{if("undefined"==typeof ko)throw new Error("Knockout is required, please ensure it is loaded before loading this mapping plug-in");e(ko,ko.mapping={})}}(function(e,r){"use strict";function t(){for(var e,r,t,n=arguments,a=n.length,i={},u=[];a--;)for(t=n[a],e=t.length;e--;)r=t[e],i[r]||(i[r]=1,u.push(r));return u}function n(e,a){var i;for(var u in a)if(a.hasOwnProperty(u)&&a[u])if(i=r.getType(e[u]),u&&e[u]&&"array"!==i&&"string"!==i)n(e[u],a[u]);else{var o="array"===r.getType(e[u])&&"array"===r.getType(a[u]);o?e[u]=t(e[u],a[u]):e[u]=a[u]}}function a(e,r){var t={};return n(t,e),n(t,r),t}function i(e,r){for(var t=a({},e),n=x.length-1;n>=0;n--){var i=x[n];t[i]&&(t[""]instanceof Object||(t[""]={}),t[""][i]=t[i],delete t[i])}return r&&(t.ignore=u(r.ignore,t.ignore),t.include=u(r.include,t.include),t.copy=u(r.copy,t.copy),t.observe=u(r.observe,t.observe)),t.ignore=u(t.ignore,E.ignore),t.include=u(t.include,E.include),t.copy=u(t.copy,E.copy),t.observe=u(t.observe,E.observe),t.mappedProperties=t.mappedProperties||{},t.copiedProperties=t.copiedProperties||{},t}function u(t,n){return void 0===t?t=[]:"array"!==r.getType(t)&&(t=[t]),void 0===n?n=[]:"array"!==r.getType(n)&&(n=[n]),e.utils.arrayGetDistinctValues(t.concat(n))}function o(r,t){var n=e.dependentObservable;e.dependentObservable=function(t,n,a){a=a||{},t&&"object"==typeof t&&(a=t);var i=a.deferEvaluation,u=!1,o=function(t){var n=e.dependentObservable;e.dependentObservable=k;var a=e.isWriteableObservable(t);e.dependentObservable=n;var i=k({read:function(){return u||(e.utils.arrayRemoveItem(r,t),u=!0),t.apply(t,arguments)},write:a&&function(e){return t(e)},deferEvaluation:!0});return i.__DO=t,i};a.deferEvaluation=!0;var s=k(t,n,a);return i||(s=o(s),r.push(s)),s},e.dependentObservable.fn=k.fn,e.computed=e.dependentObservable;var a=t();return e.dependentObservable=n,e.computed=e.dependentObservable,a}function s(t,n,i,u,l,b,g){var O="array"===r.getType(e.utils.unwrapObservable(n));if(b=b||"",r.isMapped(t)){var k=e.utils.unwrapObservable(t)[w];i=a(k,i)}var T={data:n,parent:g||l},x=function(){return i[u]&&i[u].create instanceof Function},I=function(r){return o(h,function(){return e.utils.unwrapObservable(l)instanceof Array?i[u].create({data:r||T.data,parent:T.parent,skip:j}):i[u].create({data:r||T.data,parent:T.parent})})},E=function(){return i[u]&&i[u].update instanceof Function},P=function(r,t){var n={data:t||T.data,parent:T.parent,target:e.utils.unwrapObservable(r)};return e.isWriteableObservable(r)&&(n.observable=r),i[u].update(n)},J=m.get(n);if(J)return J;if(u=u||"",O){var _=[],W=!1,D=function(e){return e};i[u]&&i[u].key&&(D=i[u].key,W=!0),e.isObservable(t)||(t=e.observableArray([]),t.mappedRemove=function(e){var r="function"==typeof e?e:function(r){return r===D(e)};return t.remove(function(e){return r(D(e))})},t.mappedRemoveAll=function(r){var n=c(r,D);return t.remove(function(r){return-1!==e.utils.arrayIndexOf(n,D(r))})},t.mappedDestroy=function(e){var r="function"==typeof e?e:function(r){return r===D(e)};return t.destroy(function(e){return r(D(e))})},t.mappedDestroyAll=function(r){var n=c(r,D);return t.destroy(function(r){return-1!==e.utils.arrayIndexOf(n,D(r))})},t.mappedIndexOf=function(r){var n=c(t(),D),a=D(r);return e.utils.arrayIndexOf(n,a)},t.mappedGet=function(e){return t()[t.mappedIndexOf(e)]},t.mappedCreate=function(r){if(-1!==t.mappedIndexOf(r))throw new Error("There already is an object with the key that you specified.");var n=x()?I(r):r;if(E()){var a=P(n,r);e.isWriteableObservable(n)?n(a):n=a}return t.push(n),n});var S=c(e.utils.unwrapObservable(t),D).sort(),A=c(n,D);W&&A.sort();var N,M,C,q=e.utils.compareArrays(S,A),F={},R=e.utils.unwrapObservable(n),$={},G=!0;for(N=0,M=R.length;M>N;N++){if(C=D(R[N]),void 0===C||C instanceof Object){G=!1;break}$[C]=R[N]}var K,V,z=[],B=0;for(N=0,M=q.length;M>N;N++){C=q[N];var H,L=b+"["+y(N)+"]";switch(C.status){case"added":K=G?$[C.value]:f(e.utils.unwrapObservable(n),C.value,D),H=s(void 0,K,i,u,t,L,l),x()||(H=e.utils.unwrapObservable(H)),V=p(e.utils.unwrapObservable(n),K,F),H===j?B++:z[V-B]=H,F[V]=!0;break;case"retained":K=G?$[C.value]:f(e.utils.unwrapObservable(n),C.value,D),H=f(t,C.value,D),s(H,K,i,u,t,L,l),V=p(e.utils.unwrapObservable(n),K,F),z[V]=H,F[V]=!0;break;case"deleted":H=f(t,C.value,D)}_.push({event:C.status,item:H})}t(z),i[u]&&i[u].arrayChanged&&e.utils.arrayForEach(_,function(e){i[u].arrayChanged(e.event,e.item)})}else if(d(n)){if(t=e.utils.unwrapObservable(t),!t){if(x()){var Q=I();return E()&&(Q=P(Q)),Q}if(E())return P();t={}}if(E()&&(t=P(t)),m.save(n,t),E())return t;v(n,function(a){var u=b.length?b+"."+y(a):y(a);if(-1===e.utils.arrayIndexOf(i.ignore,u)){if(-1!==e.utils.arrayIndexOf(i.copy,u))return void(t[a]=n[a]);if("object"!=typeof n[a]&&"array"!==r.getType(n[a])&&i.observe.length>0&&-1===e.utils.arrayIndexOf(i.observe,u))return t[a]=n[a],void(i.copiedProperties[u]=!0);var o=m.get(n[a]),p=s(t[a],n[a],i,a,t,u,t),l=o||p;if(i.observe.length>0&&-1===e.utils.arrayIndexOf(i.observe,u))return t[a]=e.utils.unwrapObservable(l),void(i.copiedProperties[u]=!0);e.isWriteableObservable(t[a])?(l=e.utils.unwrapObservable(l),t[a]()!==l&&t[a](l)):(l=void 0===t[a]?l:e.utils.unwrapObservable(l),t[a]=l),i.mappedProperties[u]=!0}})}else switch(r.getType(n)){case"function":E()?e.isWriteableObservable(n)?(n(P(n)),t=n):t=P(n):t=n;break;default:if(e.isWriteableObservable(t)){var U;return E()?(U=P(t),t(U),U):(U=e.utils.unwrapObservable(n),t(U),U)}var X=x()||E();if(t=x()?I():e.observable(e.utils.unwrapObservable(n)),E()&&t(P(t)),X)return t}return t}function p(e,r,t){for(var n=0,a=e.length;a>n;n++)if(t[n]!==!0&&e[n]===r)return n;return null}function l(t,n){var a;return n&&(a=n(t)),"undefined"===r.getType(a)&&(a=t),e.utils.unwrapObservable(a)}function f(r,t,n){r=e.utils.unwrapObservable(r);for(var a=0,i=r.length;i>a;a++){var u=r[a];if(l(u,n)===t)return u}throw new Error("When calling ko.update*, the key '"+t+"' was not found!")}function c(r,t){return e.utils.arrayMap(e.utils.unwrapObservable(r),function(e){return t?l(e,t):e})}function v(e,t){if("array"===r.getType(e))for(var n=0;n=0?t[i]=a:(r.push(n),t.push(a))},this.get=function(n){var a=e.utils.arrayIndexOf(r,n),i=a>=0?t[a]:void 0;return i}}function O(){var e={},r=function(r){var t;try{t=r}catch(n){t="$$$"}var a=e[t];return e.hasOwnProperty(t)||(a=new g,e[t]=a),a};this.save=function(e,t){r(e).save(e,t)},this.get=function(e){return r(e).get(e)}}e.mapping=r;var h,m,w="__ko_mapping__",k=e.dependentObservable,T=0,x=["create","update","key","arrayChanged"],j={},I={include:["_destroy"],ignore:[],copy:[],observe:[]},E=I;r.isMapped=function(r){var t=e.utils.unwrapObservable(r);return t&&t[w]},r.fromJS=function(e){if(0===arguments.length)throw new Error("When calling ko.fromJS, pass the object you want to convert.");try{T||(h=[],m=new O),T++;var r,t;2===arguments.length&&(arguments[1][w]?t=arguments[1]:r=arguments[1]),3===arguments.length&&(r=arguments[1],t=arguments[2]),t&&(r=a(r,t[w])),r=i(r);var n=s(t,e,r);if(t&&(n=t),!--T)for(;h.length;){var u=h.pop();u&&(u(),u.__DO.throttleEvaluation=u.throttleEvaluation)}return n[w]=a(n[w],r),n}catch(o){throw T=0,o}},r.fromJSON=function(t){var n=Array.prototype.slice.call(arguments,0);return n[0]=e.utils.parseJson(t),r.fromJS.apply(this,n)},r.toJS=function(t,n){if(E||r.resetDefaultOptions(),0===arguments.length)throw new Error("When calling ko.mapping.toJS, pass the object you want to convert.");if("array"!==r.getType(E.ignore))throw new Error("ko.mapping.defaultOptions().ignore should be an array.");if("array"!==r.getType(E.include))throw new Error("ko.mapping.defaultOptions().include should be an array.");if("array"!==r.getType(E.copy))throw new Error("ko.mapping.defaultOptions().copy should be an array.");return n=i(n,t[w]),r.visitModel(t,function(r){return e.utils.unwrapObservable(r)},n)},r.toJSON=function(t,n,a,i){var u=r.toJS(t,n);return e.utils.stringifyJson(u,a,i)},r.defaultOptions=function(){return arguments.length>0?void(E=arguments[0]):E},r.resetDefaultOptions=function(){E={include:I.include.slice(0),ignore:I.ignore.slice(0),copy:I.copy.slice(0),observe:I.observe.slice(0)}},r.getType=function(e){if(e&&"object"==typeof e){if(e.constructor===Date)return"date";if(e.constructor===Array)return"array"}return typeof e},r.visitModel=function(t,n,a){a=a||{},a.visitedObjects=a.visitedObjects||new O;var u,o=e.utils.unwrapObservable(t);if(!d(o))return n(t,a.parentName);a=i(a,o[w]),n(t,a.parentName),u="array"===r.getType(o)?[]:{},a.visitedObjects.save(t,u);var s=a.parentName;return v(o,function(t){var i=y(t);if(!a.ignore||-1===e.utils.arrayIndexOf(a.ignore,i)){var p=o[t];if(a.parentName=b(s,o,t),-1===e.utils.arrayIndexOf(a.copy,i)&&-1===e.utils.arrayIndexOf(a.include,i)){var l=o[w];if(l){var f=l.mappedProperties;if(f&&!f[i]){var c=l.copiedProperties;if(c&&!c[i]&&"array"!==r.getType(o))return}}}switch(r.getType(e.utils.unwrapObservable(p))){case"object":case"array":case"undefined":var v=a.visitedObjects.get(p);u[t]="undefined"!==r.getType(v)?v:r.visitModel(p,n,a);break;default:u[t]=n(p,a.parentName)}}}),u}}); -//# sourceMappingURL=knockout.mapping.min.js.map \ No newline at end of file +!function(e){"use strict";if("function"==typeof require&&"object"==typeof exports&&"object"==typeof module)e(require("knockout"),exports);else if("function"==typeof define&&define.amd)define(["knockout","exports"],e);else{if("undefined"==typeof ko)throw new Error("Knockout is required, please ensure it is loaded before loading this mapping plug-in");e(ko,ko.mapping={})}}(function(e,r){"use strict";function t(){for(var e,r,t,n=arguments,a=n.length,i={},o=[];a--;)for(t=n[a],e=t.length;e--;)r=t[e],i[r]||(i[r]=1,o.push(r));return o}function n(e,a){var i;for(var o in a)if(a.hasOwnProperty(o)&&a[o])if(i=r.getType(e[o]),o&&e[o]&&"array"!==i&&"string"!==i)n(e[o],a[o]);else{var u="array"===r.getType(e[o])&&"array"===r.getType(a[o]);u?e[o]=t(e[o],a[o]):e[o]=a[o]}}function a(e,r){var t={};return n(t,e),n(t,r),t}function i(e,r){for(var t=a({},e),n=x.length-1;n>=0;n--){var i=x[n];t[i]&&(t[""]instanceof Object||(t[""]={}),t[""][i]=t[i],delete t[i])}return r&&(t.ignore=o(r.ignore,t.ignore),t.include=o(r.include,t.include),t.copy=o(r.copy,t.copy),t.observe=o(r.observe,t.observe)),t.ignore=o(t.ignore,E.ignore),t.include=o(t.include,E.include),t.copy=o(t.copy,E.copy),t.observe=o(t.observe,E.observe),t.mappedProperties=t.mappedProperties||{},t.copiedProperties=t.copiedProperties||{},t}function o(t,n){return void 0===t?t=[]:"array"!==r.getType(t)&&(t=[t]),void 0===n?n=[]:"array"!==r.getType(n)&&(n=[n]),e.utils.arrayGetDistinctValues(t.concat(n))}function u(r,t){var n=e.dependentObservable;e.dependentObservable=function(t,n,a){a=a||{},t&&"object"==typeof t&&(a=t);var i=a.deferEvaluation,o=a.pure,u=!1,s=function(t){var n=e.dependentObservable;e.dependentObservable=k;var a=e.isWriteableObservable(t);e.dependentObservable=n;var i=k({read:function(){return u||(e.utils.arrayRemoveItem(r,t),u=!0),t.apply(t,arguments)},write:a&&function(e){return t(e)},deferEvaluation:!0});return i.__DO=t,i};a.deferEvaluation=!0;var p=k(t,n,a);return i||o||(p=s(p),r.push(p)),p},e.dependentObservable.fn=k.fn,e.computed=e.dependentObservable;var a=t();return e.dependentObservable=n,e.computed=e.dependentObservable,a}function s(t,n,i,o,l,b,g){var O="array"===r.getType(e.utils.unwrapObservable(n));if(b=b||"",r.isMapped(t)){var k=e.utils.unwrapObservable(t)[m];i=a(k,i)}var T={data:n,parent:g||l},x=function(){return i[o]&&i[o].create instanceof Function},I=function(r){return u(h,function(){return e.utils.unwrapObservable(l)instanceof Array?i[o].create({data:r||T.data,parent:T.parent,skip:j}):i[o].create({data:r||T.data,parent:T.parent})})},E=function(){return i[o]&&i[o].update instanceof Function},P=function(r,t){var n={data:t||T.data,parent:T.parent,target:e.utils.unwrapObservable(r)};return e.isWriteableObservable(r)&&(n.observable=r),i[o].update(n)},J=w.get(n);if(J)return J;if(o=o||"",O){var _=[],W=!1,D=function(e){return e};i[o]&&i[o].key&&(D=i[o].key,W=!0),e.isObservable(t)||(t=e.observableArray([]),t.mappedRemove=function(e){var r="function"==typeof e?e:function(r){return r===D(e)};return t.remove(function(e){return r(D(e))})},t.mappedRemoveAll=function(r){var n=c(r,D);return t.remove(function(r){return-1!==e.utils.arrayIndexOf(n,D(r))})},t.mappedDestroy=function(e){var r="function"==typeof e?e:function(r){return r===D(e)};return t.destroy(function(e){return r(D(e))})},t.mappedDestroyAll=function(r){var n=c(r,D);return t.destroy(function(r){return-1!==e.utils.arrayIndexOf(n,D(r))})},t.mappedIndexOf=function(r){var n=c(t(),D),a=D(r);return e.utils.arrayIndexOf(n,a)},t.mappedGet=function(e){return t()[t.mappedIndexOf(e)]},t.mappedCreate=function(r){if(-1!==t.mappedIndexOf(r))throw new Error("There already is an object with the key that you specified.");var n=x()?I(r):r;if(E()){var a=P(n,r);e.isWriteableObservable(n)?n(a):n=a}return t.push(n),n});var S=c(e.utils.unwrapObservable(t),D).sort(),A=c(n,D);W&&A.sort();var N,M,C,q=e.utils.compareArrays(S,A),F={},R=e.utils.unwrapObservable(n),$={},G=!0;for(N=0,M=R.length;M>N;N++){if(C=D(R[N]),void 0===C||C instanceof Object){G=!1;break}$[C]=R[N]}var K,V,z=[],B=0;for(N=0,M=q.length;M>N;N++){C=q[N];var H,L=b+"["+y(N)+"]";switch(C.status){case"added":K=G?$[C.value]:f(e.utils.unwrapObservable(n),C.value,D),H=s(void 0,K,i,o,t,L,l),x()||(H=e.utils.unwrapObservable(H)),V=p(e.utils.unwrapObservable(n),K,F),H===j?B++:z[V-B]=H,F[V]=!0;break;case"retained":K=G?$[C.value]:f(e.utils.unwrapObservable(n),C.value,D),H=f(t,C.value,D),s(H,K,i,o,t,L,l),V=p(e.utils.unwrapObservable(n),K,F),z[V]=H,F[V]=!0;break;case"deleted":H=f(t,C.value,D)}_.push({event:C.status,item:H})}t(z),i[o]&&i[o].arrayChanged&&e.utils.arrayForEach(_,function(e){i[o].arrayChanged(e.event,e.item)})}else if(d(n)){if(t=e.utils.unwrapObservable(t),!t){if(x()){var Q=I();return E()&&(Q=P(Q)),Q}if(E())return P();t={}}if(E()&&(t=P(t)),w.save(n,t),E())return t;v(n,function(a){var o=b.length?b+"."+y(a):y(a);if(-1===e.utils.arrayIndexOf(i.ignore,o)){if(-1!==e.utils.arrayIndexOf(i.copy,o))return void(t[a]=n[a]);if("object"!=typeof n[a]&&"array"!==r.getType(n[a])&&i.observe.length>0&&-1===e.utils.arrayIndexOf(i.observe,o))return t[a]=n[a],void(i.copiedProperties[o]=!0);var u=w.get(n[a]),p=s(t[a],n[a],i,a,t,o,t),l=u||p;if(i.observe.length>0&&-1===e.utils.arrayIndexOf(i.observe,o))return t[a]=e.utils.unwrapObservable(l),void(i.copiedProperties[o]=!0);e.isWriteableObservable(t[a])?(l=e.utils.unwrapObservable(l),t[a]()!==l&&t[a](l)):(l=void 0===t[a]?l:e.utils.unwrapObservable(l),t[a]=l),i.mappedProperties[o]=!0}})}else switch(r.getType(n)){case"function":E()?e.isWriteableObservable(n)?(n(P(n)),t=n):t=P(n):t=n;break;default:if(e.isWriteableObservable(t)){var U;return E()?(U=P(t),t(U),U):(U=e.utils.unwrapObservable(n),t(U),U)}var X=x()||E();if(t=x()?I():e.observable(e.utils.unwrapObservable(n)),E()&&t(P(t)),X)return t}return t}function p(e,r,t){for(var n=0,a=e.length;a>n;n++)if(t[n]!==!0&&e[n]===r)return n;return null}function l(t,n){var a;return n&&(a=n(t)),"undefined"===r.getType(a)&&(a=t),e.utils.unwrapObservable(a)}function f(r,t,n){r=e.utils.unwrapObservable(r);for(var a=0,i=r.length;i>a;a++){var o=r[a];if(l(o,n)===t)return o}throw new Error("When calling ko.update*, the key '"+t+"' was not found!")}function c(r,t){return e.utils.arrayMap(e.utils.unwrapObservable(r),function(e){return t?l(e,t):e})}function v(e,t){if("array"===r.getType(e))for(var n=0;n=0?t[i]=a:(r.push(n),t.push(a))},this.get=function(n){var a=e.utils.arrayIndexOf(r,n),i=a>=0?t[a]:void 0;return i}}function O(){var e={},r=function(r){var t;try{t=r}catch(n){t="$$$"}var a=e[t];return e.hasOwnProperty(t)||(a=new g,e[t]=a),a};this.save=function(e,t){r(e).save(e,t)},this.get=function(e){return r(e).get(e)}}e.mapping=r;var h,w,m="__ko_mapping__",k=e.dependentObservable,T=0,x=["create","update","key","arrayChanged"],j={},I={include:["_destroy"],ignore:[],copy:[],observe:[]},E=I;r.isMapped=function(r){var t=e.utils.unwrapObservable(r);return t&&t[m]},r.fromJS=function(e){if(0===arguments.length)throw new Error("When calling ko.fromJS, pass the object you want to convert.");try{T||(h=[],w=new O),T++;var r,t;2===arguments.length&&(arguments[1][m]?t=arguments[1]:r=arguments[1]),3===arguments.length&&(r=arguments[1],t=arguments[2]),t&&(r=a(r,t[m])),r=i(r);var n=s(t,e,r);if(t&&(n=t),!--T)for(;h.length;){var o=h.pop();o&&(o(),o.__DO.throttleEvaluation=o.throttleEvaluation)}return n[m]=a(n[m],r),n}catch(u){throw T=0,u}},r.fromJSON=function(t){var n=Array.prototype.slice.call(arguments,0);return n[0]=e.utils.parseJson(t),r.fromJS.apply(this,n)},r.toJS=function(t,n){if(E||r.resetDefaultOptions(),0===arguments.length)throw new Error("When calling ko.mapping.toJS, pass the object you want to convert.");if("array"!==r.getType(E.ignore))throw new Error("ko.mapping.defaultOptions().ignore should be an array.");if("array"!==r.getType(E.include))throw new Error("ko.mapping.defaultOptions().include should be an array.");if("array"!==r.getType(E.copy))throw new Error("ko.mapping.defaultOptions().copy should be an array.");return n=i(n,t[m]),r.visitModel(t,function(r){return e.utils.unwrapObservable(r)},n)},r.toJSON=function(t,n,a,i){var o=r.toJS(t,n);return e.utils.stringifyJson(o,a,i)},r.defaultOptions=function(){return arguments.length>0?void(E=arguments[0]):E},r.resetDefaultOptions=function(){E={include:I.include.slice(0),ignore:I.ignore.slice(0),copy:I.copy.slice(0),observe:I.observe.slice(0)}},r.getType=function(e){if(e&&"object"==typeof e){if(e.constructor===Date)return"date";if(e.constructor===Array)return"array"}return typeof e},r.visitModel=function(t,n,a){a=a||{},a.visitedObjects=a.visitedObjects||new O;var o,u=e.utils.unwrapObservable(t);if(!d(u))return n(t,a.parentName);a=i(a,u[m]),n(t,a.parentName),o="array"===r.getType(u)?[]:{},a.visitedObjects.save(t,o);var s=a.parentName;return v(u,function(t){var i=y(t);if(!a.ignore||-1===e.utils.arrayIndexOf(a.ignore,i)){var p=u[t];if(a.parentName=b(s,u,t),-1===e.utils.arrayIndexOf(a.copy,i)&&-1===e.utils.arrayIndexOf(a.include,i)){var l=u[m];if(l){var f=l.mappedProperties;if(f&&!f[i]){var c=l.copiedProperties;if(c&&!c[i]&&"array"!==r.getType(u))return}}}switch(r.getType(e.utils.unwrapObservable(p))){case"object":case"array":case"undefined":var v=a.visitedObjects.get(p);o[t]="undefined"!==r.getType(v)?v:r.visitModel(p,n,a);break;default:o[t]=n(p,a.parentName)}}}),o}}); +//# sourceMappingURL=knockout.mapping.min.js.map diff --git a/dist/knockout.mapping.min.js.map b/dist/knockout.mapping.min.js.map index 44b5ab4..6d08feb 100644 --- a/dist/knockout.mapping.min.js.map +++ b/dist/knockout.mapping.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["knockout.mapping.min.js"],"names":["factory","require","exports","module","define","ko","Error","mapping","unionArrays","i","j","k","args","arguments","l","length","obj","res","push","extendObject","destination","source","destType","key","hasOwnProperty","getType","bothArrays","merge","obj1","obj2","merged","fillOptions","rawOptions","otherOptions","options","recognizedRootProperties","property","Object","ignore","mergeArrays","include","copy","observe","defaultOptions","mappedProperties","copiedProperties","a","b","undefined","utils","arrayGetDistinctValues","concat","withProxyDependentObservable","dependentObservables","callback","localDO","dependentObservable","read","owner","realDeferEvaluation","deferEvaluation","isRemoved","wrap","DO","tmp","realKoDependentObservable","isWriteable","isWriteableObservable","wrapped","arrayRemoveItem","apply","write","val","__DO","realDependentObservable","fn","computed","result","updateViewModel","mappedRootObject","rootObject","parentName","parent","parentPropertyName","mappedParent","isArray","unwrapObservable","isMapped","previousMapping","mappingProperty","callbackParams","data","hasCreateCallback","create","Function","createCallback","Array","skip","emptyReturn","hasUpdateCallback","update","updateCallback","params","target","observable","alreadyMapped","visitedObjects","get","changes","hasKeyCallback","keyCallback","x","isObservable","observableArray","mappedRemove","valueOrPredicate","predicate","value","remove","item","mappedRemoveAll","arrayOfValues","arrayOfKeys","filterArrayByKey","arrayIndexOf","mappedDestroy","destroy","mappedDestroyAll","mappedIndexOf","keys","mappedGet","mappedCreate","newValue","currentArrayKeys","sort","newArrayKeys","editScript","compareArrays","ignoreIndexOf","unwrappedRootObject","itemsByKey","optimizedKeys","index","newContents","passedOver","mappedItem","fullPropertyName","escapePropertyNameComponent","status","getItemByKey","ignorableIndexOf","event","arrayChanged","arrayForEach","change","canHaveProperties","save","visitPropertiesOrArrayEntries","indexer","prevMappedProperty","retval","valueToWrite","hasCreateOrUpdateCallback","array","ignoreIndices","mapKey","arrayMap","visitorCallback","propertyName","object","type","getPropertyName","escapedIndexer","replace","SimpleObjectLookup","values","this","existingIndex","ObjectLookup","buckets","findBucket","bucketKey","e","bucket","mappingNesting","_defaultOptions","viewModel","unwrapped","fromJS","jsObject","pop","fromJSON","jsonString","prototype","slice","call","parseJson","toJS","resetDefaultOptions","visitModel","toJSON","replacer","space","plainJavaScriptObject","stringifyJson","constructor","Date","propertyValue","unwrappedRootMappingProperty","previouslyMappedValue"],"mappings":";;;;;CAKC,SAASA,GACN,YAKA,IAAuB,kBAAZC,UAA6C,gBAAZC,UAA0C,gBAAXC,QAEvEH,EAAQC,QAAQ,YAAaC,aAE5B,IAAsB,kBAAXE,SAAyBA,OAAY,IAEjDA,QAAQ,WAAY,WAAYJ,OAE/B,CAED,GAAkB,mBAAPK,IACP,KAAM,IAAIC,OAAM,uFAEpBN,GAAQK,GAAIA,GAAGE,cAErB,SAASF,EAAIH,GAEX,YAqBA,SAASM,KAOL,IANA,GAIIC,GAAGC,EAAGC,EAJNC,EAAOC,UACPC,EAAIF,EAAKG,OACTC,KACAC,KAGGH,KAIH,IAHAH,EAAIC,EAAKE,GACTL,EAAIE,EAAEI,OAECN,KACHC,EAAIC,EAAEF,GACDO,EAAIN,KACLM,EAAIN,GAAK,EACTO,EAAIC,KAAKR,GAKrB,OAAOO,GAGX,QAASE,GAAaC,EAAaC,GAC/B,GAAIC,EAEJ,KAAK,GAAIC,KAAOF,GACZ,GAAIA,EAAOG,eAAeD,IAAQF,EAAOE,GAErC,GADAD,EAAWpB,EAAQuB,QAAQL,EAAYG,IACnCA,GAAOH,EAAYG,IAAqB,UAAbD,GAAqC,WAAbA,EACnDH,EAAaC,EAAYG,GAAMF,EAAOE,QAErC,CACD,GAAIG,GAAmD,UAAtCxB,EAAQuB,QAAQL,EAAYG,KAAsD,UAAjCrB,EAAQuB,QAAQJ,EAAOE,GACrFG,GACAN,EAAYG,GAAOf,EAAYY,EAAYG,GAAMF,EAAOE,IAGxDH,EAAYG,GAAOF,EAAOE,IAO9C,QAASI,GAAMC,EAAMC,GACjB,GAAIC,KAIJ,OAHAX,GAAaW,EAAQF,GACrBT,EAAaW,EAAQD,GAEdC,EA2HX,QAASC,GAAYC,EAAYC,GAI7B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,EAA8B,CAC9B,GAAIpK,GAAmBoK,EAA6BpK,gBACpD,IAAIA,IAAqBA,EAAiBgI,GAAiB,CACvD,GAAI/H,GAAmBmK,EAA6BnK,gBACpD,IAAIA,IAAqBA,EAAiB+H,IAA6D,UAAzC1K,EAAQuB,QAAQkH,GAC1E,SAOpB,OAAQzI,EAAQuB,QAAQpB,EAAG4C,MAAMqC,iBAAiByH,KAC9C,IAAK,SACL,IAAK,QACL,IAAK,YACD,GAAIE,GAAwB/K,EAAQwE,eAAeC,IAAIoG,EACvDhI,GAAiB+E,GAAuD,cAA3C5J,EAAQuB,QAAQwL,GAA0CA,EAAwB/M,EAAQqM,WAAWQ,EAAezJ,EAAUpB,EAC3J,MACJ,SACI6C,EAAiB+E,GAAWxG,EAASyJ,EAAe7K,EAAQ+C,gBAIjEF","file":"knockout.mapping.min.js","sourcesContent":["/*!\n * Knockout Mapping plugin v2.5.0\n * (c) 2013 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/\n * License: MIT (http://www.opensource.org/licenses/mit-license.php)\n */\n(function(factory) {\n 'use strict';\n\n /*jshint sub:true,curly:false*/\n /*global ko,require,exports,define,module*/\n\n if (typeof require === \"function\" && typeof exports === \"object\" && typeof module === \"object\") {\n // CommonJS or Node: hard-coded dependency on \"knockout\"\n factory(require(\"knockout\"), exports);\n }\n else if (typeof define === \"function\" && define[\"amd\"]) {\n // AMD anonymous module with hard-coded dependency on \"knockout\"\n define([\"knockout\", \"exports\"], factory);\n }\n else {\n //