Comparing version 5.1.0 to 5.2.0
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Typeson=n():e.Typeson=n()}(this,function(){return function(e){function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,t){"use strict";function r(e){if(Array.isArray(e)){for(var n=0,t=Array(e.length);n<e.length;n++)t[n]=e[n];return t}return Array.from(e)}function i(e,n){return f.isObject(e)&&"function"==typeof e.then&&(!n||"function"==typeof e.catch)}function o(e){return w.call(e).slice(8,-1)}function c(e,n){if(!e||"object"!==(void 0===e?"undefined":O(e)))return!1;var t=j(e);if(!t)return!1;var r=S.call(t,"constructor")&&t.constructor;return"function"!=typeof r?null===n:"function"==typeof r&&null!==n&&T.call(r)===T.call(n)}function u(e){return!(!e||"Object"!==o(e))&&(!j(e)||c(e,Object))}function a(e){if(!e||"Object"!==o(e))return!1;var n=j(e);return!n||(c(e,Object)||a(n))}function s(e){return e&&"object"===(void 0===e?"undefined":O(e))}function f(e){var n=[],t=[],o={},a=this.types={},l=this.stringify=function(n,t,r,i){i=Object.assign({},e,i,{stringification:!0});var o=j(n,null,i);return m(o)?JSON.stringify(o[0],t,r):o.then(function(e){return JSON.stringify(e,t,r)})};this.stringifySync=function(e,n,t,r){return l(e,n,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!0}))},this.stringifyAsync=function(e,n,t,r){return l(e,n,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!1}))};var w=this.parse=function(n,t,r){return r=Object.assign({},e,r,{parse:!0}),S(JSON.parse(n,t),r)};this.parseSync=function(e,n,t){return w(e,n,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.parseAsync=function(e,n,t){return w(e,n,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!1}))},this.specialTypeNames=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.returnTypeNames=!0,this.encapsulate(e,n,t)},this.rootTypeName=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.iterateNone=!0,this.encapsulate(e,n,t)};var j=this.encapsulate=function(i,a,y){function l(e){if(y.iterateNone){var n=Object.values(S);return n.length?n[0]:f.getJSONType(e)}var t=Object.values(S);if(t.length){if(y.returnTypeNames)return[].concat(r(new Set(t)));e&&u(e)&&!e.hasOwnProperty("$types")?e.$types=S:e={$:e,$types:{$:S}}}else s(e)&&e.hasOwnProperty("$types")&&(e={$:e,$types:!0});return!y.returnTypeNames&&e}function v(e,n){return Promise.all(n.map(function(e){return e[1].p})).then(function(t){return Promise.all(t.map(function(t){var r=[],i=n.splice(0,1)[0],o=b(i,7),u=o[0],a=o[2],s=o[3],f=o[4],y=o[5],p=o[6],l=d(u,t,a,s,r,!0,p),O=c(l,h);return u&&O?l.p.then(function(n){return f[y]=n,v(e,r)}):(u?f[y]=l:e=O?l.p:l,v(e,r))}))}).then(function(){return e})}function d(e,t,r,i,o,a,s){var l=void 0,v={},b=void 0===t?"undefined":O(t),j=$?function(n){var u=s||i.type||f.getJSONType(t);$(Object.assign(n||v,{keypath:e,value:t,cyclic:r,stateObj:i,promisesData:o,resolvingTypesonPromise:a,awaitingTypesonPromise:c(t,h)},void 0!==u?{type:u}:{}))}:null;if(b in{string:1,boolean:1,number:1,undefined:1})return void 0===t||"number"===b&&(isNaN(t)||t===-1/0||t===1/0)?(l=w(e,t,i,o,!1,a,j))!==t&&(v={replaced:l}):l=t,j&&j(),l;if(null===t)return j&&j(),t;if(r&&!i.iterateIn&&!i.iterateUnsetNumeric){var P=T.indexOf(t);if(!(P<0))return S[e]="#",j&&j({cyclicKeypath:A[P]}),"#"+A[P];!0===r&&(T.push(t),A.push(e))}var N=u(t),x=m(t),E=(N||x)&&(!n.length||i.replaced)||i.iterateIn?t:w(e,t,i,o,N||x,null,j),B=void 0;if(E!==t?(l=E,v={replaced:E}):x||"array"===i.iterateIn?(B=new Array(t.length),v={clone:B}):N||"object"===i.iterateIn?(B={},v={clone:B}):""===e&&c(t,h)?(o.push([e,t,r,i,void 0,void 0,i.type]),l=t):l=t,j&&j(),y.iterateNone)return B||l;if(!B)return l;if(i.iterateIn){for(var I in t){var J={ownKeys:t.hasOwnProperty(I)},K=e+(e?".":"")+p(I),k=d(K,t[I],!!r,J,o,a);c(k,h)?o.push([K,k,!!r,J,B,I,J.type]):void 0!==k&&(B[I]=k)}j&&j({endIterateIn:!0,end:!0})}else g(t).forEach(function(n){var i=e+(e?".":"")+p(n),u={ownKeys:!0},s=d(i,t[n],!!r,u,o,a);c(s,h)?o.push([i,s,!!r,u,B,n,u.type]):void 0!==s&&(B[n]=s)}),j&&j({endIterateOwn:!0,end:!0});if(i.iterateUnsetNumeric){for(var U=t.length,_=0;_<U;_++)if(!(_ in t)){var q=e+(e?".":"")+_,C={ownKeys:!1},D=d(q,void 0,!!r,C,o,a);c(D,h)?o.push([q,D,!!r,C,B,_,C.type]):void 0!==D&&(B[_]=D)}j&&j({endIterateUnsetNumeric:!0,end:!0})}return B}function w(e,r,i,c,u,a,s){for(var f=u?n:t,y=f.length;y--;){var p=f[y];if(p.test(r,i)){var l=p.type;if(o[l]){var v=S[e];S[e]=v?[l].concat(v):l}if(i=Object.assign(i,{type:l,replaced:!0}),(j||!p.replaceAsync)&&!p.replace)return s&&s({typeDetected:!0}),d(e,r,N&&"readonly",i,c,a,l);s&&s({replacing:!0});return d(e,p[j||!p.replaceAsync?"replace":"replaceAsync"](r,i),N&&"readonly",i,c,a,l)}}return r}y=Object.assign({sync:!0},e,y);var j=y.sync,S={},T=[],A=[],P=[],N=!(y&&"cyclic"in y)||y.cyclic,$=y.encapsulateObserver,x=d("",i,N,a||{},P);return P.length?j&&y.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(v(x,P)).then(l):!j&&y.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():y.stringification&&j?[l(x)]:j?l(x):Promise.resolve(l(x))};this.encapsulateSync=function(e,n,t){return j(e,n,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.encapsulateAsync=function(e,n,t){return j(e,n,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!1}))};var S=this.revive=function(n,t){function r(e,n,t,i,a,l){if(!f||"$types"!==e){var h=s[e];if(m(n)||u(n)){var O=m(n)?new Array(n.length):{};for(g(n).forEach(function(o){var u=r(e+(e?".":"")+p(o),n[o],t||O,i,O,o);c(u,d)?O[o]=void 0:void 0!==u&&(O[o]=u)}),n=O;y.length;){var w=b(y[0],4),j=w[0],S=w[1],T=w[2],A=w[3],P=v(j,S);if(c(P,d))T[A]=void 0;else{if(void 0===P)break;T[A]=P}y.splice(0,1)}}if(!h)return n;if("#"===h){var N=v(t,n.substr(1));return void 0===N&&y.push([t,n.substr(1),a,l]),N}var $=i.sync;return[].concat(h).reduce(function(e,n){var t=o[n];if(!t)throw new Error("Unregistered type: "+n);return t[$&&t.revive?"revive":!$&&t.reviveAsync?"reviveAsync":"revive"](e)},n)}}t=Object.assign({sync:!0},e,t);var a=t.sync,s=n&&n.$types,f=!0;if(!s)return n;if(!0===s)return n.$;s.$&&u(s.$)&&(n=n.$,s=s.$,f=!1);var y=[],l=r("",n,null,t);return l=c(l,d)?void 0:l,i(l)?a&&t.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():l:!a&&t.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():a?l:Promise.resolve(l)};this.reviveSync=function(e,n){return S(e,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.reviveAsync=function(e,n){return S(e,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))},this.register=function(e,r){return r=r||{},[].concat(e).forEach(function e(i){if(m(i))return i.map(e);i&&g(i).forEach(function(e){if("#"===e)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(f.JSON_TYPES.includes(e))throw new TypeError("Plain JSON object types are reserved as type names");var c=i[e],u=c.testPlainObjects?n:t,s=u.filter(function(n){return n.type===e});if(s.length&&(u.splice(u.indexOf(s[0]),1),delete o[e],delete a[e]),c){if("function"==typeof c){var p=c;c={test:function(e){return e&&e.constructor===p},replace:function(e){return y({},e)},revive:function(e){return y(Object.create(p.prototype),e)}}}else m(c)&&(c={test:c[0],replace:c[1],revive:c[2]});var l={type:e,test:c.test.bind(c)};c.replace&&(l.replace=c.replace.bind(c)),c.replaceAsync&&(l.replaceAsync=c.replaceAsync.bind(c));var v="number"==typeof r.fallback?r.fallback:r.fallback?0:1/0;if(c.testPlainObjects?n.splice(v,0,l):t.splice(v,0,l),c.revive||c.reviveAsync){var d={};c.revive&&(d.revive=c.revive.bind(c)),c.reviveAsync&&(d.reviveAsync=c.reviveAsync.bind(c)),o[e]=d}a[e]=c}})}),this}}function y(e,n){return g(n).map(function(t){e[t]=n[t]}),e}function p(e){return e.replace(/~/g,"~0").replace(/\./g,"~1")}function l(e){return e.replace(/~1/g,".").replace(/~0/g,"~")}function v(e,n){if(""===n)return e;var t=n.indexOf(".");if(t>-1){var r=e[l(n.substr(0,t))];return void 0===r?void 0:v(r,n.substr(t+1))}return e[l(n)]}function d(){}function h(e){this.p=new Promise(e)}Object.defineProperty(n,"__esModule",{value:!0});var b=function(){function e(e,n){var t=[],r=!0,i=!1,o=void 0;try{for(var c,u=e[Symbol.iterator]();!(r=(c=u.next()).done)&&(t.push(c.value),!n||t.length!==n);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return t}return function(n,t){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return e(n,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g=Object.keys,m=Array.isArray,w={}.toString,j=Object.getPrototypeOf,S={}.hasOwnProperty,T=S.toString;h.prototype.then=function(e,n){var t=this;return new h(function(r,i){t.p.then(function(n){r(e?e(n):n)},function(e){t.p.catch(function(e){return n?n(e):Promise.reject(e)}).then(r,i)})})},h.prototype.catch=function(e){return this.then(null,e)},h.resolve=function(e){return new h(function(n){n(e)})},h.reject=function(e){return new h(function(n,t){t(e)})},["all","race"].map(function(e){h[e]=function(n){return new h(function(t,r){Promise[e](n.map(function(e){return e.p})).then(t,r)})}}),f.Undefined=d,f.Promise=h,f.isThenable=i,f.toStringTag=o,f.hasConstructorOf=c,f.isObject=s,f.isPlainObject=u,f.isUserObject=a,f.escapeKeyPathComponent=p,f.unescapeKeyPathComponent=l,f.getByKeyPath=v,f.getJSONType=function(e){return null===e?"null":m(e)?"array":void 0===e?"undefined":O(e)},f.JSON_TYPES=["null","boolean","number","string","array","object"],n.default=f,e.exports=n.default}])}); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Typeson=n():e.Typeson=n()}("undefined"!=typeof self?self:this,function(){return function(e){function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var t={};return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,t){"use strict";function r(e){if(Array.isArray(e)){for(var n=0,t=Array(e.length);n<e.length;n++)t[n]=e[n];return t}return Array.from(e)}function i(e,n){return f.isObject(e)&&"function"==typeof e.then&&(!n||"function"==typeof e.catch)}function o(e){return w.call(e).slice(8,-1)}function c(e,n){if(!e||"object"!==(void 0===e?"undefined":O(e)))return!1;var t=j(e);if(!t)return!1;var r=S.call(t,"constructor")&&t.constructor;return"function"!=typeof r?null===n:"function"==typeof r&&null!==n&&T.call(r)===T.call(n)}function u(e){return!(!e||"Object"!==o(e))&&(!j(e)||c(e,Object))}function a(e){if(!e||"Object"!==o(e))return!1;var n=j(e);return!n||(c(e,Object)||a(n))}function s(e){return e&&"object"===(void 0===e?"undefined":O(e))}function f(e){var n=[],t=[],o={},a=this.types={},l=this.stringify=function(n,t,r,i){i=Object.assign({},e,i,{stringification:!0});var o=j(n,null,i);return m(o)?JSON.stringify(o[0],t,r):o.then(function(e){return JSON.stringify(e,t,r)})};this.stringifySync=function(e,n,t,r){return l(e,n,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!0}))},this.stringifyAsync=function(e,n,t,r){return l(e,n,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!1}))};var w=this.parse=function(n,t,r){return r=Object.assign({},e,r,{parse:!0}),S(JSON.parse(n,t),r)};this.parseSync=function(e,n,t){return w(e,n,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.parseAsync=function(e,n,t){return w(e,n,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!1}))},this.specialTypeNames=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.returnTypeNames=!0,this.encapsulate(e,n,t)},this.rootTypeName=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.iterateNone=!0,this.encapsulate(e,n,t)};var j=this.encapsulate=function(i,a,y){function l(e){if(y.iterateNone){var n=Object.values(S);return n.length?n[0]:f.getJSONType(e)}var t=Object.values(S);if(t.length){if(y.returnTypeNames)return[].concat(r(new Set(t)));e&&u(e)&&!e.hasOwnProperty("$types")?e.$types=S:e={$:e,$types:{$:S}}}else s(e)&&e.hasOwnProperty("$types")&&(e={$:e,$types:!0});return!y.returnTypeNames&&e}function v(e,n){return Promise.all(n.map(function(e){return e[1].p})).then(function(t){return Promise.all(t.map(function(t){var r=[],i=n.splice(0,1)[0],o=b(i,7),u=o[0],a=o[2],s=o[3],f=o[4],y=o[5],p=o[6],l=d(u,t,a,s,r,!0,p),O=c(l,h);return u&&O?l.p.then(function(n){return f[y]=n,v(e,r)}):(u?f[y]=l:e=O?l.p:l,v(e,r))}))}).then(function(){return e})}function d(e,t,r,i,o,a,s){var l=void 0,v={},b=void 0===t?"undefined":O(t),j=$?function(n){var u=s||i.type||f.getJSONType(t);$(Object.assign(n||v,{keypath:e,value:t,cyclic:r,stateObj:i,promisesData:o,resolvingTypesonPromise:a,awaitingTypesonPromise:c(t,h)},void 0!==u?{type:u}:{}))}:null;if(b in{string:1,boolean:1,number:1,undefined:1})return void 0===t||"number"===b&&(isNaN(t)||t===-1/0||t===1/0)?(l=w(e,t,i,o,!1,a,j))!==t&&(v={replaced:l}):l=t,j&&j(),l;if(null===t)return j&&j(),t;if(r&&!i.iterateIn&&!i.iterateUnsetNumeric){var P=T.indexOf(t);if(!(P<0))return S[e]="#",j&&j({cyclicKeypath:A[P]}),"#"+A[P];!0===r&&(T.push(t),A.push(e))}var N=u(t),x=m(t),E=(N||x)&&(!n.length||i.replaced)||i.iterateIn?t:w(e,t,i,o,N||x,null,j),B=void 0;if(E!==t?(l=E,v={replaced:E}):x||"array"===i.iterateIn?(B=new Array(t.length),v={clone:B}):N||"object"===i.iterateIn?(B={},v={clone:B}):""===e&&c(t,h)?(o.push([e,t,r,i,void 0,void 0,i.type]),l=t):l=t,j&&j(),y.iterateNone)return B||l;if(!B)return l;if(i.iterateIn){for(var I in t){var J={ownKeys:t.hasOwnProperty(I)},K=e+(e?".":"")+p(I),k=d(K,t[I],!!r,J,o,a);c(k,h)?o.push([K,k,!!r,J,B,I,J.type]):void 0!==k&&(B[I]=k)}j&&j({endIterateIn:!0,end:!0})}else g(t).forEach(function(n){var i=e+(e?".":"")+p(n),u={ownKeys:!0},s=d(i,t[n],!!r,u,o,a);c(s,h)?o.push([i,s,!!r,u,B,n,u.type]):void 0!==s&&(B[n]=s)}),j&&j({endIterateOwn:!0,end:!0});if(i.iterateUnsetNumeric){for(var U=t.length,_=0;_<U;_++)if(!(_ in t)){var q=e+(e?".":"")+_,C={ownKeys:!1},D=d(q,void 0,!!r,C,o,a);c(D,h)?o.push([q,D,!!r,C,B,_,C.type]):void 0!==D&&(B[_]=D)}j&&j({endIterateUnsetNumeric:!0,end:!0})}return B}function w(e,r,i,c,u,a,s){for(var f=u?n:t,y=f.length;y--;){var p=f[y];if(p.test(r,i)){var l=p.type;if(o[l]){var v=S[e];S[e]=v?[l].concat(v):l}if(i=Object.assign(i,{type:l,replaced:!0}),(j||!p.replaceAsync)&&!p.replace)return s&&s({typeDetected:!0}),d(e,r,N&&"readonly",i,c,a,l);s&&s({replacing:!0});return d(e,p[j||!p.replaceAsync?"replace":"replaceAsync"](r,i),N&&"readonly",i,c,a,l)}}return r}y=Object.assign({sync:!0},e,y);var j=y.sync,S={},T=[],A=[],P=[],N=!(y&&"cyclic"in y)||y.cyclic,$=y.encapsulateObserver,x=d("",i,N,a||{},P);return P.length?j&&y.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(v(x,P)).then(l):!j&&y.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():y.stringification&&j?[l(x)]:j?l(x):Promise.resolve(l(x))};this.encapsulateSync=function(e,n,t){return j(e,n,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.encapsulateAsync=function(e,n,t){return j(e,n,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!1}))};var S=this.revive=function(n,t){function r(e,n,t,i,a,l){if(!f||"$types"!==e){var h=s[e];if(m(n)||u(n)){var O=m(n)?new Array(n.length):{};for(g(n).forEach(function(o){var u=r(e+(e?".":"")+p(o),n[o],t||O,i,O,o);c(u,d)?O[o]=void 0:void 0!==u&&(O[o]=u)}),n=O;y.length;){var w=b(y[0],4),j=w[0],S=w[1],T=w[2],A=w[3],P=v(j,S);if(c(P,d))T[A]=void 0;else{if(void 0===P)break;T[A]=P}y.splice(0,1)}}if(!h)return n;if("#"===h){var N=v(t,n.substr(1));return void 0===N&&y.push([t,n.substr(1),a,l]),N}var $=i.sync;return[].concat(h).reduce(function(e,n){var t=o[n];if(!t)throw new Error("Unregistered type: "+n);return t[$&&t.revive?"revive":!$&&t.reviveAsync?"reviveAsync":"revive"](e)},n)}}t=Object.assign({sync:!0},e,t);var a=t.sync,s=n&&n.$types,f=!0;if(!s)return n;if(!0===s)return n.$;s.$&&u(s.$)&&(n=n.$,s=s.$,f=!1);var y=[],l=r("",n,null,t);return l=c(l,d)?void 0:l,i(l)?a&&t.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():l:!a&&t.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():a?l:Promise.resolve(l)};this.reviveSync=function(e,n){return S(e,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.reviveAsync=function(e,n){return S(e,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))},this.register=function(e,r){return r=r||{},[].concat(e).forEach(function e(i){if(m(i))return i.map(e);i&&g(i).forEach(function(e){if("#"===e)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(f.JSON_TYPES.includes(e))throw new TypeError("Plain JSON object types are reserved as type names");var c=i[e],u=c.testPlainObjects?n:t,s=u.filter(function(n){return n.type===e});if(s.length&&(u.splice(u.indexOf(s[0]),1),delete o[e],delete a[e]),c){if("function"==typeof c){var p=c;c={test:function(e){return e&&e.constructor===p},replace:function(e){return y({},e)},revive:function(e){return y(Object.create(p.prototype),e)}}}else m(c)&&(c={test:c[0],replace:c[1],revive:c[2]});var l={type:e,test:c.test.bind(c)};c.replace&&(l.replace=c.replace.bind(c)),c.replaceAsync&&(l.replaceAsync=c.replaceAsync.bind(c));var v="number"==typeof r.fallback?r.fallback:r.fallback?0:1/0;if(c.testPlainObjects?n.splice(v,0,l):t.splice(v,0,l),c.revive||c.reviveAsync){var d={};c.revive&&(d.revive=c.revive.bind(c)),c.reviveAsync&&(d.reviveAsync=c.reviveAsync.bind(c)),o[e]=d}a[e]=c}})}),this}}function y(e,n){return g(n).map(function(t){e[t]=n[t]}),e}function p(e){return e.replace(/~/g,"~0").replace(/\./g,"~1")}function l(e){return e.replace(/~1/g,".").replace(/~0/g,"~")}function v(e,n){if(""===n)return e;var t=n.indexOf(".");if(t>-1){var r=e[l(n.substr(0,t))];return void 0===r?void 0:v(r,n.substr(t+1))}return e[l(n)]}function d(){}function h(e){this.p=new Promise(e)}Object.defineProperty(n,"__esModule",{value:!0});var b=function(){function e(e,n){var t=[],r=!0,i=!1,o=void 0;try{for(var c,u=e[Symbol.iterator]();!(r=(c=u.next()).done)&&(t.push(c.value),!n||t.length!==n);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return t}return function(n,t){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return e(n,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g=Object.keys,m=Array.isArray,w={}.toString,j=Object.getPrototypeOf,S={}.hasOwnProperty,T=S.toString;h.prototype.then=function(e,n){var t=this;return new h(function(r,i){t.p.then(function(n){r(e?e(n):n)},function(e){t.p.catch(function(e){return n?n(e):Promise.reject(e)}).then(r,i)})})},h.prototype.catch=function(e){return this.then(null,e)},h.resolve=function(e){return new h(function(n){n(e)})},h.reject=function(e){return new h(function(n,t){t(e)})},["all","race"].map(function(e){h[e]=function(n){return new h(function(t,r){Promise[e](n.map(function(e){return e.p})).then(t,r)})}}),f.Undefined=d,f.Promise=h,f.isThenable=i,f.toStringTag=o,f.hasConstructorOf=c,f.isObject=s,f.isPlainObject=u,f.isUserObject=a,f.escapeKeyPathComponent=p,f.unescapeKeyPathComponent=l,f.getByKeyPath=v,f.getJSONType=function(e){return null===e?"null":m(e)?"array":void 0===e?"undefined":O(e)},f.JSON_TYPES=["null","boolean","number","string","array","object"],n.default=f,e.exports=n.default}])}); |
{ | ||
"name": "typeson", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"description": "Preserves types over JSON, BSON or socket.io", | ||
"main": "./dist/typeson-commonjs2.js", | ||
"module": "./typeson.js", | ||
"scripts": { | ||
@@ -34,9 +35,9 @@ "eslint": "eslint *.js", | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"base64-arraybuffer": "^0.1.5", | ||
"eslint": "4.11.0", | ||
"babel-core": "6.26.0", | ||
"babel-loader": "7.1.2", | ||
"babel-plugin-add-module-exports": "0.2.1", | ||
"babel-polyfill": "6.26.0", | ||
"babel-preset-es2015": "6.24.1", | ||
"base64-arraybuffer": "0.1.5", | ||
"eslint": "4.12.1", | ||
"eslint-config-standard": "10.2.1", | ||
@@ -48,6 +49,6 @@ "eslint-plugin-compat": "2.1.0", | ||
"eslint-plugin-standard": "3.0.1", | ||
"uglify-js": "^3.1.9", | ||
"webpack": "^3.8.1" | ||
"uglify-js": "3.2.0", | ||
"webpack": "3.9.1" | ||
}, | ||
"tonicExample": "var Typeson = require('typeson');\nvar TSON = new Typeson().register(require('typeson-registry/presets/builtin'));\n\nTSON.stringify({foo: new Date()}, null, 2);" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131773