@krakenjs/universal-serialize
Advanced tools
Comparing version 2.0.0 to 3.0.0-typescript.1
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("universal-serialize",[],n):"object"==typeof exports?exports["universal-serialize"]=n():e["universal-serialize"]=n()}("undefined"!=typeof self?self:this,(function(){return function(e){var n={};function r(t){if(n[t])return n[t].exports;var i=n[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)r.d(t,i,function(n){return e[n]}.bind(null,i));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return{}.hasOwnProperty.call(e,n)},r.p="",r(r.s=0)}([function(e,n,r){"use strict";r.r(n),r.d(n,"serialize",(function(){return P})),r.d(n,"deserialize",(function(){return h})),r.d(n,"serializeArray",(function(){return c})),r.d(n,"deserializeArray",(function(){return a})),r.d(n,"serializeBoolean",(function(){return d})),r.d(n,"deserializeBoolean",(function(){return l})),r.d(n,"serializeDate",(function(){return s})),r.d(n,"deserializeDate",(function(){return E})),r.d(n,"serializeError",(function(){return p})),r.d(n,"deserializeError",(function(){return y})),r.d(n,"serializeFunction",(function(){return O})),r.d(n,"deserializeFunction",(function(){return z})),r.d(n,"serializeNumber",(function(){return v})),r.d(n,"deserializeNumber",(function(){return b})),r.d(n,"serializeObject",(function(){return N})),r.d(n,"deserializeObject",(function(){return R})),r.d(n,"serializePromise",(function(){return _})),r.d(n,"deserializePromise",(function(){return m})),r.d(n,"serializeRegex",(function(){return g})),r.d(n,"deserializeRegex",(function(){return T})),r.d(n,"serializeString",(function(){return D})),r.d(n,"deserializeString",(function(){return S})),r.d(n,"serializeNull",(function(){return A})),r.d(n,"deserializeNull",(function(){return U})),r.d(n,"serializeUndefined",(function(){return I})),r.d(n,"deserializeUndefined",(function(){return j})),r.d(n,"TYPE",(function(){return i})),r.d(n,"isSerializedType",(function(){return u})),r.d(n,"determineType",(function(){return o})),r.d(n,"serializeType",(function(){return f})),r.d(n,"TYPES",(function(){return G}));var t,i={FUNCTION:"function",ERROR:"error",PROMISE:"promise",REGEX:"regex",DATE:"date",ARRAY:"array",OBJECT:"object",STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null",UNDEFINED:"undefined"};function u(e){return"object"==typeof e&&null!==e&&"string"==typeof e.__type__}function o(e){return void 0===e?i.UNDEFINED:null===e?i.NULL:Array.isArray(e)?i.ARRAY:"function"==typeof e?i.FUNCTION:"object"==typeof e?e instanceof Error?i.ERROR:"function"==typeof e.then?i.PROMISE:"[object RegExp]"==={}.toString.call(e)?i.REGEX:"[object Date]"==={}.toString.call(e)?i.DATE:i.OBJECT:"string"==typeof e?i.STRING:"number"==typeof e?i.NUMBER:"boolean"==typeof e?i.BOOLEAN:void 0}function f(e,n){return{__type__:e,__val__:n}}function c(e){return e}function a(e){return e}function d(e){return e}function l(e){return e}function s(e){return f(i.DATE,e.toJSON())}function E(e){return new Date(e)}function N(e){return e}function R(e){return e}function p(e){return f(i.ERROR,{message:e.message,stack:e.stack,code:e.code,data:e.data})}function y(e){var n=e.stack,r=e.code,t=e.data,i=new Error(e.message);return i.code=r,t&&(i.data=t),i.stack=n+"\n\n"+i.stack,i}function O(){}function z(){throw new Error("Function serialization is not implemented; nothing to deserialize")}function v(e){return e}function b(e){return e}function _(){}function m(){throw new Error("Promise serialization is not implemented; nothing to deserialize")}function g(e){return f(i.REGEX,e.source)}function T(e){return new RegExp(e)}function D(e){return e}function S(e){return e}function A(e){return e}function U(e){return e}function I(e){return f(i.UNDEFINED,e)}function j(){}var x,B=((t={})[i.FUNCTION]=O,t[i.ERROR]=p,t[i.PROMISE]=_,t[i.REGEX]=g,t[i.DATE]=s,t[i.ARRAY]=c,t[i.OBJECT]=N,t[i.STRING]=D,t[i.NUMBER]=v,t[i.BOOLEAN]=d,t[i.NULL]=A,t[i.UNDEFINED]=I,t),F={};function P(e,n){void 0===n&&(n=F);var r=JSON.stringify(e,(function(e){var r=this[e];if(u(this))return r;var t=o(r);if(!t)return r;var i=n[t]||B[t];return i?i(r,e):r}));return void 0===r?i.UNDEFINED:r}var L=((x={})[i.FUNCTION]=z,x[i.ERROR]=y,x[i.PROMISE]=m,x[i.REGEX]=T,x[i.DATE]=E,x[i.ARRAY]=a,x[i.OBJECT]=R,x[i.STRING]=S,x[i.NUMBER]=b,x[i.BOOLEAN]=l,x[i.NULL]=U,x[i.UNDEFINED]=j,x),M={};function h(e,n){if(void 0===n&&(n=M),e!==i.UNDEFINED)return JSON.parse(e,(function(e,r){if(u(this))return r;var t,i;if(u(r)?(t=r.__type__,i=r.__val__):(t=o(r),i=r),!t)return i;var f=n[t]||L[t];return f?f(i,e):i}))}var G=!0}])})); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("universal-serialize",[],n):"object"==typeof exports?exports["universal-serialize"]=n():e["universal-serialize"]=n()}("undefined"!=typeof self?self:this,(function(){return function(e){var n={};function r(t){if(n[t])return n[t].exports;var i=n[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)r.d(t,i,function(n){return e[n]}.bind(null,i));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return{}.hasOwnProperty.call(e,n)},r.p="",r(r.s=0)}([function(e,n,r){"use strict";r.r(n),r.d(n,"serialize",(function(){return P})),r.d(n,"deserialize",(function(){return h})),r.d(n,"serializeArray",(function(){return c})),r.d(n,"deserializeArray",(function(){return a})),r.d(n,"serializeBoolean",(function(){return d})),r.d(n,"deserializeBoolean",(function(){return l})),r.d(n,"serializeDate",(function(){return s})),r.d(n,"deserializeDate",(function(){return E})),r.d(n,"serializeError",(function(){return p})),r.d(n,"deserializeError",(function(){return y})),r.d(n,"serializeFunction",(function(){return O})),r.d(n,"deserializeFunction",(function(){return z})),r.d(n,"serializeNumber",(function(){return v})),r.d(n,"deserializeNumber",(function(){return b})),r.d(n,"serializeObject",(function(){return N})),r.d(n,"deserializeObject",(function(){return R})),r.d(n,"serializePromise",(function(){return _})),r.d(n,"deserializePromise",(function(){return m})),r.d(n,"serializeRegex",(function(){return g})),r.d(n,"deserializeRegex",(function(){return T})),r.d(n,"serializeString",(function(){return D})),r.d(n,"deserializeString",(function(){return S})),r.d(n,"serializeNull",(function(){return A})),r.d(n,"deserializeNull",(function(){return U})),r.d(n,"serializeUndefined",(function(){return I})),r.d(n,"deserializeUndefined",(function(){return j})),r.d(n,"TYPE",(function(){return i})),r.d(n,"isSerializedType",(function(){return u})),r.d(n,"determineType",(function(){return o})),r.d(n,"serializeType",(function(){return f})),r.d(n,"TYPES",(function(){return G}));var t,i={FUNCTION:"function",ERROR:"error",PROMISE:"promise",REGEX:"regex",DATE:"date",ARRAY:"array",OBJECT:"object",STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null",UNDEFINED:"undefined"};function u(e){return"object"==typeof e&&null!==e&&"string"==typeof e.__type__}function o(e){return void 0===e?i.UNDEFINED:null===e?i.NULL:Array.isArray(e)?i.ARRAY:"function"==typeof e?i.FUNCTION:"object"==typeof e?e instanceof Error?i.ERROR:"function"==typeof e.then?i.PROMISE:"[object RegExp]"==={}.toString.call(e)?i.REGEX:"[object Date]"==={}.toString.call(e)?i.DATE:i.OBJECT:"string"==typeof e?i.STRING:"number"==typeof e?i.NUMBER:"boolean"==typeof e?i.BOOLEAN:void 0}function f(e,n){return{__type__:e,__val__:n}}function c(e){return e}function a(e){return e}function d(e){return e}function l(e){return e}function s(e){return f(i.DATE,e.toJSON())}function E(e){return new Date(e)}function N(e){return e}function R(e){return e}function p(e){return f(i.ERROR,{message:e.message,stack:e.stack,code:e.code,data:e.data})}function y(e){var n=e.stack,r=e.code,t=e.data,i=new Error(e.message);return i.code=r,t&&(i.data=t),i.stack=n+"\n\n"+i.stack,i}function O(){}function z(){throw new Error("Function serialization is not implemented; nothing to deserialize")}function v(e){return e}function b(e){return e}function _(){}function m(){throw new Error("Promise serialization is not implemented; nothing to deserialize")}function g(e){return f(i.REGEX,e.source)}function T(e){return new RegExp(e)}function D(e){return e}function S(e){return e}function A(e){return e}function U(e){return e}function I(e){return f(i.UNDEFINED,e)}function j(){}var x,B=((t={})[i.FUNCTION]=O,t[i.ERROR]=p,t[i.PROMISE]=_,t[i.REGEX]=g,t[i.DATE]=s,t[i.ARRAY]=c,t[i.OBJECT]=N,t[i.STRING]=D,t[i.NUMBER]=v,t[i.BOOLEAN]=d,t[i.NULL]=A,t[i.UNDEFINED]=I,t),F={};function P(e,n){void 0===n&&(n=F);var r=JSON.stringify(e,(function(e){var r,t=this[e];if(u(this))return t;var i=o(t);if(!i)return t;var f=null!=(r=n[i])?r:B[i];return f?f(t,e):t}));return void 0===r?i.UNDEFINED:r}var L=((x={})[i.FUNCTION]=z,x[i.ERROR]=y,x[i.PROMISE]=m,x[i.REGEX]=T,x[i.DATE]=E,x[i.ARRAY]=a,x[i.OBJECT]=R,x[i.STRING]=S,x[i.NUMBER]=b,x[i.BOOLEAN]=l,x[i.NULL]=U,x[i.UNDEFINED]=j,x),M={};function h(e,n){if(void 0===n&&(n=M),e!==i.UNDEFINED)return JSON.parse(e,(function(e,r){var t,i,f;if(u(this))return r;if(u(r)?(i=r.__type__,f=r.__val__):(i=o(r),f=r),!i)return f;var c=null!=(t=n[i])?t:L[i];return c?c(f,e):f}))}var G=!0}])})); | ||
//# sourceMappingURL=universalSerialize.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("universal-serialize",[],n):"object"==typeof exports?exports["universal-serialize"]=n():e["universal-serialize"]=n()}("undefined"!=typeof self?self:this,(function(){return function(e){var n={};function r(t){if(n[t])return n[t].exports;var i=n[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)r.d(t,i,function(n){return e[n]}.bind(null,i));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return{}.hasOwnProperty.call(e,n)},r.p="",r(r.s=0)}([function(e,n,r){"use strict";r.r(n),r.d(n,"serialize",(function(){return P})),r.d(n,"deserialize",(function(){return h})),r.d(n,"serializeArray",(function(){return c})),r.d(n,"deserializeArray",(function(){return a})),r.d(n,"serializeBoolean",(function(){return d})),r.d(n,"deserializeBoolean",(function(){return l})),r.d(n,"serializeDate",(function(){return s})),r.d(n,"deserializeDate",(function(){return E})),r.d(n,"serializeError",(function(){return p})),r.d(n,"deserializeError",(function(){return y})),r.d(n,"serializeFunction",(function(){return O})),r.d(n,"deserializeFunction",(function(){return z})),r.d(n,"serializeNumber",(function(){return v})),r.d(n,"deserializeNumber",(function(){return b})),r.d(n,"serializeObject",(function(){return N})),r.d(n,"deserializeObject",(function(){return R})),r.d(n,"serializePromise",(function(){return _})),r.d(n,"deserializePromise",(function(){return m})),r.d(n,"serializeRegex",(function(){return g})),r.d(n,"deserializeRegex",(function(){return T})),r.d(n,"serializeString",(function(){return D})),r.d(n,"deserializeString",(function(){return S})),r.d(n,"serializeNull",(function(){return A})),r.d(n,"deserializeNull",(function(){return U})),r.d(n,"serializeUndefined",(function(){return I})),r.d(n,"deserializeUndefined",(function(){return j})),r.d(n,"TYPE",(function(){return i})),r.d(n,"isSerializedType",(function(){return u})),r.d(n,"determineType",(function(){return o})),r.d(n,"serializeType",(function(){return f})),r.d(n,"TYPES",(function(){return G}));var t,i={FUNCTION:"function",ERROR:"error",PROMISE:"promise",REGEX:"regex",DATE:"date",ARRAY:"array",OBJECT:"object",STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null",UNDEFINED:"undefined"};function u(e){return"object"==typeof e&&null!==e&&"string"==typeof e.__type__}function o(e){return void 0===e?i.UNDEFINED:null===e?i.NULL:Array.isArray(e)?i.ARRAY:"function"==typeof e?i.FUNCTION:"object"==typeof e?e instanceof Error?i.ERROR:"function"==typeof e.then?i.PROMISE:"[object RegExp]"==={}.toString.call(e)?i.REGEX:"[object Date]"==={}.toString.call(e)?i.DATE:i.OBJECT:"string"==typeof e?i.STRING:"number"==typeof e?i.NUMBER:"boolean"==typeof e?i.BOOLEAN:void 0}function f(e,n){return{__type__:e,__val__:n}}function c(e){return e}function a(e){return e}function d(e){return e}function l(e){return e}function s(e){return f(i.DATE,e.toJSON())}function E(e){return new Date(e)}function N(e){return e}function R(e){return e}function p(e){return f(i.ERROR,{message:e.message,stack:e.stack,code:e.code,data:e.data})}function y(e){var n=e.stack,r=e.code,t=e.data,i=new Error(e.message);return i.code=r,t&&(i.data=t),i.stack=n+"\n\n"+i.stack,i}function O(){}function z(){throw new Error("Function serialization is not implemented; nothing to deserialize")}function v(e){return e}function b(e){return e}function _(){}function m(){throw new Error("Promise serialization is not implemented; nothing to deserialize")}function g(e){return f(i.REGEX,e.source)}function T(e){return new RegExp(e)}function D(e){return e}function S(e){return e}function A(e){return e}function U(e){return e}function I(e){return f(i.UNDEFINED,e)}function j(){}var x,B=((t={})[i.FUNCTION]=O,t[i.ERROR]=p,t[i.PROMISE]=_,t[i.REGEX]=g,t[i.DATE]=s,t[i.ARRAY]=c,t[i.OBJECT]=N,t[i.STRING]=D,t[i.NUMBER]=v,t[i.BOOLEAN]=d,t[i.NULL]=A,t[i.UNDEFINED]=I,t),F={};function P(e,n){void 0===n&&(n=F);var r=JSON.stringify(e,(function(e){var r=this[e];if(u(this))return r;var t=o(r);if(!t)return r;var i=n[t]||B[t];return i?i(r,e):r}));return void 0===r?i.UNDEFINED:r}var L=((x={})[i.FUNCTION]=z,x[i.ERROR]=y,x[i.PROMISE]=m,x[i.REGEX]=T,x[i.DATE]=E,x[i.ARRAY]=a,x[i.OBJECT]=R,x[i.STRING]=S,x[i.NUMBER]=b,x[i.BOOLEAN]=l,x[i.NULL]=U,x[i.UNDEFINED]=j,x),M={};function h(e,n){if(void 0===n&&(n=M),e!==i.UNDEFINED)return JSON.parse(e,(function(e,r){if(u(this))return r;var t,i;if(u(r)?(t=r.__type__,i=r.__val__):(t=o(r),i=r),!t)return i;var f=n[t]||L[t];return f?f(i,e):i}))}var G=!0}])})); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("universal-serialize",[],n):"object"==typeof exports?exports["universal-serialize"]=n():e["universal-serialize"]=n()}("undefined"!=typeof self?self:this,(function(){return function(e){var n={};function r(t){if(n[t])return n[t].exports;var i=n[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)r.d(t,i,function(n){return e[n]}.bind(null,i));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return{}.hasOwnProperty.call(e,n)},r.p="",r(r.s=0)}([function(e,n,r){"use strict";r.r(n),r.d(n,"serialize",(function(){return P})),r.d(n,"deserialize",(function(){return h})),r.d(n,"serializeArray",(function(){return c})),r.d(n,"deserializeArray",(function(){return a})),r.d(n,"serializeBoolean",(function(){return d})),r.d(n,"deserializeBoolean",(function(){return l})),r.d(n,"serializeDate",(function(){return s})),r.d(n,"deserializeDate",(function(){return E})),r.d(n,"serializeError",(function(){return p})),r.d(n,"deserializeError",(function(){return y})),r.d(n,"serializeFunction",(function(){return O})),r.d(n,"deserializeFunction",(function(){return z})),r.d(n,"serializeNumber",(function(){return v})),r.d(n,"deserializeNumber",(function(){return b})),r.d(n,"serializeObject",(function(){return N})),r.d(n,"deserializeObject",(function(){return R})),r.d(n,"serializePromise",(function(){return _})),r.d(n,"deserializePromise",(function(){return m})),r.d(n,"serializeRegex",(function(){return g})),r.d(n,"deserializeRegex",(function(){return T})),r.d(n,"serializeString",(function(){return D})),r.d(n,"deserializeString",(function(){return S})),r.d(n,"serializeNull",(function(){return A})),r.d(n,"deserializeNull",(function(){return U})),r.d(n,"serializeUndefined",(function(){return I})),r.d(n,"deserializeUndefined",(function(){return j})),r.d(n,"TYPE",(function(){return i})),r.d(n,"isSerializedType",(function(){return u})),r.d(n,"determineType",(function(){return o})),r.d(n,"serializeType",(function(){return f})),r.d(n,"TYPES",(function(){return G}));var t,i={FUNCTION:"function",ERROR:"error",PROMISE:"promise",REGEX:"regex",DATE:"date",ARRAY:"array",OBJECT:"object",STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null",UNDEFINED:"undefined"};function u(e){return"object"==typeof e&&null!==e&&"string"==typeof e.__type__}function o(e){return void 0===e?i.UNDEFINED:null===e?i.NULL:Array.isArray(e)?i.ARRAY:"function"==typeof e?i.FUNCTION:"object"==typeof e?e instanceof Error?i.ERROR:"function"==typeof e.then?i.PROMISE:"[object RegExp]"==={}.toString.call(e)?i.REGEX:"[object Date]"==={}.toString.call(e)?i.DATE:i.OBJECT:"string"==typeof e?i.STRING:"number"==typeof e?i.NUMBER:"boolean"==typeof e?i.BOOLEAN:void 0}function f(e,n){return{__type__:e,__val__:n}}function c(e){return e}function a(e){return e}function d(e){return e}function l(e){return e}function s(e){return f(i.DATE,e.toJSON())}function E(e){return new Date(e)}function N(e){return e}function R(e){return e}function p(e){return f(i.ERROR,{message:e.message,stack:e.stack,code:e.code,data:e.data})}function y(e){var n=e.stack,r=e.code,t=e.data,i=new Error(e.message);return i.code=r,t&&(i.data=t),i.stack=n+"\n\n"+i.stack,i}function O(){}function z(){throw new Error("Function serialization is not implemented; nothing to deserialize")}function v(e){return e}function b(e){return e}function _(){}function m(){throw new Error("Promise serialization is not implemented; nothing to deserialize")}function g(e){return f(i.REGEX,e.source)}function T(e){return new RegExp(e)}function D(e){return e}function S(e){return e}function A(e){return e}function U(e){return e}function I(e){return f(i.UNDEFINED,e)}function j(){}var x,B=((t={})[i.FUNCTION]=O,t[i.ERROR]=p,t[i.PROMISE]=_,t[i.REGEX]=g,t[i.DATE]=s,t[i.ARRAY]=c,t[i.OBJECT]=N,t[i.STRING]=D,t[i.NUMBER]=v,t[i.BOOLEAN]=d,t[i.NULL]=A,t[i.UNDEFINED]=I,t),F={};function P(e,n){void 0===n&&(n=F);var r=JSON.stringify(e,(function(e){var r,t=this[e];if(u(this))return t;var i=o(t);if(!i)return t;var f=null!=(r=n[i])?r:B[i];return f?f(t,e):t}));return void 0===r?i.UNDEFINED:r}var L=((x={})[i.FUNCTION]=z,x[i.ERROR]=y,x[i.PROMISE]=m,x[i.REGEX]=T,x[i.DATE]=E,x[i.ARRAY]=a,x[i.OBJECT]=R,x[i.STRING]=S,x[i.NUMBER]=b,x[i.BOOLEAN]=l,x[i.NULL]=U,x[i.UNDEFINED]=j,x),M={};function h(e,n){if(void 0===n&&(n=M),e!==i.UNDEFINED)return JSON.parse(e,(function(e,r){var t,i,f;if(u(this))return r;if(u(r)?(i=r.__type__,f=r.__val__):(i=o(r),f=r),!i)return f;var c=null!=(t=n[i])?t:L[i];return c?c(f,e):f}))}var G=!0}])})); | ||
//# sourceMappingURL=universalSerialize.min.js.map |
/* @flow */ | ||
// $FlowFixMe | ||
module.exports = require('./dist/universal-serialize'); // eslint-disable-line import/no-commonjs | ||
module.exports = require("./dist/universal-serialize"); // eslint-disable-line import/no-commonjs |
{ | ||
"name": "@krakenjs/universal-serialize", | ||
"version": "2.0.0", | ||
"version": "3.0.0-typescript.1", | ||
"description": "Javascript module template.", | ||
"main": "index.js", | ||
"types": "dist/types/index.d.ts", | ||
"scripts": { | ||
"setup": "npm install && npm run flow-typed", | ||
"lint": "eslint src/ test/ *.js --ext .js,.jsx", | ||
"flow-typed": "rm -rf ./flow-typed && flow-typed install && flow-typed install mocha@4", | ||
"flow": "flow", | ||
"karma": "cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start", | ||
"babel": "babel src/ --out-dir dist/module", | ||
"webpack": "babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress", | ||
"test": "npm run lint && npm run flow-typed && npm run flow && npm run karma", | ||
"build": "npm run test && npm run babel && npm run webpack", | ||
"build": "npm run test && npm run babel && npm run webpack && npm run build:types", | ||
"build:flow": "find ./dist -type f -not -path './node_modules/*' -name '*.d.ts' -exec sh -c 'flowgen --add-flow-header $1 -o ${1%.*.*}.js.flow' _ '{}' \\;", | ||
"build:tsc": "tsc src/**/** --outDir ./dist/esm --declaration --emitDeclarationOnly --strict", | ||
"build:types": "npm run build:tsc && npm run build:flow", | ||
"webpack": "cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress", | ||
"babel": "cross-env NODE_ENV=production babel src/ --out-dir ./dist/esm/ --extensions .ts,.tsx", | ||
"tsc": "tsc", | ||
"format": "prettier --write --ignore-unknown .", | ||
"format:check": "prettier --check .", | ||
"test": "npm run format:check && npm run lint && npm run tsc --no-emit && npm run vitest", | ||
"lint": "eslint --ext ts,tsx,js,jsx src/ test/", | ||
"clean": "rimraf dist coverage", | ||
"reinstall": "rimraf flow-typed && rimraf node_modules && npm install && flow-typed install", | ||
"prerelease": "npm run clean && npm run build && git add dist && git commit -m 'ci: check in dist folder' || echo 'Nothing to distribute'", | ||
"release": "standard-version", | ||
"postrelease": "git push && git push --follow-tags && npm publish", | ||
"debug": "cross-env NODE_ENV=debug", | ||
"prepare": "husky install", | ||
"prerelease": "npm run clean && npm run build && git add dist && git commit -m 'ci: check in dist folder' || echo 'Nothing to distribute'", | ||
"release": "standard-version", | ||
"postrelease": "git push && git push --follow-tags && npm publish" | ||
"vitest": "vitest run --dom --coverage", | ||
"vitest:watch": "vitest watch --dom --coverage --ui" | ||
}, | ||
@@ -90,9 +94,26 @@ "standard-version": { | ||
"devDependencies": { | ||
"@commitlint/cli": "^16.2.1", | ||
"@commitlint/config-conventional": "^16.2.1", | ||
"flow-bin": "0.155.0", | ||
"grumbler-scripts": "^5.0.3", | ||
"husky": "^7.0.4", | ||
"standard-version": "^9.3.2" | ||
"@commitlint/cli": "^17.3.0", | ||
"@commitlint/config-conventional": "^17.3.0", | ||
"@krakenjs/babel-config-grumbler": "^8.0.7", | ||
"@krakenjs/eslint-config-grumbler": "^8.0.7", | ||
"@krakenjs/typescript-config-grumbler": "^8.0.7", | ||
"@krakenjs/webpack-config-grumbler": "^8.1.0-alpha.1", | ||
"@vitest/coverage-c8": "^0.25.3", | ||
"@vitest/ui": "^0.25.3", | ||
"cross-env": "^7.0.3", | ||
"flowgen": "^1.20.1", | ||
"happy-dom": "^7.7.0", | ||
"husky": "^8.0.2", | ||
"lint-staged": "^13.0.3", | ||
"prettier": "^2.8.0", | ||
"standard-version": "^9.5.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "4.9.3", | ||
"utility-types": "^3.10.0", | ||
"vite": "^3.2.4", | ||
"vitest": "^0.25.3" | ||
}, | ||
"lint-staged": { | ||
"*": "prettier --write --ignore-unknown" | ||
} | ||
} |
@@ -1,3 +0,2 @@ | ||
Universal Serialize | ||
------------------- | ||
## Universal Serialize | ||
@@ -20,10 +19,9 @@ [![build status][build-badge]][build] | ||
```javascript | ||
import { serialize, deserialize } from 'universal-serialize'; | ||
import { serialize, deserialize } from "universal-serialize"; | ||
// Define a complex object | ||
const originalObject = { | ||
foo: 'bar', | ||
foo: "bar", | ||
date: new Date(), | ||
error: new Error('world') | ||
error: new Error("world"), | ||
}; | ||
@@ -91,4 +89,3 @@ | ||
Quick Start | ||
----------- | ||
## Quick Start | ||
@@ -95,0 +92,0 @@ #### Getting Started |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
121643
97
1109
20
2
140