Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typeson-registry

Package Overview
Dependencies
Maintainers
2
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeson-registry - npm Package Compare versions

Comparing version 10.0.0 to 11.0.0

3

dist/index.d.ts

@@ -47,3 +47,2 @@ export * from "typeson";

export { arraybuffer, bigintObject, bigint, blob, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domquad, domrect, error, errors, file, filelist, imagebitmap, imagedata, infinity, intlTypes, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, primitiveObjects, regexp, resurrectable, set, typedArraysSocketio, typedArrays, undef, userObject, arrayNonindexKeys, builtin, postmessage, socketio, sparseUndefined, specialNumbers, structuredCloningThrowing, structuredCloning, undefPreset, universal };
//# sourceMappingURL=index.d.ts.map
export type * from 'typeson';
//# sourceMappingURL=index.d.ts.map

@@ -1,2 +0,2 @@

function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _typeof(e){return _typeof="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},_typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _createClass(e,t,r){return t&&function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return function _arrayWithHoles(e){if(Array.isArray(e))return e}(e)||function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,c=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,a=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(e,t)||_unsupportedIterableToArray(e,t)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _toPropertyKey(e){var t=function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var e=_createClass((function TypesonPromise(e){_classCallCheck(this,TypesonPromise),this.p=new Promise(e)}));e.__typeson__type__="TypesonPromise","undefined"!=typeof Symbol&&Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function get(){return"TypesonPromise"}}),e.prototype.then=function(t,r){var n=this;return new e((function(e,a){n.p.then((function(r){e(t?t(r):r)})).catch((function(e){return r?r(e):Promise.reject(e)})).then(e,a)}))},e.prototype.catch=function(e){return this.then((function(){}),e)},e.resolve=function(t){return new e((function(e){e(t)}))},e.reject=function(t){return new e((function(e,r){r(t)}))},e.all=function(t){return new e((function(e,r){Promise.all(t.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(e,r)}))},e.race=function(t){return new e((function(e,r){Promise.race(t.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(e,r)}))},e.allSettled=function(t){return new e((function(e,r){Promise.allSettled(t.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(e,r)}))};var t=Object.hasOwn,r=Object.getPrototypeOf;function isThenable(e,t){return isObject(e)&&"function"==typeof e.then&&(!t||"function"==typeof e.catch)}function toStringTag(e){return Object.prototype.toString.call(e).slice(8,-1)}function hasConstructorOf(e,n){if(!e||"object"!==_typeof(e))return!1;var a=r(e);if(!a)return null===n;var o=t(a,"constructor")&&a.constructor;return"function"!=typeof o?null===n:n===o||null!==n&&Function.prototype.toString.call(o)===Function.prototype.toString.call(n)||"function"==typeof n&&"string"==typeof o.__typeson__type__&&o.__typeson__type__===n.__typeson__type__}function isPlainObject(e){return!(!e||"Object"!==toStringTag(e))&&(!r(e)||hasConstructorOf(e,Object))}function isUserObject(e){if(!e||"Object"!==toStringTag(e))return!1;var t=r(e);return!t||hasConstructorOf(e,Object)||isUserObject(t)}function isObject(e){return null!==e&&"object"===_typeof(e)}function escapeKeyPathComponent(e){return e.replaceAll("''","''''").replace(/^$/,"''").replaceAll("~","~0").replaceAll(".","~1")}function unescapeKeyPathComponent(e){return e.replaceAll("~1",".").replaceAll("~0","~").replace(/^''$/,"").replaceAll("''''","''")}function getByKeyPath(e,t){if(""===t)return e;if(null===e||"object"!==_typeof(e))throw new TypeError("Unexpected non-object type");var r=t.indexOf(".");if(r>-1){var n=e[unescapeKeyPathComponent(t.slice(0,r))];return void 0===n?void 0:getByKeyPath(n,t.slice(r+1))}return e[unescapeKeyPathComponent(t)]}function setAtKeyPath(e,t,r){if(""===t)return r;if(!e||"object"!==_typeof(e))throw new TypeError("Unexpected non-object type");var n=t.indexOf(".");return n>-1?setAtKeyPath(e[unescapeKeyPathComponent(t.slice(0,n))],t.slice(n+1),r):(e[unescapeKeyPathComponent(t)]=r,e)}function getJSONType(e){return null===e?"null":Array.isArray(e)?"array":_typeof(e)}function _await(e,t,r){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}var n=Object.keys,a=Object.hasOwn,o=Array.isArray,i=["type","replaced","iterateIn","iterateUnsetNumeric","addLength"];function _async(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function nestedPathsFirst(e,t){var r,n;if(""===e.keypath)return-1;var a=null!==(r=e.keypath.match(/\./g))&&void 0!==r?r:0,o=null!==(n=t.keypath.match(/\./g))&&void 0!==n?n:0;return a&&(a=a.length),o&&(o=o.length),a>o?-1:a<o?1:e.keypath<t.keypath?-1:e.keypath>t.keypath?1:0}var c=function(){function Typeson(e){_classCallCheck(this,Typeson),this.options=e,this.plainObjectReplacers=[],this.nonplainObjectReplacers=[],this.revivers={},this.types={}}return _createClass(Typeson,[{key:"stringify",value:function stringify(e,t,r,n){n=_objectSpread2(_objectSpread2(_objectSpread2({},this.options),n),{},{stringification:!0});var a=this.encapsulate(e,null,n);return o(a)?JSON.stringify(a[0],t,r):a.then((function(e){return JSON.stringify(e,t,r)}))}},{key:"stringifySync",value:function stringifySync(e,t,r,n){return this.stringify(e,t,r,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"stringifyAsync",value:function stringifyAsync(e,t,r,n){return this.stringify(e,t,r,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"parse",value:function parse(e,t,r){return r=_objectSpread2(_objectSpread2(_objectSpread2({},this.options),r),{},{parse:!0}),this.revive(JSON.parse(e,t),r)}},{key:"parseSync",value:function parseSync(e,t,r){return this.parse(e,t,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},r),{},{sync:!0}))}},{key:"parseAsync",value:function parseAsync(e,t,r){return this.parse(e,t,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},r),{},{sync:!1}))}},{key:"specialTypeNames",value:function specialTypeNames(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.returnTypeNames=!0,this.encapsulate(e,t,r)}},{key:"rootTypeName",value:function rootTypeName(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.iterateNone=!0,this.encapsulate(e,t,r)}},{key:"encapsulate",value:function encapsulate(t,r,c){var s=this,u=_objectSpread2(_objectSpread2({sync:!0},this.options),c),l=u.sync,f={},y=[],p=[],d=[],v=!("cyclic"in u)||u.cyclic,m=u.encapsulateObserver,b=function finish(e){var t=Object.values(f);if(u.iterateNone)return t.length?t[0]:getJSONType(e);if(t.length){if(u.returnTypeNames)return function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_unsupportedIterableToArray(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(new Set(t));e&&isPlainObject(e)&&!a(e,"$types")?e.$types=f:e={$:e,$types:{$:f}}}else isObject(e)&&a(e,"$types")&&(e={$:e,$types:!0});return!u.returnTypeNames&&e},h=_async((function(t,r){return _await(Promise.all(r.map((function(e){return e[1].p}))),(function(n){return _await(Promise.all(n.map(_async((function(n){var a=!1,o=[],i=_slicedToArray(r.splice(0,1),1),c=_slicedToArray(i[0],7),s=c[0],u=c[2],l=c[3],f=c[4],y=c[5],p=c[6],d=O(s,n,u,l,o,!0,p),v=hasConstructorOf(d,e);return function _invoke(e,t){var r=e();return r&&r.then?r.then(t):t(r)}((function(){if(s&&v)return _await(d.p,(function(e){f[y]=e;var r=h(t,o);return a=!0,r}))}),(function(e){return a?e:(s?f[y]=d:t=v?d.p:d,h(t,o))}))})))),(function(){return t}))}))})),g=function _adaptBuiltinStateObjectProperties(e,t,r){Object.assign(e,t);var n=i.map((function(t){var r=e[t];return delete e[t],r}));r(),i.forEach((function(t,r){e[t]=n[r]}))},O=function _encapsulate(t,r,i,c,l,d,v){var b,h={},O=_typeof(r),_=m?function(n){var a,o=null!==(a=null!=v?v:c.type)&&void 0!==a?a:getJSONType(r);m(Object.assign(null!=n?n:h,{keypath:t,value:r,cyclic:i,stateObj:c,promisesData:l,resolvingTypesonPromise:d,awaitingTypesonPromise:hasConstructorOf(r,e)},{type:o}))}:null;if(["string","boolean","number","undefined"].includes(O))return void 0===r||Number.isNaN(r)||r===Number.NEGATIVE_INFINITY||r===Number.POSITIVE_INFINITY||0===r?(b=c.replaced?r:w(t,r,c,l,!1,d,_))!==r&&(h={replaced:b}):b=r,_&&_(),b;if(null===r)return _&&_(),r;if(i&&!c.iterateIn&&!c.iterateUnsetNumeric&&r&&"object"===_typeof(r)){var A=y.indexOf(r);if(!(A<0))return f[t]="#",_&&_({cyclicKeypath:p[A]}),"#"+p[A];!0===i&&(y.push(r),p.push(t))}var S,j,T=isPlainObject(r),I=o(r),N=(T||I)&&(!s.plainObjectReplacers.length||c.replaced)||c.iterateIn?r:w(t,r,c,l,T||I,null,_);if(N!==r?(b=N,h={replaced:N}):""===t&&hasConstructorOf(r,e)?(l.push([t,r,i,c,void 0,void 0,c.type]),b=r):I&&"object"!==c.iterateIn||"array"===c.iterateIn?(S=new Array(r.length),h={clone:S}):(["function","symbol"].includes(_typeof(r))||"toJSON"in r||hasConstructorOf(r,e)||hasConstructorOf(r,Promise)||hasConstructorOf(r,ArrayBuffer))&&!T&&"object"!==c.iterateIn?b=r:(S={},c.addLength&&(S.length=r.length),h={clone:S}),_&&_(),u.iterateNone)return null!==(j=S)&&void 0!==j?j:b;if(!S)return b;if(c.iterateIn){var P=function _loop(n){var o={ownKeys:a(r,n)};g(c,o,(function(){var a=t+(t?".":"")+escapeKeyPathComponent(n),o=_encapsulate(a,r[n],Boolean(i),c,l,d);hasConstructorOf(o,e)?l.push([a,o,Boolean(i),c,S,n,c.type]):void 0!==o&&(S[n]=o)}))};for(var x in r)P(x);_&&_({endIterateIn:!0,end:!0})}else n(r).forEach((function(n){var a=t+(t?".":"")+escapeKeyPathComponent(n);g(c,{ownKeys:!0},(function(){var t=_encapsulate(a,r[n],Boolean(i),c,l,d);hasConstructorOf(t,e)?l.push([a,t,Boolean(i),c,S,n,c.type]):void 0!==t&&(S[n]=t)}))})),_&&_({endIterateOwn:!0,end:!0});if(c.iterateUnsetNumeric){for(var E=r.length,C=function _loop2(n){if(!(n in r)){var a="".concat(t).concat(t?".":"").concat(n);g(c,{ownKeys:!1},(function(){var t=_encapsulate(a,void 0,Boolean(i),c,l,d);hasConstructorOf(t,e)?l.push([a,t,Boolean(i),c,S,n,c.type]):void 0!==t&&(S[n]=t)}))}},B=0;B<E;B++)C(B);_&&_({endIterateUnsetNumeric:!0,end:!0})}return S},w=function replace(e,t,r,n,a,o,i){for(var c=a?s.plainObjectReplacers:s.nonplainObjectReplacers,u=c.length;u--;){var y=c[u];if(y.test(t,r)){var p=y.type;if(s.revivers[p]){var d=f[e];f[e]=d?[p].concat(d):p}if(Object.assign(r,{type:p,replaced:!0}),(l||!y.replaceAsync)&&!y.replace)return i&&i({typeDetected:!0}),O(e,t,v&&"readonly",r,n,o,p);i&&i({replacing:!0});var m=void 0;if(l||!y.replaceAsync){if(void 0===y.replace)throw new TypeError("Missing replacer");m=y.replace(t,r)}else m=y.replaceAsync(t,r);return O(e,m,v&&"readonly",r,n,o,p)}}return t},_=O("",t,v,null!=r?r:{},d);if(d.length)return l&&u.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(h(_,d)).then(b);if(!l&&u.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return u.stringification&&l?[b(_)]:l?b(_):Promise.resolve(b(_))}},{key:"encapsulateSync",value:function encapsulateSync(e,t,r){return this.encapsulate(e,t,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},r),{},{sync:!0}))}},{key:"encapsulateAsync",value:function encapsulateAsync(e,t,r){return this.encapsulate(e,t,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},r),{},{sync:!1}))}},{key:"revive",value:function revive(t,r){var a=this,i=_objectSpread2(_objectSpread2({sync:!0},this.options),r),c=i.sync;function finishRevival(e){if(c)return e;if(i.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return Promise.resolve(e)}if(!t||"object"!==_typeof(t)||Array.isArray(t))return finishRevival(t);var u=t.$types;if(!0===u)return finishRevival(t.$);if(!u||"object"!==_typeof(u)||Array.isArray(u))return finishRevival(t);var l=[],f={},y=!0;u.$&&isPlainObject(u.$)&&(t=t.$,u=u.$,y=!1);var p=function executeReviver(e,t){var r,n=_slicedToArray(null!==(r=a.revivers[e])&&void 0!==r?r:[],1)[0];if(!n)throw new Error("Unregistered type: "+e);if(c&&!("revive"in n))return t;if(!c&&n.reviveAsync)return n.reviveAsync(t,f);if(n.revive)return n.revive(t,f);throw new Error("Missing reviver")},d=[];function checkUndefined(e){return hasConstructorOf(e,s)?void 0:e}var v,m=function revivePlainObjects(){var r=[];if(!u)throw new Error("Found bad `types`");if(Object.entries(u).forEach((function(e){var t=_slicedToArray(e,2),n=t[0],o=t[1];"#"!==o&&[].concat(o).forEach((function(e){var t;_slicedToArray(null!==(t=a.revivers[e])&&void 0!==t?t:[null,{}],2)[1].plain&&(r.push({keypath:n,type:e}),delete u[n])}))})),r.length)return r.sort(nestedPathsFirst).reduce((function reducer(r,n){var a=n.keypath,o=n.type;if(isThenable(r))return r.then((function(e){return reducer(e,{keypath:a,type:o})}));var i=getByKeyPath(t,a);if(hasConstructorOf(i=p(o,i),e))return i.then((function(e){var r=setAtKeyPath(t,a,e);r===e&&(t=r)}));var c=setAtKeyPath(t,a,i);c===i&&(t=c)}),void 0)}();return hasConstructorOf(m,e)?v=m.then((function(){return t})):(v=function _revive(t,r,a,i,c){if(!y||"$types"!==t){var f=u[t],v=o(r);if(v||isPlainObject(r)){var m=v?new Array(r.length):{};for(n(r).forEach((function(n){var o=_revive(t+(t?".":"")+escapeKeyPathComponent(n),r[n],null!=a?a:m,m,n),i=function set(e){return hasConstructorOf(e,s)?m[n]=void 0:void 0!==e&&(m[n]=e),e};hasConstructorOf(o,e)?d.push(o.then((function(e){return i(e)}))):i(o)})),r=m;l.length;){var b=_slicedToArray(l[0],4),h=b[0],g=b[1],O=b[2],w=b[3],_=getByKeyPath(h,g);if(void 0===_)break;O[w]=_,l.splice(0,1)}}if(!f)return r;if("#"===f){var A=getByKeyPath(a,r.slice(1));return void 0===A&&l.push([a,r.slice(1),i,c]),A}return[].concat(f).reduce((function reducer(t,r){if(hasConstructorOf(t,e))return t.then((function(e){return reducer(e,r)}));if("string"!=typeof r)throw new TypeError("Bad type JSON");return p(r,t)}),r)}}("",t,null),d.length&&(v=e.resolve(v).then((function(t){return e.all([t].concat(d))})).then((function(e){return _slicedToArray(e,1)[0]})))),isThenable(v)?c&&i.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():hasConstructorOf(v,e)?v.p.then(checkUndefined):v:!c&&i.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():c?checkUndefined(v):Promise.resolve(checkUndefined(v))}},{key:"reviveSync",value:function reviveSync(e,t){return this.revive(e,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},t),{},{sync:!0}))}},{key:"reviveAsync",value:function reviveAsync(e,t){return this.revive(e,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},t),{},{sync:!1}))}},{key:"register",value:function register(e,t){var r=this,a=null!=t?t:{},i=function R(e){o(e)?e.forEach((function(e){return R(e)})):n(e).forEach((function(t){var n;if("#"===t)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(u.includes(t))throw new TypeError("Plain JSON object types are reserved as type names");var i=e[t],c=i&&"function"!=typeof i&&!Array.isArray(i)&&i.testPlainObjects?r.plainObjectReplacers:r.nonplainObjectReplacers,s=c.filter((function(e){return e.type===t}));if(s.length&&(c.splice(c.indexOf(s[0]),1),delete r.revivers[t],delete r.types[t]),"function"==typeof i){var l=i;i={test:function test(e){return e&&e.constructor===l},replace:function replace(e){return _objectSpread2({},e)},revive:function revive(e){return Object.assign(Object.create(l.prototype),e)}}}else if(o(i)){var f=_slicedToArray(i,3);i={test:f[0],replace:f[1],revive:f[2]}}if(null!==(n=i)&&void 0!==n&&n.test){var y={type:t,test:i.test.bind(i)};i.replace&&(y.replace=i.replace.bind(i)),i.replaceAsync&&(y.replaceAsync=i.replaceAsync.bind(i));var p="number"==typeof a.fallback?a.fallback:a.fallback?0:Number.POSITIVE_INFINITY;if(i.testPlainObjects?r.plainObjectReplacers.splice(p,0,y):r.nonplainObjectReplacers.splice(p,0,y),i.revive||i.reviveAsync){var d={};i.revive&&(d.revive=i.revive.bind(i)),i.reviveAsync&&(d.reviveAsync=i.reviveAsync.bind(i)),r.revivers[t]=[d,{plain:i.testPlainObjects}]}r.types[t]=i}}))};return[].concat(e).forEach((function(e){return i(e)})),this}}]),Typeson}(),s=_createClass((function Undefined(){_classCallCheck(this,Undefined)}));s.__typeson__type__="TypesonUndefined";for(var u=["null","boolean","number","string","array","object"],l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=new Uint8Array(256),y=0;y<64;y++)f[l.codePointAt(y)]=y;var p=function encode(e,t,r){null==r&&(r=e.byteLength);for(var n=new Uint8Array(e,0,r),a=n.length,o="",i=0;i<a;i+=3)o+=l[n[i]>>2],o+=l[(3&n[i])<<4|n[i+1]>>4],o+=l[(15&n[i+1])<<2|n[i+2]>>6],o+=l[63&n[i+2]];return a%3==2?o=o.slice(0,-1)+"=":a%3==1&&(o=o.slice(0,-2)+"=="),o},d=function decode(e,t){var r=e.length;if(r%4)throw new Error("Bad base64 length: not divisible by four");var n,a,o,i,c=.75*e.length,s=0;"="===e[e.length-1]&&(c--,"="===e[e.length-2]&&c--);for(var u=new ArrayBuffer(c,t),l=new Uint8Array(u),y=0;y<r;y+=4)n=f[e.codePointAt(y)],a=f[e.codePointAt(y+1)],o=f[e.codePointAt(y+2)],i=f[e.codePointAt(y+3)],l[s++]=n<<2|a>>4,l[s++]=(15&a)<<4|o>>2,l[s++]=(3&o)<<6|63&i;return u};const v={arraybuffer:{test:e=>"ArrayBuffer"===toStringTag(e),replace(e,t){t.buffers||(t.buffers=[]);const r=t.buffers.indexOf(e);return r>-1?{index:r}:(t.buffers.push(e),{s:p(e),maxByteLength:e.maxByteLength})},revive(e,t){if(t.buffers||(t.buffers=[]),Object.hasOwn(e,"index"))return t.buffers[e.index];const r=d(e.s,{maxByteLength:e.maxByteLength});return t.buffers.push(r),r}}},m={bigintObject:{test:e=>"object"==typeof e&&hasConstructorOf(e,BigInt),replace:String,revive:e=>new Object(BigInt(e))}},b={bigint:{test:e=>"bigint"==typeof e,replace:String,revive:e=>BigInt(e)}};function string2arraybuffer(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t.buffer}const h={blob:{test:e=>"Blob"===toStringTag(e),replace(e){const t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return{type:e.type,stringContents:t.responseText}},revive(e){const{type:t,stringContents:r}=e;return new Blob([string2arraybuffer(r)],{type:t})},replaceAsync:t=>new e(((e,r)=>{const n=new FileReader;n.addEventListener("load",(()=>{e({type:t.type,stringContents:n.result})})),n.addEventListener("error",(()=>{r(n.error)})),n.readAsBinaryString(t)}))}};function generateUUID(){let e=Date.now()+("undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():0);return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/gu,(function(t){const r=Math.trunc((e+16*Math.random())%16);return e=Math.floor(e/16),("x"===t?r:3&r|8).toString(16)}))}const g={},O={cloneable:{test:e=>e&&"object"==typeof e&&"function"==typeof e[Symbol.for("cloneEncapsulate")],replace(e){const t=e[Symbol.for("cloneEncapsulate")](),r=generateUUID();return g[r]=e,{uuid:r,encapsulated:t}},revive(e){const{uuid:t,encapsulated:r}=e;return g[t][Symbol.for("cloneRevive")](r)}}},w={cryptokey:{test:e=>"CryptoKey"===toStringTag(e)&&e.extractable,replaceAsync:t=>new e((async(e,r)=>{let n;try{n=await crypto.subtle.exportKey("jwk",t)}catch(e){return void r(e)}e({jwk:n,algorithm:t.algorithm,usages:t.usages})})),revive(e){const{jwk:t,algorithm:r,usages:n}=e;return crypto.subtle.importKey("jwk",t,r,!0,n)}}},_={dataview:{test:e=>"DataView"===toStringTag(e),replace({buffer:e,byteOffset:t,byteLength:r},n){n.buffers||(n.buffers=[]);const a=n.buffers.indexOf(e);return a>-1?{index:a,byteOffset:t,byteLength:r}:(n.buffers.push(e),{encoded:p(e),maxByteLength:e.maxByteLength,byteOffset:t,byteLength:r})},revive(e,t){t.buffers||(t.buffers=[]);const{byteOffset:r,byteLength:n,encoded:a,index:o,maxByteLength:i}=e;let c;return"index"in e?c=t.buffers[o]:(c=d(a,void 0===i?i:{maxByteLength:i}),t.buffers.push(c)),new DataView(c,r,n)}}},A={date:{test:e=>"Date"===toStringTag(e),replace(e){const t=e.getTime();return Number.isNaN(t)?"NaN":t},revive:e=>"NaN"===e?new Date(Number.NaN):new Date(e)}},S={domexception:{test:e=>"DOMException"===toStringTag(e),replace:e=>({name:e.name,message:e.message}),revive:({message:e,name:t})=>new DOMException(e,t)}},j={};function create$5(e){j[e.name.toLowerCase()]={test:t=>toStringTag(t)===e.name,replace:e=>e.is2D?{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}:{m11:e.m11,m12:e.m12,m13:e.m13,m14:e.m14,m21:e.m21,m22:e.m22,m23:e.m23,m24:e.m24,m31:e.m31,m32:e.m32,m33:e.m33,m34:e.m34,m41:e.m41,m42:e.m42,m43:e.m43,m44:e.m44},revive:t=>Object.hasOwn(t,"a")?new e([t.a,t.b,t.c,t.d,t.e,t.f]):new e([t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44])}}"undefined"!=typeof DOMMatrix&&create$5(DOMMatrix),"undefined"!=typeof DOMMatrixReadOnly&&create$5(DOMMatrixReadOnly);const T={};function create$4(e){T[e.name.toLowerCase()]={test:t=>toStringTag(t)===e.name,replace:e=>({x:e.x,y:e.y,z:e.z,w:e.w}),revive:({x:t,y:r,z:n,w:a})=>new e(t,r,n,a)}}"undefined"!=typeof DOMPoint&&create$4(DOMPoint),"undefined"!=typeof DOMPointReadOnly&&create$4(DOMPointReadOnly);const I={domquad:{test:e=>"DOMQuad"===toStringTag(e),replace:e=>({p1:e.p1,p2:e.p2,p3:e.p3,p4:e.p4}),revive:({p1:e,p2:t,p3:r,p4:n})=>new DOMQuad(e,t,r,n)}},N={};function create$3(e){N[e.name.toLowerCase()]={test:t=>toStringTag(t)===e.name,replace:e=>({x:e.x,y:e.y,width:e.width,height:e.height}),revive:({x:t,y:r,width:n,height:a})=>new e(t,r,n,a)}}"undefined"!=typeof DOMRect&&create$3(DOMRect),"undefined"!=typeof DOMRectReadOnly&&create$3(DOMRectReadOnly);const P={error:{test:e=>"Error"===toStringTag(e),replace:({name:e,message:t,cause:r,stack:n,fileName:a,lineNumber:o,columnNumber:i})=>({name:e,message:t,cause:r,stack:n,fileName:a,lineNumber:o,columnNumber:i}),revive(e){const t=new Error(e.message);return t.name=e.name,t.cause=e.cause,t.stack=e.stack,t.fileName=e.fileName,t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}}},x={};function create$2(e){x[e.name.toLowerCase()]={test:t=>hasConstructorOf(t,e),replace:({name:e,message:t,cause:r,stack:n,fileName:a,lineNumber:o,columnNumber:i,errors:c})=>({name:e,message:t,cause:r,stack:n,fileName:a,lineNumber:o,columnNumber:i,errors:c}),revive(t){const r="undefined"!=typeof AggregateError&&e===AggregateError?new e(t.errors,t.message):new e(t.message);return r.name=t.name,r.cause=t.cause,r.stack=t.stack,r.fileName=t.fileName,r.lineNumber=t.lineNumber,r.columnNumber=t.columnNumber,r}}}[TypeError,RangeError,SyntaxError,ReferenceError,EvalError,URIError].forEach((e=>create$2(e))),"undefined"!=typeof AggregateError&&create$2(AggregateError),"function"==typeof InternalError&&create$2(InternalError);const E={file:{test:e=>"File"===toStringTag(e),replace(e){const t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad File access: "+t.status);return{type:e.type,stringContents:t.responseText,name:e.name,lastModified:e.lastModified}},revive:({name:e,type:t,stringContents:r,lastModified:n})=>new File([string2arraybuffer(r)],e,{type:t,lastModified:n}),replaceAsync:t=>new e((function(e,r){const n=new FileReader;n.addEventListener("load",(function(){e({type:t.type,stringContents:n.result,name:t.name,lastModified:t.lastModified})})),n.addEventListener("error",(function(){r(n.error)})),n.readAsBinaryString(t)}))}},C={file:E.file,filelist:{test:e=>"FileList"===toStringTag(e),replace(e){const t=[];for(let r=0;r<e.length;r++)t[r]=e.item(r);return t},revive(e){class FileList{constructor(){this._files=arguments[0],this.length=this._files.length}item(e){return this._files[e]}get[Symbol.toStringTag](){return"FileList"}}return new FileList(e)}}},B={imagebitmap:{test:e=>"ImageBitmap"===toStringTag(e)||e&&e.dataset&&"ImageBitmap"===e.dataset.toStringTag,replace(e){const t=document.createElement("canvas");return t.getContext("2d").drawImage(e,0,0),{width:e.width,height:e.height,dataURL:t.toDataURL()}},revive(e){const t="undefined"==typeof OffscreenCanvas?document.createElement("canvas"):new OffscreenCanvas(e.width,e.height),r=t.getContext("2d"),n=document.createElement("img");return n.addEventListener("load",(function(){r.drawImage(n,0,0)})),n.src=e.dataURL,"undefined"==typeof OffscreenCanvas?t:t.transferToImageBitmap()},reviveAsync(t){const r=document.createElement("canvas"),n=r.getContext("2d"),a=document.createElement("img");return a.addEventListener("load",(function(){n.drawImage(a,0,0)})),a.src=t.dataURL,new e((async(e,t)=>{try{e(await createImageBitmap(r))}catch(e){t(e)}}))}}},k={imagedata:{test:e=>"ImageData"===toStringTag(e),replace:e=>({array:[...e.data],width:e.width,height:e.height}),revive:e=>new ImageData(new Uint8ClampedArray(e.array),e.width,e.height)}},U={infinity:{test:e=>e===Number.POSITIVE_INFINITY,replace:()=>"Infinity",revive:()=>Number.POSITIVE_INFINITY}},M={test:e=>hasConstructorOf(e,Intl.Collator),replace:e=>e.resolvedOptions(),revive:e=>new Intl.Collator(e.locale,e)},L={IntlCollator:M,IntlDateTimeFormat:{test:e=>hasConstructorOf(e,Intl.DateTimeFormat),replace:e=>e.resolvedOptions(),revive:e=>new Intl.DateTimeFormat(e.locale,e)},IntlNumberFormat:{test:e=>hasConstructorOf(e,Intl.NumberFormat),replace:e=>e.resolvedOptions(),revive:e=>new Intl.NumberFormat(e.locale,e)}},D={map:{test:e=>"Map"===toStringTag(e),replace:e=>[...e.entries()],revive:e=>new Map(e)}},K={nan:{test:e=>Number.isNaN(e),replace:()=>"NaN",revive:()=>Number.NaN}},F={negativeInfinity:{test:e=>e===Number.NEGATIVE_INFINITY,replace:()=>"-Infinity",revive:()=>Number.NEGATIVE_INFINITY}},$={negativeZero:{test:e=>Object.is(e,-0),replace:()=>0,revive:()=>-0}},J={nonbuiltinIgnore:{test:e=>e&&"object"==typeof e&&!Array.isArray(e)&&!["Object","Boolean","Number","String","Error","RegExp","Math","Date","Map","Set","JSON","ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","Promise","String Iterator","Array Iterator","Map Iterator","Set Iterator","WeakMap","WeakSet","Atomics","Module"].includes(toStringTag(e)),replace(){}}},V={StringObject:{test:e=>"String"===toStringTag(e)&&"object"==typeof e,replace:String,revive:e=>new String(e)},BooleanObject:{test:e=>"Boolean"===toStringTag(e)&&"object"==typeof e,replace:Boolean,revive:e=>new Boolean(e)},NumberObject:{test:e=>"Number"===toStringTag(e)&&"object"==typeof e,replace:Number,revive:e=>new Number(e)}},q={regexp:{test:e=>"RegExp"===toStringTag(e),replace:e=>({source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":"")}),revive:({source:e,flags:t})=>new RegExp(e,t)}},Y={},W={resurrectable:{test:e=>e&&!Array.isArray(e)&&["object","function","symbol"].includes(typeof e),replace(e){const t=generateUUID();return Y[t]=e,t},revive:e=>Y[e]}},G={set:{test:e=>"Set"===toStringTag(e),replace:e=>[...e.values()],revive:e=>new Set(e)}},H={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,..."function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[]].forEach((e=>function create$1(e){const t=e.name;H[t.toLowerCase()]={test:e=>toStringTag(e)===t,replace:e=>(0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e:e.slice(0)).buffer,revive:t=>"ArrayBuffer"===toStringTag(t)?new e(t):t}}(e)));const z={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,..."function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[]].forEach((e=>function create(e){const t=e.name;z[t.toLowerCase()]={test:e=>toStringTag(e)===t,replace({buffer:e,byteOffset:t,length:r},n){n.buffers||(n.buffers=[]);const a=n.buffers.indexOf(e);return a>-1?{index:a,byteOffset:t,length:r}:(n.buffers.push(e),{maxByteLength:e.maxByteLength,encoded:p(e),byteOffset:t,length:r})},revive(t,r){r.buffers||(r.buffers=[]);const{byteOffset:n,length:a,encoded:o,index:i,maxByteLength:c}=t;let s;return"index"in t?s=r.buffers[i]:(s=d(o,void 0===c?void 0:{maxByteLength:c}),r.buffers.push(s)),new e(s,n,a)}}}(e)));const Q={undef:{test:(e,t)=>void 0===e&&(t.ownKeys||!("ownKeys"in t)),replace:()=>0,revive:()=>new s}},X={userObject:{test:e=>isUserObject(e),replace:e=>({...e}),revive:e=>e}},Z=[{arrayNonindexKeys:{testPlainObjects:!0,test:(e,t)=>!!Array.isArray(e)&&(Object.keys(e).some((e=>String(Number.parseInt(e))!==e))&&(t.iterateIn="object",t.addLength=!0),!0),replace:(e,t)=>(t.iterateUnsetNumeric=!0,e),revive(e){if(Array.isArray(e))return e;const t=[];return Object.entries(e).forEach((([e,r])=>{t[e]=r})),t}}},{sparseUndefined:{test:(e,t)=>void 0===e&&!1===t.ownKeys,replace:()=>0,revive(){}}}],ee=[K,U,F,$],te=[Q,Z,V,ee,A,P,x,q].concat("function"==typeof Map?D:[],"function"==typeof Set?G:[],"function"==typeof ArrayBuffer?v:[],"function"==typeof Uint8Array?z:[],"function"==typeof DataView?_:[],"undefined"!=typeof Intl?L:[],"undefined"!=typeof BigInt?[b,m]:[]),re=[P,x],ne=[te,{arraybuffer:null},H],ae=[{sparseArrays:{testPlainObjects:!0,test:e=>Array.isArray(e),replace:(e,t)=>(t.iterateUnsetNumeric=!0,e)}},{sparseUndefined:{test:(e,t)=>void 0===e&&!1===t.ownKeys,replace:()=>0,revive(){}}}],oe=[X,Q,Z,V,ee,A,q,k,B,E,C,h,P,x].concat("function"==typeof Map?D:[],"function"==typeof Set?G:[],"function"==typeof ArrayBuffer?v:[],"function"==typeof Uint8Array?z:[],"function"==typeof DataView?_:[],"undefined"!=typeof crypto?w:[],"undefined"!=typeof BigInt?[b,m]:[],"undefined"!=typeof DOMException?S:[],"undefined"!=typeof DOMRect?N:[],"undefined"!=typeof DOMPoint?T:[],"undefined"!=typeof DOMQuad?I:[],"undefined"!=typeof DOMMatrix?j:[]),ie=oe.concat({checkDataCloneException:{test(e){const t={}.toString.call(e).slice(8,-1);if(["symbol","function"].includes(typeof e)||["Arguments","Module","Promise","WeakMap","WeakSet","Event","MessageChannel"].includes(t)||e&&"object"==typeof e&&"number"==typeof e.nodeType&&"function"==typeof e.insertBefore)throw new DOMException("The object cannot be cloned.","DataCloneError");return!1}}}),ce=[ae,Q],se=[te];export{u as JSON_TYPES,c as Typeson,e as TypesonPromise,s as Undefined,Z as arrayNonindexKeys,v as arraybuffer,b as bigint,m as bigintObject,h as blob,te as builtin,O as cloneable,w as cryptokey,_ as dataview,A as date,S as domexception,j as dommatrix,T as dompoint,I as domquad,N as domrect,P as error,x as errors,escapeKeyPathComponent,E as file,C as filelist,getByKeyPath,getJSONType,hasConstructorOf,B as imagebitmap,k as imagedata,U as infinity,L as intlTypes,isObject,isPlainObject,isThenable,isUserObject,D as map,K as nan,F as negativeInfinity,$ as negativeZero,J as nonbuiltinIgnore,re as postmessage,V as primitiveObjects,q as regexp,W as resurrectable,G as set,setAtKeyPath,ne as socketio,ae as sparseUndefined,ee as specialNumbers,oe as structuredCloning,ie as structuredCloningThrowing,toStringTag,z as typedArrays,H as typedArraysSocketio,Q as undef,ce as undefPreset,unescapeKeyPathComponent,se as universal,X as userObject};
function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _typeof(e){return _typeof="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},_typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _createClass(e,t,r){return t&&function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return function _arrayWithHoles(e){if(Array.isArray(e))return e}(e)||function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,c=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,a=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(e,t)||_unsupportedIterableToArray(e,t)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _toPropertyKey(e){var t=function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var e=_createClass((function TypesonPromise(e){_classCallCheck(this,TypesonPromise),this.p=new Promise(e)}));e.__typeson__type__="TypesonPromise","undefined"!=typeof Symbol&&Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function get(){return"TypesonPromise"}}),e.prototype.then=function(t,r){var n=this;return new e((function(e,a){n.p.then((function(r){e(t?t(r):r)})).catch((function(e){return r?r(e):Promise.reject(e)})).then(e,a)}))},e.prototype.catch=function(e){return this.then((function(){}),e)},e.resolve=function(t){return new e((function(e){e(t)}))},e.reject=function(t){return new e((function(e,r){r(t)}))},e.all=function(t){return new e((function(e,r){Promise.all(t.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(e,r)}))},e.race=function(t){return new e((function(e,r){Promise.race(t.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(e,r)}))},e.allSettled=function(t){return new e((function(e,r){Promise.allSettled(t.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(e,r)}))};var t=Object.hasOwn,r=Object.getPrototypeOf;function isThenable(e,t){return isObject(e)&&"function"==typeof e.then&&(!t||"function"==typeof e.catch)}function toStringTag(e){return Object.prototype.toString.call(e).slice(8,-1)}function hasConstructorOf(e,n){if(!e||"object"!==_typeof(e))return!1;var a=r(e);if(!a)return null===n;var o=t(a,"constructor")&&a.constructor;return"function"!=typeof o?null===n:n===o||null!==n&&Function.prototype.toString.call(o)===Function.prototype.toString.call(n)||"function"==typeof n&&"string"==typeof o.__typeson__type__&&o.__typeson__type__===n.__typeson__type__}function isPlainObject(e){return!(!e||"Object"!==toStringTag(e))&&(!r(e)||hasConstructorOf(e,Object))}function isUserObject(e){if(!e||"Object"!==toStringTag(e))return!1;var t=r(e);return!t||hasConstructorOf(e,Object)||isUserObject(t)}function isObject(e){return null!==e&&"object"===_typeof(e)}function escapeKeyPathComponent(e){return e.replaceAll("''","''''").replace(/^$/,"''").replaceAll("~","~0").replaceAll(".","~1")}function unescapeKeyPathComponent(e){return e.replaceAll("~1",".").replaceAll("~0","~").replace(/^''$/,"").replaceAll("''''","''")}function getByKeyPath(e,t){if(""===t)return e;if(null===e||"object"!==_typeof(e))throw new TypeError("Unexpected non-object type");var r=t.indexOf(".");if(r>-1){var n=e[unescapeKeyPathComponent(t.slice(0,r))];return void 0===n?void 0:getByKeyPath(n,t.slice(r+1))}return e[unescapeKeyPathComponent(t)]}function setAtKeyPath(e,t,r){if(""===t)return r;if(!e||"object"!==_typeof(e))throw new TypeError("Unexpected non-object type");var n=t.indexOf(".");return n>-1?setAtKeyPath(e[unescapeKeyPathComponent(t.slice(0,n))],t.slice(n+1),r):(e[unescapeKeyPathComponent(t)]=r,e)}function getJSONType(e){return null===e?"null":Array.isArray(e)?"array":_typeof(e)}function _await(e,t,r){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}var n=Object.keys,a=Object.hasOwn,o=Array.isArray,i=["type","replaced","iterateIn","iterateUnsetNumeric","addLength"];function _async(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function nestedPathsFirst(e,t){var r,n;if(""===e.keypath)return-1;var a=null!==(r=e.keypath.match(/\./g))&&void 0!==r?r:0,o=null!==(n=t.keypath.match(/\./g))&&void 0!==n?n:0;return a&&(a=a.length),o&&(o=o.length),a>o?-1:a<o?1:e.keypath<t.keypath?-1:e.keypath>t.keypath?1:0}var c=function(){function Typeson(e){_classCallCheck(this,Typeson),this.options=e,this.plainObjectReplacers=[],this.nonplainObjectReplacers=[],this.revivers={},this.types={}}return _createClass(Typeson,[{key:"stringify",value:function stringify(e,t,r,n){n=_objectSpread2(_objectSpread2(_objectSpread2({},this.options),n),{},{stringification:!0});var a=this.encapsulate(e,null,n);return o(a)?JSON.stringify(a[0],t,r):a.then((function(e){return JSON.stringify(e,t,r)}))}},{key:"stringifySync",value:function stringifySync(e,t,r,n){return this.stringify(e,t,r,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"stringifyAsync",value:function stringifyAsync(e,t,r,n){return this.stringify(e,t,r,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"parse",value:function parse(e,t,r){return r=_objectSpread2(_objectSpread2(_objectSpread2({},this.options),r),{},{parse:!0}),this.revive(JSON.parse(e,t),r)}},{key:"parseSync",value:function parseSync(e,t,r){return this.parse(e,t,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},r),{},{sync:!0}))}},{key:"parseAsync",value:function parseAsync(e,t,r){return this.parse(e,t,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},r),{},{sync:!1}))}},{key:"specialTypeNames",value:function specialTypeNames(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.returnTypeNames=!0,this.encapsulate(e,t,r)}},{key:"rootTypeName",value:function rootTypeName(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.iterateNone=!0,this.encapsulate(e,t,r)}},{key:"encapsulate",value:function encapsulate(t,r,c){var s=this,u=_objectSpread2(_objectSpread2({sync:!0},this.options),c),l=u.sync,f={},y=[],p=[],d=[],v=!("cyclic"in u)||u.cyclic,b=u.encapsulateObserver,h=function finish(e){var t=Object.values(f);if(u.iterateNone)return t.length?t[0]:getJSONType(e);if(t.length){if(u.returnTypeNames)return function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_unsupportedIterableToArray(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(new Set(t));e&&isPlainObject(e)&&!a(e,"$types")?e.$types=f:e={$:e,$types:{$:f}}}else isObject(e)&&a(e,"$types")&&(e={$:e,$types:!0});return!u.returnTypeNames&&e},m=_async((function(t,r){return _await(Promise.all(r.map((function(e){return e[1].p}))),(function(n){return _await(Promise.all(n.map(_async((function(n){var a=!1,o=[],i=_slicedToArray(r.splice(0,1),1),c=_slicedToArray(i[0],7),s=c[0],u=c[2],l=c[3],f=c[4],y=c[5],p=c[6],d=O(s,n,u,l,o,!0,p),v=hasConstructorOf(d,e);return function _invoke(e,t){var r=e();return r&&r.then?r.then(t):t(r)}((function(){if(s&&v)return _await(d.p,(function(e){f[y]=e;var r=m(t,o);return a=!0,r}))}),(function(e){return a?e:(s?f[y]=d:t=v?d.p:d,m(t,o))}))})))),(function(){return t}))}))})),g=function _adaptBuiltinStateObjectProperties(e,t,r){Object.assign(e,t);var n=i.map((function(t){var r=e[t];return delete e[t],r}));r(),i.forEach((function(t,r){e[t]=n[r]}))},O=function _encapsulate(t,r,i,c,l,d,v){var h,m={},O=_typeof(r),_=b?function(n){var a,o=null!==(a=null!=v?v:c.type)&&void 0!==a?a:getJSONType(r);b(Object.assign(null!=n?n:m,{keypath:t,value:r,cyclic:i,stateObj:c,promisesData:l,resolvingTypesonPromise:d,awaitingTypesonPromise:hasConstructorOf(r,e)},{type:o}))}:null;if(["string","boolean","number","undefined"].includes(O))return void 0===r||Number.isNaN(r)||r===Number.NEGATIVE_INFINITY||r===Number.POSITIVE_INFINITY||0===r?(h=c.replaced?r:w(t,r,c,l,!1,d,_))!==r&&(m={replaced:h}):h=r,_&&_(),h;if(null===r)return _&&_(),r;if(i&&!c.iterateIn&&!c.iterateUnsetNumeric&&r&&"object"===_typeof(r)){var A=y.indexOf(r);if(!(A<0))return f[t]="#",_&&_({cyclicKeypath:p[A]}),"#"+p[A];!0===i&&(y.push(r),p.push(t))}var S,j,T=isPlainObject(r),I=o(r),N=(T||I)&&(!s.plainObjectReplacers.length||c.replaced)||c.iterateIn?r:w(t,r,c,l,T||I,null,_);if(N!==r?(h=N,m={replaced:N}):""===t&&hasConstructorOf(r,e)?(l.push([t,r,i,c,void 0,void 0,c.type]),h=r):I&&"object"!==c.iterateIn||"array"===c.iterateIn?(S=new Array(r.length),m={clone:S}):(["function","symbol"].includes(_typeof(r))||"toJSON"in r||hasConstructorOf(r,e)||hasConstructorOf(r,Promise)||hasConstructorOf(r,ArrayBuffer))&&!T&&"object"!==c.iterateIn?h=r:(S={},c.addLength&&(S.length=r.length),m={clone:S}),_&&_(),u.iterateNone)return null!==(j=S)&&void 0!==j?j:h;if(!S)return h;if(c.iterateIn){var P=function _loop(n){var o={ownKeys:a(r,n)};g(c,o,(function(){var a=t+(t?".":"")+escapeKeyPathComponent(n),o=_encapsulate(a,r[n],Boolean(i),c,l,d);hasConstructorOf(o,e)?l.push([a,o,Boolean(i),c,S,n,c.type]):void 0!==o&&(S[n]=o)}))};for(var x in r)P(x);_&&_({endIterateIn:!0,end:!0})}else n(r).forEach((function(n){var a=t+(t?".":"")+escapeKeyPathComponent(n);g(c,{ownKeys:!0},(function(){var t=_encapsulate(a,r[n],Boolean(i),c,l,d);hasConstructorOf(t,e)?l.push([a,t,Boolean(i),c,S,n,c.type]):void 0!==t&&(S[n]=t)}))})),_&&_({endIterateOwn:!0,end:!0});if(c.iterateUnsetNumeric){for(var E=r.length,C=function _loop2(n){if(!(n in r)){var a="".concat(t).concat(t?".":"").concat(n);g(c,{ownKeys:!1},(function(){var t=_encapsulate(a,void 0,Boolean(i),c,l,d);hasConstructorOf(t,e)?l.push([a,t,Boolean(i),c,S,n,c.type]):void 0!==t&&(S[n]=t)}))}},B=0;B<E;B++)C(B);_&&_({endIterateUnsetNumeric:!0,end:!0})}return S},w=function replace(e,t,r,n,a,o,i){for(var c=a?s.plainObjectReplacers:s.nonplainObjectReplacers,u=c.length;u--;){var y=c[u];if(y.test(t,r)){var p=y.type;if(s.revivers[p]){var d=f[e];f[e]=d?[p].concat(d):p}if(Object.assign(r,{type:p,replaced:!0}),(l||!y.replaceAsync)&&!y.replace)return i&&i({typeDetected:!0}),O(e,t,v&&"readonly",r,n,o,p);i&&i({replacing:!0});var b=void 0;if(l||!y.replaceAsync){if(void 0===y.replace)throw new TypeError("Missing replacer");b=y.replace(t,r)}else b=y.replaceAsync(t,r);return O(e,b,v&&"readonly",r,n,o,p)}}return t},_=O("",t,v,null!=r?r:{},d);if(d.length)return l&&u.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(m(_,d)).then(h);if(!l&&u.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return u.stringification&&l?[h(_)]:l?h(_):Promise.resolve(h(_))}},{key:"encapsulateSync",value:function encapsulateSync(e,t,r){return this.encapsulate(e,t,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},r),{},{sync:!0}))}},{key:"encapsulateAsync",value:function encapsulateAsync(e,t,r){return this.encapsulate(e,t,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},r),{},{sync:!1}))}},{key:"revive",value:function revive(t,r){var a=this,i=_objectSpread2(_objectSpread2({sync:!0},this.options),r),c=i.sync;function finishRevival(e){if(c)return e;if(i.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return Promise.resolve(e)}if(!t||"object"!==_typeof(t)||Array.isArray(t))return finishRevival(t);var u=t.$types;if(!0===u)return finishRevival(t.$);if(!u||"object"!==_typeof(u)||Array.isArray(u))return finishRevival(t);var l=[],f={},y=!0;u.$&&isPlainObject(u.$)&&(t=t.$,u=u.$,y=!1);var p=function executeReviver(e,t){var r,n=_slicedToArray(null!==(r=a.revivers[e])&&void 0!==r?r:[],1)[0];if(!n)throw new Error("Unregistered type: "+e);if(c&&!("revive"in n))return t;if(!c&&n.reviveAsync)return n.reviveAsync(t,f);if(n.revive)return n.revive(t,f);throw new Error("Missing reviver")},d=[];function checkUndefined(e){return hasConstructorOf(e,s)?void 0:e}var v,b=function revivePlainObjects(){var r=[];if(!u)throw new Error("Found bad `types`");if(Object.entries(u).forEach((function(e){var t=_slicedToArray(e,2),n=t[0],o=t[1];"#"!==o&&[].concat(o).forEach((function(e){var t;_slicedToArray(null!==(t=a.revivers[e])&&void 0!==t?t:[null,{}],2)[1].plain&&(r.push({keypath:n,type:e}),delete u[n])}))})),r.length)return r.sort(nestedPathsFirst).reduce((function reducer(r,n){var a=n.keypath,o=n.type;if(isThenable(r))return r.then((function(e){return reducer(e,{keypath:a,type:o})}));var i=getByKeyPath(t,a);if(hasConstructorOf(i=p(o,i),e))return i.then((function(e){var r=setAtKeyPath(t,a,e);r===e&&(t=r)}));var c=setAtKeyPath(t,a,i);c===i&&(t=c)}),void 0)}();return hasConstructorOf(b,e)?v=b.then((function(){return t})):(v=function _revive(t,r,a,i,c){if(!y||"$types"!==t){var f=u[t],v=o(r);if(v||isPlainObject(r)){var b=v?new Array(r.length):{};for(n(r).forEach((function(n){var o=_revive(t+(t?".":"")+escapeKeyPathComponent(n),r[n],null!=a?a:b,b,n),i=function set(e){return hasConstructorOf(e,s)?b[n]=void 0:void 0!==e&&(b[n]=e),e};hasConstructorOf(o,e)?d.push(o.then((function(e){return i(e)}))):i(o)})),r=b;l.length;){var h=_slicedToArray(l[0],4),m=h[0],g=h[1],O=h[2],w=h[3],_=getByKeyPath(m,g);if(void 0===_)break;O[w]=_,l.splice(0,1)}}if(!f)return r;if("#"===f){var A=getByKeyPath(a,r.slice(1));return void 0===A&&l.push([a,r.slice(1),i,c]),A}return[].concat(f).reduce((function reducer(t,r){if(hasConstructorOf(t,e))return t.then((function(e){return reducer(e,r)}));if("string"!=typeof r)throw new TypeError("Bad type JSON");return p(r,t)}),r)}}("",t,null),d.length&&(v=e.resolve(v).then((function(t){return e.all([t].concat(d))})).then((function(e){return _slicedToArray(e,1)[0]})))),isThenable(v)?c&&i.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():hasConstructorOf(v,e)?v.p.then(checkUndefined):v:!c&&i.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():c?checkUndefined(v):Promise.resolve(checkUndefined(v))}},{key:"reviveSync",value:function reviveSync(e,t){return this.revive(e,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},t),{},{sync:!0}))}},{key:"reviveAsync",value:function reviveAsync(e,t){return this.revive(e,_objectSpread2(_objectSpread2({throwOnBadSyncType:!0},t),{},{sync:!1}))}},{key:"register",value:function register(e,t){var r=this,a=null!=t?t:{},i=function R(e){o(e)?e.forEach((function(e){return R(e)})):n(e).forEach((function(t){var n;if("#"===t)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(u.includes(t))throw new TypeError("Plain JSON object types are reserved as type names");var i=e[t],c=i&&"function"!=typeof i&&!Array.isArray(i)&&i.testPlainObjects?r.plainObjectReplacers:r.nonplainObjectReplacers,s=c.filter((function(e){return e.type===t}));if(s.length&&(c.splice(c.indexOf(s[0]),1),delete r.revivers[t],delete r.types[t]),"function"==typeof i){var l=i;i={test:function test(e){return e&&e.constructor===l},replace:function replace(e){return _objectSpread2({},e)},revive:function revive(e){return Object.assign(Object.create(l.prototype),e)}}}else if(o(i)){var f=_slicedToArray(i,3);i={test:f[0],replace:f[1],revive:f[2]}}if(null!==(n=i)&&void 0!==n&&n.test){var y={type:t,test:i.test.bind(i)};i.replace&&(y.replace=i.replace.bind(i)),i.replaceAsync&&(y.replaceAsync=i.replaceAsync.bind(i));var p="number"==typeof a.fallback?a.fallback:a.fallback?0:Number.POSITIVE_INFINITY;if(i.testPlainObjects?r.plainObjectReplacers.splice(p,0,y):r.nonplainObjectReplacers.splice(p,0,y),i.revive||i.reviveAsync){var d={};i.revive&&(d.revive=i.revive.bind(i)),i.reviveAsync&&(d.reviveAsync=i.reviveAsync.bind(i)),r.revivers[t]=[d,{plain:i.testPlainObjects}]}r.types[t]=i}}))};return[].concat(e).forEach((function(e){return i(e)})),this}}]),Typeson}(),s=_createClass((function Undefined(){_classCallCheck(this,Undefined)}));s.__typeson__type__="TypesonUndefined";for(var u=["null","boolean","number","string","array","object"],l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=new Uint8Array(256),y=0;y<64;y++)f[l.codePointAt(y)]=y;var p=function encode(e,t,r){null==r&&(r=e.byteLength);for(var n=new Uint8Array(e,0,r),a=n.length,o="",i=0;i<a;i+=3)o+=l[n[i]>>2],o+=l[(3&n[i])<<4|n[i+1]>>4],o+=l[(15&n[i+1])<<2|n[i+2]>>6],o+=l[63&n[i+2]];return a%3==2?o=o.slice(0,-1)+"=":a%3==1&&(o=o.slice(0,-2)+"=="),o},d=function decode(e,t){var r=e.length;if(r%4)throw new Error("Bad base64 length: not divisible by four");var n,a,o,i,c=.75*e.length,s=0;"="===e[e.length-1]&&(c--,"="===e[e.length-2]&&c--);for(var u=new ArrayBuffer(c,t),l=new Uint8Array(u),y=0;y<r;y+=4)n=f[e.codePointAt(y)],a=f[e.codePointAt(y+1)],o=f[e.codePointAt(y+2)],i=f[e.codePointAt(y+3)],l[s++]=n<<2|a>>4,l[s++]=(15&a)<<4|o>>2,l[s++]=(3&o)<<6|63&i;return u};const v={arraybuffer:{test:e=>"ArrayBuffer"===toStringTag(e),replace(e,t){t.buffers||(t.buffers=[]);const r=t.buffers.indexOf(e);return r>-1?{index:r}:(t.buffers.push(e),{s:p(e),maxByteLength:e.maxByteLength})},revive(e,t){if(t.buffers||(t.buffers=[]),Object.hasOwn(e,"index"))return t.buffers[e.index];const r=d(e.s,{maxByteLength:e.maxByteLength});return t.buffers.push(r),r}}},b={bigintObject:{test:e=>"object"==typeof e&&hasConstructorOf(e,BigInt),replace:String,revive:e=>new Object(BigInt(e))}},h={bigint:{test:e=>"bigint"==typeof e,replace:String,revive:e=>BigInt(e)}};function arraybuffer2string(e){return new Uint8Array(e).reduce(((e,t)=>e+String.fromCodePoint(t)),"")}function string2arraybuffer(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t.buffer}const m={blob:{test:e=>"Blob"===toStringTag(e),replace(e){const t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return{type:e.type,stringContents:t.responseText}},revive(e){const{type:t,stringContents:r}=e;return new Blob([string2arraybuffer(r)],{type:t})},replaceAsync:t=>new e(((e,r)=>{const n=new FileReader;n.addEventListener("load",(()=>{e({type:t.type,stringContents:arraybuffer2string(n.result)})})),n.addEventListener("error",(()=>{r(n.error)})),n.readAsArrayBuffer(t)}))}};function generateUUID(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/gu,(function(t){const r=Math.trunc((e+16*Math.random())%16);return e=Math.floor(e/16),("x"===t?r:3&r|8).toString(16)}))}const g={},O={cloneable:{test:e=>e&&"object"==typeof e&&"function"==typeof e[Symbol.for("cloneEncapsulate")],replace(e){const t=e[Symbol.for("cloneEncapsulate")](),r=generateUUID();return g[r]=e,{uuid:r,encapsulated:t}},revive(e){const{uuid:t,encapsulated:r}=e;return g[t][Symbol.for("cloneRevive")](r)}}},w={cryptokey:{test:e=>"CryptoKey"===toStringTag(e)&&e.extractable,replaceAsync:t=>new e((async(e,r)=>{let n;try{n=await crypto.subtle.exportKey("jwk",t)}catch(e){return void r(e)}e({jwk:n,algorithm:t.algorithm,usages:t.usages})})),revive(e){const{jwk:t,algorithm:r,usages:n}=e;return crypto.subtle.importKey("jwk",t,r,!0,n)}}},_={dataview:{test:e=>"DataView"===toStringTag(e),replace({buffer:e,byteOffset:t,byteLength:r},n){n.buffers||(n.buffers=[]);const a=n.buffers.indexOf(e);return a>-1?{index:a,byteOffset:t,byteLength:r}:(n.buffers.push(e),{encoded:p(e),maxByteLength:e.maxByteLength,byteOffset:t,byteLength:r})},revive(e,t){t.buffers||(t.buffers=[]);const{byteOffset:r,byteLength:n,encoded:a,index:o,maxByteLength:i}=e;let c;return"index"in e?c=t.buffers[o]:(c=d(a,void 0===i?i:{maxByteLength:i}),t.buffers.push(c)),new DataView(c,r,n)}}},A={date:{test:e=>"Date"===toStringTag(e),replace(e){const t=e.getTime();return Number.isNaN(t)?"NaN":t},revive:e=>"NaN"===e?new Date(Number.NaN):new Date(e)}},S={domexception:{test:e=>"DOMException"===toStringTag(e),replace:e=>({name:e.name,message:e.message}),revive:({message:e,name:t})=>new DOMException(e,t)}},j={};function create$5(e){j[e.name.toLowerCase()]={test:t=>toStringTag(t)===e.name,replace:e=>e.is2D?{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}:{m11:e.m11,m12:e.m12,m13:e.m13,m14:e.m14,m21:e.m21,m22:e.m22,m23:e.m23,m24:e.m24,m31:e.m31,m32:e.m32,m33:e.m33,m34:e.m34,m41:e.m41,m42:e.m42,m43:e.m43,m44:e.m44},revive:t=>Object.hasOwn(t,"a")?new e([t.a,t.b,t.c,t.d,t.e,t.f]):new e([t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44])}}"undefined"!=typeof DOMMatrix&&create$5(DOMMatrix),"undefined"!=typeof DOMMatrixReadOnly&&create$5(DOMMatrixReadOnly);const T={};function create$4(e){T[e.name.toLowerCase()]={test:t=>toStringTag(t)===e.name,replace:e=>({x:e.x,y:e.y,z:e.z,w:e.w}),revive:({x:t,y:r,z:n,w:a})=>new e(t,r,n,a)}}"undefined"!=typeof DOMPoint&&create$4(DOMPoint),"undefined"!=typeof DOMPointReadOnly&&create$4(DOMPointReadOnly);const I={domquad:{test:e=>"DOMQuad"===toStringTag(e),replace:e=>({p1:e.p1,p2:e.p2,p3:e.p3,p4:e.p4}),revive:({p1:e,p2:t,p3:r,p4:n})=>new DOMQuad(e,t,r,n)}},N={};function create$3(e){N[e.name.toLowerCase()]={test:t=>toStringTag(t)===e.name,replace:e=>({x:e.x,y:e.y,width:e.width,height:e.height}),revive:({x:t,y:r,width:n,height:a})=>new e(t,r,n,a)}}"undefined"!=typeof DOMRect&&create$3(DOMRect),"undefined"!=typeof DOMRectReadOnly&&create$3(DOMRectReadOnly);const P={error:{test:e=>"Error"===toStringTag(e),replace:({name:e,message:t,cause:r,stack:n,fileName:a,lineNumber:o,columnNumber:i})=>({name:e,message:t,cause:r,stack:n,fileName:a,lineNumber:o,columnNumber:i}),revive(e){const t=new Error(e.message);return t.name=e.name,t.cause=e.cause,t.stack=e.stack,t.fileName=e.fileName,t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}}},x={};function create$2(e){x[e.name.toLowerCase()]={test:t=>hasConstructorOf(t,e),replace:({name:e,message:t,cause:r,stack:n,fileName:a,lineNumber:o,columnNumber:i,errors:c})=>({name:e,message:t,cause:r,stack:n,fileName:a,lineNumber:o,columnNumber:i,errors:c}),revive(t){const r="undefined"!=typeof AggregateError&&e===AggregateError?new e(t.errors,t.message):new e(t.message);return r.name=t.name,r.cause=t.cause,r.stack=t.stack,r.fileName=t.fileName,r.lineNumber=t.lineNumber,r.columnNumber=t.columnNumber,r}}}[TypeError,RangeError,SyntaxError,ReferenceError,EvalError,URIError].forEach((e=>create$2(e))),"undefined"!=typeof AggregateError&&create$2(AggregateError),"function"==typeof InternalError&&create$2(InternalError);const E={file:{test:e=>"File"===toStringTag(e),replace(e){const t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad File access: "+t.status);return{type:e.type,stringContents:t.responseText,name:e.name,lastModified:e.lastModified}},revive:({name:e,type:t,stringContents:r,lastModified:n})=>new File([string2arraybuffer(r)],e,{type:t,lastModified:n}),replaceAsync:t=>new e((function(e,r){const n=new FileReader;n.addEventListener("load",(function(){e({type:t.type,stringContents:arraybuffer2string(n.result),name:t.name,lastModified:t.lastModified})})),n.addEventListener("error",(function(){r(n.error)})),n.readAsArrayBuffer(t)}))}},C={file:E.file,filelist:{test:e=>"FileList"===toStringTag(e),replace(e){const t=[];for(let r=0;r<e.length;r++)t[r]=e.item(r);return t},revive(e){class FileList{constructor(){this._files=arguments[0],this.length=this._files.length}item(e){return this._files[e]}get[Symbol.toStringTag](){return"FileList"}}return new FileList(e)}}},B={imagebitmap:{test:e=>"ImageBitmap"===toStringTag(e)||e&&e.dataset&&"ImageBitmap"===e.dataset.toStringTag,replace(e){const t=document.createElement("canvas");return t.getContext("2d").drawImage(e,0,0),{width:e.width,height:e.height,dataURL:t.toDataURL()}},revive(e){const t="undefined"==typeof OffscreenCanvas?document.createElement("canvas"):new OffscreenCanvas(e.width,e.height),r=t.getContext("2d"),n=document.createElement("img");return n.addEventListener("load",(function(){r.drawImage(n,0,0)})),n.src=e.dataURL,"undefined"==typeof OffscreenCanvas?t:t.transferToImageBitmap()},reviveAsync(t){const r=document.createElement("canvas"),n=r.getContext("2d"),a=document.createElement("img");return a.addEventListener("load",(function(){n.drawImage(a,0,0)})),a.src=t.dataURL,new e((async(e,t)=>{try{e(await createImageBitmap(r))}catch(e){t(e)}}))}}},k={imagedata:{test:e=>"ImageData"===toStringTag(e),replace:e=>({array:[...e.data],width:e.width,height:e.height}),revive:e=>new ImageData(new Uint8ClampedArray(e.array),e.width,e.height)}},U={infinity:{test:e=>e===Number.POSITIVE_INFINITY,replace:()=>"Infinity",revive:()=>Number.POSITIVE_INFINITY}},M={test:e=>hasConstructorOf(e,Intl.Collator),replace:e=>e.resolvedOptions(),revive:e=>new Intl.Collator(e.locale,e)},L={IntlCollator:M,IntlDateTimeFormat:{test:e=>hasConstructorOf(e,Intl.DateTimeFormat),replace:e=>e.resolvedOptions(),revive:e=>new Intl.DateTimeFormat(e.locale,e)},IntlNumberFormat:{test:e=>hasConstructorOf(e,Intl.NumberFormat),replace:e=>e.resolvedOptions(),revive:e=>new Intl.NumberFormat(e.locale,e)}},D={map:{test:e=>"Map"===toStringTag(e),replace:e=>[...e.entries()],revive:e=>new Map(e)}},K={nan:{test:e=>Number.isNaN(e),replace:()=>"NaN",revive:()=>Number.NaN}},F={negativeInfinity:{test:e=>e===Number.NEGATIVE_INFINITY,replace:()=>"-Infinity",revive:()=>Number.NEGATIVE_INFINITY}},$={negativeZero:{test:e=>Object.is(e,-0),replace:()=>0,revive:()=>-0}},J={nonbuiltinIgnore:{test:e=>e&&"object"==typeof e&&!Array.isArray(e)&&!["Object","Boolean","Number","String","Error","RegExp","Math","Date","Map","Set","JSON","ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","Promise","String Iterator","Array Iterator","Map Iterator","Set Iterator","WeakMap","WeakSet","Atomics","Module"].includes(toStringTag(e)),replace(){}}},V={StringObject:{test:e=>"String"===toStringTag(e)&&"object"==typeof e,replace:String,revive:e=>new String(e)},BooleanObject:{test:e=>"Boolean"===toStringTag(e)&&"object"==typeof e,replace:Boolean,revive:e=>new Boolean(e)},NumberObject:{test:e=>"Number"===toStringTag(e)&&"object"==typeof e,replace:Number,revive:e=>new Number(e)}},q={regexp:{test:e=>"RegExp"===toStringTag(e),replace:e=>({source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":"")}),revive:({source:e,flags:t})=>new RegExp(e,t)}},Y={},W={resurrectable:{test:e=>e&&!Array.isArray(e)&&["object","function","symbol"].includes(typeof e),replace(e){const t=generateUUID();return Y[t]=e,t},revive:e=>Y[e]}},G={set:{test:e=>"Set"===toStringTag(e),replace:e=>[...e.values()],revive:e=>new Set(e)}},H={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,..."function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[]].forEach((e=>function create$1(e){const t=e.name;H[t.toLowerCase()]={test:e=>toStringTag(e)===t,replace:e=>(0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e:e.slice(0)).buffer,revive:t=>"ArrayBuffer"===toStringTag(t)?new e(t):t}}(e)));const z={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,..."function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[]].forEach((e=>function create(e){const t=e.name;z[t.toLowerCase()]={test:e=>toStringTag(e)===t,replace({buffer:e,byteOffset:t,length:r},n){n.buffers||(n.buffers=[]);const a=n.buffers.indexOf(e);return a>-1?{index:a,byteOffset:t,length:r}:(n.buffers.push(e),{maxByteLength:e.maxByteLength,encoded:p(e),byteOffset:t,length:r})},revive(t,r){r.buffers||(r.buffers=[]);const{byteOffset:n,length:a,encoded:o,index:i,maxByteLength:c}=t;let s;return"index"in t?s=r.buffers[i]:(s=d(o,void 0===c?void 0:{maxByteLength:c}),r.buffers.push(s)),new e(s,n,a)}}}(e)));const Q={undef:{test:(e,t)=>void 0===e&&(t.ownKeys||!("ownKeys"in t)),replace:()=>0,revive:()=>new s}},X={userObject:{test:e=>isUserObject(e),replace:e=>({...e}),revive:e=>e}},Z=[{arrayNonindexKeys:{testPlainObjects:!0,test:(e,t)=>!!Array.isArray(e)&&(Object.keys(e).some((e=>String(Number.parseInt(e))!==e))&&(t.iterateIn="object",t.addLength=!0),!0),replace:(e,t)=>(t.iterateUnsetNumeric=!0,e),revive(e){if(Array.isArray(e))return e;const t=[];return Object.entries(e).forEach((([e,r])=>{t[e]=r})),t}}},{sparseUndefined:{test:(e,t)=>void 0===e&&!1===t.ownKeys,replace:()=>0,revive(){}}}],ee=[K,U,F,$],te=[Q,Z,V,ee,A,P,x,q].concat("function"==typeof Map?D:[],"function"==typeof Set?G:[],"function"==typeof ArrayBuffer?v:[],"function"==typeof Uint8Array?z:[],"function"==typeof DataView?_:[],"undefined"!=typeof Intl?L:[],"undefined"!=typeof BigInt?[h,b]:[]),re=[P,x],ne=[te,{arraybuffer:null},H],ae=[{sparseArrays:{testPlainObjects:!0,test:e=>Array.isArray(e),replace:(e,t)=>(t.iterateUnsetNumeric=!0,e)}},{sparseUndefined:{test:(e,t)=>void 0===e&&!1===t.ownKeys,replace:()=>0,revive(){}}}],oe=[X,Q,Z,V,ee,A,q,k,B,E,C,m,P,x].concat("function"==typeof Map?D:[],"function"==typeof Set?G:[],"function"==typeof ArrayBuffer?v:[],"function"==typeof Uint8Array?z:[],"function"==typeof DataView?_:[],"undefined"!=typeof crypto?w:[],"undefined"!=typeof BigInt?[h,b]:[],"undefined"!=typeof DOMException?S:[],"undefined"!=typeof DOMRect?N:[],"undefined"!=typeof DOMPoint?T:[],"undefined"!=typeof DOMQuad?I:[],"undefined"!=typeof DOMMatrix?j:[]),ie=oe.concat({checkDataCloneException:{test(e){const t={}.toString.call(e).slice(8,-1);if(["symbol","function"].includes(typeof e)||["Arguments","Module","Promise","WeakMap","WeakSet","Event","MessageChannel"].includes(t)||e&&"object"==typeof e&&"number"==typeof e.nodeType&&"function"==typeof e.insertBefore)throw new DOMException("The object cannot be cloned.","DataCloneError");return!1}}}),ce=[ae,Q],se=[te];export{u as JSON_TYPES,c as Typeson,e as TypesonPromise,s as Undefined,Z as arrayNonindexKeys,v as arraybuffer,h as bigint,b as bigintObject,m as blob,te as builtin,O as cloneable,w as cryptokey,_ as dataview,A as date,S as domexception,j as dommatrix,T as dompoint,I as domquad,N as domrect,P as error,x as errors,escapeKeyPathComponent,E as file,C as filelist,getByKeyPath,getJSONType,hasConstructorOf,B as imagebitmap,k as imagedata,U as infinity,L as intlTypes,isObject,isPlainObject,isThenable,isUserObject,D as map,K as nan,F as negativeInfinity,$ as negativeZero,J as nonbuiltinIgnore,re as postmessage,V as primitiveObjects,q as regexp,W as resurrectable,G as set,setAtKeyPath,ne as socketio,ae as sparseUndefined,ee as specialNumbers,oe as structuredCloning,ie as structuredCloningThrowing,toStringTag,z as typedArrays,H as typedArraysSocketio,Q as undef,ce as undefPreset,unescapeKeyPathComponent,se as universal,X as userObject};
//# sourceMappingURL=index.min.js.map

@@ -5,3 +5,3 @@ export default arrayNonindexKeys;

*/
declare const arrayNonindexKeys: import('typeson').Preset;
declare const arrayNonindexKeys: import("typeson").Preset;
//# sourceMappingURL=array-nonindex-keys.d.ts.map

@@ -5,3 +5,3 @@ export default expObj;

*/
declare const expObj: import('typeson').Preset;
declare const expObj: import("typeson").Preset;
//# sourceMappingURL=builtin.d.ts.map

@@ -5,3 +5,3 @@ export default postmessage;

*/
declare const postmessage: import('typeson').Preset;
declare const postmessage: import("typeson").Preset;
//# sourceMappingURL=postmessage.d.ts.map

@@ -5,3 +5,3 @@ export default socketio;

*/
declare const socketio: import('typeson').Preset;
declare const socketio: import("typeson").Preset;
//# sourceMappingURL=socketio.d.ts.map

@@ -5,3 +5,3 @@ export default sparseUndefined;

*/
declare const sparseUndefined: import('typeson').Preset;
declare const sparseUndefined: import("typeson").Preset;
//# sourceMappingURL=sparse-undefined.d.ts.map

@@ -5,3 +5,3 @@ export default specialNumbers;

*/
declare const specialNumbers: import('typeson').Preset;
declare const specialNumbers: import("typeson").Preset;
//# sourceMappingURL=special-numbers.d.ts.map

@@ -5,3 +5,3 @@ export default structuredCloningThrowing;

*/
declare const structuredCloningThrowing: import('typeson').Preset;
declare const structuredCloningThrowing: import("typeson").Preset;
//# sourceMappingURL=structured-cloning-throwing.d.ts.map

@@ -5,3 +5,3 @@ export default expObj;

*/
declare const expObj: import('typeson').Preset;
declare const expObj: import("typeson").Preset;
//# sourceMappingURL=structured-cloning.d.ts.map

@@ -5,3 +5,3 @@ export default undef;

*/
declare const undef: import('typeson').Preset;
declare const undef: import("typeson").Preset;
//# sourceMappingURL=undef.d.ts.map

@@ -5,3 +5,3 @@ export default universal;

*/
declare const universal: import('typeson').Preset;
declare const universal: import("typeson").Preset;
//# sourceMappingURL=universal.d.ts.map

@@ -5,3 +5,3 @@ export default arraybuffer;

*/
declare const arraybuffer: import('typeson').TypeSpecSet;
declare const arraybuffer: import("typeson").TypeSpecSet;
//# sourceMappingURL=arraybuffer.d.ts.map

@@ -5,3 +5,3 @@ export default bigintObject;

*/
declare const bigintObject: import('typeson').TypeSpecSet;
declare const bigintObject: import("typeson").TypeSpecSet;
//# sourceMappingURL=bigint-object.d.ts.map

@@ -5,3 +5,3 @@ export default bigint;

*/
declare const bigint: import('typeson').TypeSpecSet;
declare const bigint: import("typeson").TypeSpecSet;
//# sourceMappingURL=bigint.d.ts.map

@@ -5,3 +5,3 @@ export default blob;

*/
declare const blob: import('typeson').TypeSpecSet;
declare const blob: import("typeson").TypeSpecSet;
//# sourceMappingURL=blob.d.ts.map

@@ -5,3 +5,3 @@ export default cloneable;

*/
declare const cloneable: import('typeson').TypeSpecSet;
declare const cloneable: import("typeson").TypeSpecSet;
//# sourceMappingURL=cloneable.d.ts.map

@@ -5,3 +5,3 @@ export default cryptokey;

*/
declare const cryptokey: import('typeson').TypeSpecSet;
declare const cryptokey: import("typeson").TypeSpecSet;
//# sourceMappingURL=cryptokey.d.ts.map

@@ -5,3 +5,3 @@ export default dataview;

*/
declare const dataview: import('typeson').TypeSpecSet;
declare const dataview: import("typeson").TypeSpecSet;
//# sourceMappingURL=dataview.d.ts.map

@@ -5,3 +5,3 @@ export default date;

*/
declare const date: import('typeson').TypeSpecSet;
declare const date: import("typeson").TypeSpecSet;
//# sourceMappingURL=date.d.ts.map

@@ -5,3 +5,3 @@ export default domexception;

*/
declare const domexception: import('typeson').TypeSpecSet;
declare const domexception: import("typeson").TypeSpecSet;
//# sourceMappingURL=domexception.d.ts.map

@@ -5,3 +5,3 @@ export default dommatrix;

*/
declare const dommatrix: import('typeson').TypeSpecSet;
declare const dommatrix: import("typeson").TypeSpecSet;
//# sourceMappingURL=dommatrix.d.ts.map

@@ -5,3 +5,3 @@ export default dompoint;

*/
declare const dompoint: import('typeson').TypeSpecSet;
declare const dompoint: import("typeson").TypeSpecSet;
//# sourceMappingURL=dompoint.d.ts.map

@@ -5,3 +5,3 @@ export default domquad;

*/
declare const domquad: import('typeson').TypeSpecSet;
declare const domquad: import("typeson").TypeSpecSet;
//# sourceMappingURL=domquad.d.ts.map

@@ -5,3 +5,3 @@ export default domrect;

*/
declare const domrect: import('typeson').TypeSpecSet;
declare const domrect: import("typeson").TypeSpecSet;
//# sourceMappingURL=domrect.d.ts.map

@@ -5,3 +5,3 @@ export default error;

*/
declare const error: import('typeson').TypeSpecSet;
declare const error: import("typeson").TypeSpecSet;
//# sourceMappingURL=error.d.ts.map

@@ -12,3 +12,3 @@ export default errors;

*/
declare const errors: import('typeson').TypeSpecSet;
declare const errors: import("typeson").TypeSpecSet;
//# sourceMappingURL=errors.d.ts.map

@@ -5,3 +5,3 @@ export default file;

*/
declare const file: import('typeson').TypeSpecSet;
declare const file: import("typeson").TypeSpecSet;
//# sourceMappingURL=file.d.ts.map

@@ -5,3 +5,3 @@ export default filelist;

*/
declare const filelist: import('typeson').TypeSpecSet;
declare const filelist: import("typeson").TypeSpecSet;
//# sourceMappingURL=filelist.d.ts.map

@@ -5,3 +5,3 @@ export default imagebitmap;

*/
declare const imagebitmap: import('typeson').TypeSpecSet;
declare const imagebitmap: import("typeson").TypeSpecSet;
//# sourceMappingURL=imagebitmap.d.ts.map

@@ -5,3 +5,3 @@ export default imagedata;

*/
declare const imagedata: import('typeson').TypeSpecSet;
declare const imagedata: import("typeson").TypeSpecSet;
//# sourceMappingURL=imagedata.d.ts.map

@@ -5,3 +5,3 @@ export default infinity;

*/
declare const infinity: import('typeson').TypeSpecSet;
declare const infinity: import("typeson").TypeSpecSet;
//# sourceMappingURL=infinity.d.ts.map

@@ -10,11 +10,11 @@ export default intlTypes;

*/
declare const IntlCollator: import('typeson').Spec;
declare const IntlCollator: import("typeson").Spec;
/**
* @type {import('typeson').Spec}
*/
declare const IntlDateTimeFormat: import('typeson').Spec;
declare const IntlDateTimeFormat: import("typeson").Spec;
/**
* @type {import('typeson').Spec}
*/
declare const IntlNumberFormat: import('typeson').Spec;
declare const IntlNumberFormat: import("typeson").Spec;
//# sourceMappingURL=intl-types.d.ts.map

@@ -5,3 +5,3 @@ export default map;

*/
declare const map: import('typeson').TypeSpecSet;
declare const map: import("typeson").TypeSpecSet;
//# sourceMappingURL=map.d.ts.map

@@ -5,3 +5,3 @@ export default nan;

*/
declare const nan: import('typeson').TypeSpecSet;
declare const nan: import("typeson").TypeSpecSet;
//# sourceMappingURL=nan.d.ts.map

@@ -5,3 +5,3 @@ export default negativeInfinity;

*/
declare const negativeInfinity: import('typeson').TypeSpecSet;
declare const negativeInfinity: import("typeson").TypeSpecSet;
//# sourceMappingURL=negative-infinity.d.ts.map

@@ -5,3 +5,3 @@ export default negativeZero;

*/
declare const negativeZero: import('typeson').TypeSpecSet;
declare const negativeZero: import("typeson").TypeSpecSet;
//# sourceMappingURL=negative-zero.d.ts.map

@@ -5,3 +5,3 @@ export default nonbuiltinIgnore;

*/
declare const nonbuiltinIgnore: import('typeson').TypeSpecSet;
declare const nonbuiltinIgnore: import("typeson").TypeSpecSet;
//# sourceMappingURL=nonbuiltin-ignore.d.ts.map

@@ -5,3 +5,3 @@ export default primitiveObjects;

*/
declare const primitiveObjects: import('typeson').TypeSpecSet;
declare const primitiveObjects: import("typeson").TypeSpecSet;
//# sourceMappingURL=primitive-objects.d.ts.map

@@ -5,3 +5,3 @@ export default regexp;

*/
declare const regexp: import('typeson').TypeSpecSet;
declare const regexp: import("typeson").TypeSpecSet;
//# sourceMappingURL=regexp.d.ts.map

@@ -5,3 +5,3 @@ export default resurrectable;

*/
declare const resurrectable: import('typeson').TypeSpecSet;
declare const resurrectable: import("typeson").TypeSpecSet;
//# sourceMappingURL=resurrectable.d.ts.map

@@ -5,3 +5,3 @@ export default set;

*/
declare const set: import('typeson').TypeSpecSet;
declare const set: import("typeson").TypeSpecSet;
//# sourceMappingURL=set.d.ts.map

@@ -5,3 +5,3 @@ export default typedArraysSocketIO;

*/
declare const typedArraysSocketIO: import('typeson').TypeSpecSet;
declare const typedArraysSocketIO: import("typeson").TypeSpecSet;
//# sourceMappingURL=typed-arrays-socketio.d.ts.map

@@ -6,3 +6,3 @@ export default typedArrays;

*/
declare const typedArrays: import('typeson').TypeSpecSet;
declare const typedArrays: import("typeson").TypeSpecSet;
//# sourceMappingURL=typed-arrays.d.ts.map

@@ -5,3 +5,3 @@ export default undef;

*/
declare const undef: import('typeson').TypeSpecSet;
declare const undef: import("typeson").TypeSpecSet;
//# sourceMappingURL=undef.d.ts.map

@@ -5,3 +5,3 @@ export default userObject;

*/
declare const userObject: import('typeson').TypeSpecSet;
declare const userObject: import("typeson").TypeSpecSet;
//# sourceMappingURL=user-object.d.ts.map
{
"name": "typeson-registry",
"version": "10.0.0",
"version": "11.0.0",
"description": "The type registry for typeson",

@@ -24,20 +24,2 @@ "author": "dfahlander",

},
"scripts": {
"tsc": "tsc && node tools/append-to-declaration-files.js",
"prepublishOnly": "pnpm i",
"eslint": "eslint --ext js,md,html .",
"lint": "npm run eslint --",
"start": "static -p 8085",
"rollup": "node ./build.js",
"build": "npm run rollup && tsc -p tsconfig-build.json",
"mocha": "mocha --require chai/register-expect.js --require chai/register-assert.js test/*.js",
"open-coverage": "open-cli http://localhost:8085/coverage/ && npm start",
"coverage": "rm -Rf node_modules/.cache && c8 npm run mocha",
"test-nocov": "npm run build && npm run eslint && npm run coverage",
"test": "npm run build && npm run eslint && npm run coverage",
"test:worker-open": "open-cli http://localhost:8085/browser-test/worker.html && npm start",
"test:browser-open": "open-cli http://localhost:8085/browser-test/ && npm start",
"test:browser": "npm run build && npm run eslint && npm run test:browser-open",
"windows": "node windows-devinstall"
},
"c8": {

@@ -84,8 +66,8 @@ "reporter": [

"engines": {
"node": ">=18.0.0"
"node": ">=18.14.0"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/eslint-parser": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/core": "^7.24.9",
"@babel/eslint-parser": "^7.24.8",
"@babel/preset-env": "^7.24.8",
"@brettz9/eslint-plugin": "^1.0.4",

@@ -97,16 +79,17 @@ "@brettz9/node-static": "^0.1.1",

"@rollup/plugin-terser": "^0.4.4",
"@stylistic/eslint-plugin": "^1.8.1",
"@types/chai": "^4.3.16",
"@types/jsdom": "^21.1.7",
"@types/mocha": "^10.0.6",
"@types/mocha": "^10.0.7",
"@types/semver": "^7.5.8",
"@types/whatwg-url": "^11.0.5",
"c8": "^9.1.0",
"c8": "^10.1.2",
"canvas": "^2.11.2",
"chai": "^5.1.1",
"eslint": "^8.56.0",
"eslint-config-ash-nazg": "^35.1.0",
"eslint": "^8.57.0",
"eslint-config-ash-nazg": "^35.4.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-array-func": "^4.0.0",
"eslint-plugin-chai-expect": "^3.0.0",
"eslint-plugin-chai-friendly": "^0.7.2",
"eslint-plugin-chai-expect": "^3.1.0",
"eslint-plugin-chai-friendly": "^0.7.4",
"eslint-plugin-compat": "^4.2.0",

@@ -116,19 +99,19 @@ "eslint-plugin-eslint-comments": "^3.2.0",

"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^46.9.1",
"eslint-plugin-jsdoc": "^48.7.0",
"eslint-plugin-markdown": "^3.0.1",
"eslint-plugin-n": "^16.4.0",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-no-unsanitized": "^4.0.2",
"eslint-plugin-no-use-extend-native": "^0.5.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-promise": "^6.4.0",
"eslint-plugin-sonarjs": "^0.23.0",
"eslint-plugin-standard": "^4.1.0",
"eslint-plugin-unicorn": "^49.0.0",
"jsdom": "^21.1.2",
"mocha": "^10.4.0",
"eslint-plugin-unicorn": "^51.0.1",
"jsdom": "^24.1.0",
"mocha": "^10.6.0",
"open-cli": "^8.0.0",
"rollup": "^4.18.0",
"rollup": "^4.18.1",
"semver": "^7.6.2",
"socket.io": "^4.7.5",
"socket.io-client": "^4.7.5",
"typescript": "^5.4.5"
"typescript": "^5.5.3"
},

@@ -140,3 +123,20 @@ "dependencies": {

},
"tonicExample": "var Typeson = require('typeson');\nvar TSON = new Typeson().register(require('typeson-registry/dist/presets/builtin'));\n\nTSON.stringify({foo: new Date()}, null, 2);"
}
"tonicExample": "var Typeson = require('typeson');\nvar TSON = new Typeson().register(require('typeson-registry/dist/presets/builtin'));\n\nTSON.stringify({foo: new Date()}, null, 2);",
"scripts": {
"tsc": "tsc && node tools/append-to-declaration-files.js",
"eslint": "eslint --ext js,md,html .",
"lint": "npm run eslint --",
"start": "static -p 8085",
"rollup": "node ./build.js",
"build": "npm run rollup && tsc -p tsconfig-build.json",
"mocha": "mocha --require chai/register-expect.js --require chai/register-assert.js test/*.js",
"open-coverage": "open-cli http://localhost:8085/coverage/ && npm start",
"coverage": "rm -Rf node_modules/.cache && c8 npm run mocha",
"test-nocov": "npm run build && npm run eslint && npm run coverage",
"test": "npm run build && npm run eslint && npm run coverage",
"test:worker-open": "open-cli http://localhost:8085/browser-test/worker.html && npm start",
"test:browser-open": "open-cli http://localhost:8085/browser-test/ && npm start",
"test:browser": "npm run build && npm run eslint && npm run test:browser-open",
"windows": "node windows-devinstall"
}
}

@@ -12,3 +12,2 @@ // @ts-nocheck -- jsdom has no types

// These are not working well with Rollup as imports
// We also need to tweak `XMLHttpRequest` which our types

@@ -23,10 +22,2 @@ // rely on to obtain the Blob/File content

/*
both are problematic:
eslint-disable-next-line n/no-unpublished-import
eslint-disable n/file-extension-in-import, import/extensions
import {serializeURLOrigin, parseURL} from 'whatwg-url';
import utils from 'jsdom/lib/jsdom/living/generated/utils';
*/
/**

@@ -114,2 +105,3 @@ * @type {{[key: string]: Blob}}

const encoded = implForWrapper(blob)._buffer.toString('binary');
// Not usable in jsdom which makes properties readonly,

@@ -132,2 +124,6 @@ // but local-xmlhttprequest can use (and jsdom can

};
// As of jsdom 22.0.0, this is needed as the code below will
// have its own effects in overriding `responseText`
return undefined;
}

@@ -134,0 +130,0 @@ // The presence of `XMLHttpRequest.prototype.overrideMimeType`

@@ -53,6 +53,2 @@ # typeson-registry

The `cloneable` and `resurrectable` types (and the `createObjectURL`
polyill) each accept an optional global `performance` polyfill (through
the common file `utils/generateUUID.js`).
### Building files from Git clone (as opposed to npm installs)

@@ -59,0 +55,0 @@

@@ -1,3 +0,1 @@

// The `performance` global is optional
/**

@@ -12,9 +10,3 @@ * @todo We could use `import generateUUID from 'uuid/v4';` (but it needs

/* c8 ignore next */
let d = Date.now() +
// use high-precision timer if available
/* c8 ignore next 4 */
(typeof performance !== 'undefined' &&
typeof performance.now === 'function'
? performance.now()
: 0);
let d = Date.now();

@@ -21,0 +13,0 @@ // eslint-disable-next-line @stylistic/max-len -- Long

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc