You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@jsonurl/jsonurl

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsonurl/jsonurl - npm Package Compare versions

Comparing version

to
1.1.6

dist/jsonurl.noproto.common.js

@@ -0,1 +1,22 @@

# v1.1.6
## New Features
* Produce build that does not modify prototypes ([@aidenlx](https://github.com/aidenlx "Link to profile for user aidenlx")), ([@dmaccormack](https://github.com/dmaccormack "Link to profile for user dmaccormack"))
## Dependency Updates
The following dependencies were updated:
* upgrade @babel/core from 7.14.5 to 7.17.5
* upgrade @babel/cli from 7.14.5 to 7.17.3
* upgrade @babel/plugin-transform-modules-commonjs from 7.14.5 to 7.16.7
* upgrade @babel/preset-env from 7.14.5 to 7.16.11
* upgrade babel-jest from 27.1.0 to 27.5.1
* upgrade eslint-plugin-jest from 24.4.0 to 26.1.1
* upgrade jest from 27.1.1 to 27.5.1
* upgrade jsdoc from 3.6.7 to 3.6.10
* upgrade jsdom from 16.6.0 to 17.0.0
* upgrade rollup from 2.56.3 to 2.67.3
* upgrade typescript from 4.4.2 to 4.5.5
# v1.1.5

@@ -2,0 +23,0 @@

6

dist/jsonurl.min.js
/*!
* jsonurl.js v1.1.5
* (c) 2021 David MacCormack
* jsonurl.js v1.1.6
* (c) 2022 David MacCormack
* Released under the MIT License.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).JsonURL=t()}(this,(function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(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,n.key,n)}}function r(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function a(e,t,r){return(a=s()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&o(i,r.prototype),i}).apply(null,arguments)}function u(e){var t="function"==typeof Map?new Map:void 0;return(u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,i(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(n,e)})(e)}function c(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function l(e){var t=s();return function(){var r,n=i(e);if(t){var o=i(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c(this,r)}}var p="JSON->URL: expected literal value",h="JSON->URL: unexpected character",f="JSON->URL: unexpected end of text inside composite",d="JSON->URL: unexpected text after composite",y="JSON->URL: MaxParseValues exceeded",v="JSON->URL: the empty string is not allowed",w="JSON->URL: invalid escape sequence",m="JSON->URL: invalid percent-encoded sequence",x="JSON->URL: expected object value";function O(e,t){return void 0===t?e:e+" at position "+t}var b=16,A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,6,6,48,10,20,20,6,6,20,6,6,6,6,6,6,6,6,6,6,6,6,6,20,6,0,48,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,6,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,6,0];function g(e){return e>127?0:A[e]}var E=function(){function t(r){e(this,t),this.setOrDefault(r,"allowEmptyUnquotedValues"),this.setOrDefault(r,"allowEmptyUnquotedKeys"),this.setOrDefault(r,"AQF"),this.setOrDefault(r,"coerceNullToEmptyString"),this.setOrDefault(r,"ignoreNullArrayMembers"),this.setOrDefault(r,"ignoreNullObjectMembers"),this.setOrDefault(r,"impliedArray"),this.setOrDefault(r,"impliedObject"),this.setOrDefault(r,"impliedStringLiterals"),this.setOrDefault(r,"noEmptyComposite"),this.setOrDefault(r,"wwwFormUrlEncoded")}return r(t,[{key:"setOrDefault",value:function(e,t,r){void 0!==e&&t in e?t in this||(this[t]=e[t]):void 0===r||t in this||(this[t]=r)}},{key:"setOverride",value:function(e,t){void 0!==e&&t in e&&(this[t]=e[t])}},{key:"setOrDefaultInt",value:function(e,t,r){this.setOrDefault(e,t,void 0===r?r:parseInt(r))}},{key:"isPresentAndTrue",value:function(e){return e in this&&this[e]}}]),t}(),S=function(t){n(o,t);var i=l(o);function o(t,r){var n;return e(this,o),(n=i.call(this,t)).setOrDefault(t,"emptyValue"),n.setOrDefault(r,"emptyValue",{}),n.setOverride(t,"getMissingValue"),n.setOrDefaultInt(t,"maxParseChars"),n.setOrDefaultInt(r,"maxParseChars",32768),n.setOrDefaultInt(t,"maxParseDepth"),n.setOrDefaultInt(r,"maxParseDepth",32),n.setOrDefaultInt(t,"maxParseValues"),n.setOrDefaultInt(r,"maxParseValues",4096),n.setOrDefault(t,"nullValue"),n.setOrDefault(r,"nullValue",null),n}return r(o,[{key:"getMissingValue",value:function(e,t){throw new SyntaxError(O(x,t))}}]),o}(E),V=function(t){n(i,t);var r=l(i);function i(t){var n;e(this,i),n=r.call(this,t);var o=!(void 0===t||!("impliedStringLiterals"in t)||!t.impliedStringLiterals)||void 0;return n.setOrDefault(t,"allowEmptyUnquotedValues",o),n.setOrDefault(t,"allowEmptyUnquotedKeys",o),n.setOrDefault(t,"callFunctions"),n.setOrDefault(t,"isImplied"),n.setOrDefault(t,"ignoreNullArrayMembers",o),n.setOrDefault(t,"ignoreNullObjectMembers",o),n.setOrDefault(t,"ignoreUndefinedArrayMembers",o),n.setOrDefault(t,"ignoreUndefinedObjectMembers",o),n.isImplied=n.isImplied||n.impliedArray||n.impliedObject,n}return i}(E),k=/\+/g,L=/ /g,U=/(![\s\S]?)/g,C=/^[-A-Za-z0-9._~!$*;=@?/ ][-A-Za-z0-9._~!$*;=@?/' ]*$/,j=/^[-A-Za-z0-9._~!$*,;=@?/(),: ]+$/,D=/^(?:true|false|null|(?:[-]?[0-9]+(?:[.][0-9]+)?(?:[eE][-+]?[0-9]+)?))$/,P=/[(),:]|%2[04]|%3B/gi,R={"%20":"+","%24":"$","(":"%28",")":"%29",",":"%2C",":":"%3A","%3B":";"},N=/[!(),:]|%2[01489C]|%3[AB]/gi,F={"%20":"+","%21":"!!","!":"!!","%24":"$","%28":"!(","(":"!(","%29":"!)",")":"!)","+":"!+","%2C":"!,",",":"!,","%3A":"!:",":":"!:","%3B":";"},J=40,I=41,T=44,M=58,q=38,_=48,$=65,B=97,Q=new Array(111);Q[33]="!",Q[40]="(",Q[41]=")",Q[43]="+",Q[44]=",",Q[45]=",",Q[48]="0",Q[49]="1",Q[50]="2",Q[51]="3",Q[52]="4",Q[53]="5",Q[54]="6",Q[55]="7",Q[56]="8",Q[57]="9",Q[58]=":",Q[116]="t",Q[102]="f",Q[110]="n";var K="",z=" ";function Z(e,t){var r=t?N:P,n=t?F:R;return encodeURIComponent(e).replace(r,(function(e){var t=n[e];return void 0===t?e:t}))}function G(e,t){switch(t){case _:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case $:case B:return 10;case 66:case 98:return 11;case 67:case 99:return 12;case 68:case 100:return 13;case 69:case 101:return 14;case 70:case 102:return 15;default:throw new SyntaxError(O(m,e))}}function H(e){if(e.coerceNullToEmptyString)return W(e,!1);if(e.impliedStringLiterals)throw new SyntaxError("JSON->URL: can not represent null with implied strings");return"null"}function W(e,t){if(t?e.allowEmptyUnquotedKeys:e.allowEmptyUnquotedValues)return K;if(e.AQF)return"!e";if(e.impliedStringLiterals)throw new SyntaxError(v);return"''"}Object.defineProperty(Array.prototype,"toJsonURLText",{value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=void 0;return this.forEach((function(n){if("function"==typeof n){if(!e.callFunctions)return;for(;"function"==typeof n;)n=n()}if(void 0===n){if(e.ignoreUndefinedArrayMembers)return;n=H(e)}else if(null===n){if(e.ignoreNullArrayMembers)return;n=H(e)}else n=n.toJsonURLText(e,t+1);void 0===r?r=n:!e.wwwFormUrlEncoded||t>0?r+=","+n:r+="&"+n})),!e.isImplied||t>0?void 0===r?"()":"("+r+")":void 0===r?K:r}}),Object.defineProperty(Boolean.prototype,"toJsonURLText",{value:function(){return!0===this?"true":"false"}}),Object.defineProperty(Number.prototype,"toJsonURLText",{value:function(e){var t=String(this);return e.impliedStringLiterals&&-1!==t.indexOf("+")?Z(t,e):t}}),Object.defineProperty(Object.prototype,"toJsonURLText",{value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=void 0,n=Object.keys(this),i=this;return n.forEach((function(n){if(null!=n){var o=i[n];if("function"==typeof o){if(!e.callFunctions)return;for(;"function"==typeof o;)o=o()}if(void 0===o){if(e.ignoreUndefinedObjectMembers)return;o=H(e)}else if(null===o){if(e.ignoreNullObjectMembers)return;o=H(e)}else o=o.toJsonURLText(e,t+1);var s=n.toJsonURLText(e,t,!0);void 0===r?r=!e.wwwFormUrlEncoded||t>0?s+":"+o:s+"="+o:!e.wwwFormUrlEncoded||t>0?r+=","+s+":"+o:r+="&"+s+"="+o}})),!e.isImplied||t>0?(e.noEmptyComposite&&void 0===r&&(r=":"),void 0===r?"()":"("+r+")"):void 0===r?K:r}}),Object.defineProperty(String.prototype,"toJsonURLText",{value:function(e,t,r){if(0===this.length)return W(e,r);if(e.impliedStringLiterals)return Z(this,e.AQF);if(D.test(this))return!0===r?this:e.AQF?-1==this.indexOf("+")?"!"+this:this.replace("+","!+"):-1==this.indexOf("+")?"'"+this+"'":encodeURIComponent(this);if(e.AQF)return Z(this,!0);if(C.test(this))return-1==this.indexOf(z)?this:this.replace(L,"+");if(j.test(this))return-1==this.indexOf(z)?"'"+this+"'":"'"+this.replace(L,"+")+"'";var n=Z(this);return 39==n.charCodeAt(0)?"%27"+n.substring(1):n}});var X=function(){function t(r,n,i,o){e(this,t),this.text=r,this.pos=this.markPos=n,this.end=i,this.options=o}return r(t,[{key:"skipAmps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.text,r=this.end,n=this.pos;if(e)for(;n<r&&t.charCodeAt(n)===q;)n++;else if(n<r&&t.charCodeAt(n)===q){for(n++;n<r&&t.charCodeAt(n)===q;n++);n!==r&&n--}this.pos=n}},{key:"structChar",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.options.wwwFormUrlEncoded){var t=this.text.charCodeAt(this.pos);switch(t){case q:case 61:if(e)return;return this.pos++,t}}var r=this.pos,n=this.ordinal();switch(n){case T:case M:if(e)return void(this.pos=r);case J:case I:return n;default:return void(this.pos=r)}}},{key:"ordinal",value:function(e){return void 0!==e?this.text.charCodeAt(e):this.text.charCodeAt(this.pos++)}},{key:"accept",value:function(e){var t=this.pos;return this.ordinal()===e||(this.pos=t,!1)}},{key:"acceptPlus",value:function(){return 43==this.text.charCodeAt(this.pos)&&(this.pos++,!0)}},{key:"done",value:function(){return this.end<=this.pos}},{key:"validateLiteral",value:function(e,t){for(var r=this.text,n=this.end;e<n;e++){switch(g(r.charCodeAt(e))&t){case 0:throw new SyntaxError(O(h,e));case b:return e;case 8:return e+1;default:continue}}}},{key:"findLiteralEnd",value:function(){var e=this.text,t=this.end,r=this.pos,n=39===e.charCodeAt(r);n&&r++;var i=n?28:18;if(void 0!==(r=this.validateLiteral(r,i)))return r;if(n)throw new SyntaxError(O("JSON->URL: quoted string still open",r));return t}},{key:"isEmptyObject",value:function(){if(this.options.noEmptyComposite){var e=this.pos;if(!this.accept(M))return!1;var t=this.pos,r=this.accept(I);return this.pos=r?t:e,r}return!1}},{key:"parseLiteral",value:function(e){var t=this.pos,r=this.options,n=this.findLiteralEnd();if(void 0===e&&(e=this.ordinal(n)==M),n<=t)return function(e,t){if(t)return K;throw new SyntaxError(O(v,e))}(t,e?this.options.allowEmptyUnquotedKeys:this.options.allowEmptyUnquotedValues);if(!0===r.impliedStringLiterals)return this.parseStringLiteral(n,!0);var i=this.parseTrueFalseNull(n,e);if(void 0!==i)return i;var o=this.parseNumberLiteral(n,e);return void 0!==o?o:this.parseStringLiteral(n,!1)}},{key:"parseDigits",value:function(e){for(var t,r=!1;this.pos<e;)switch(this.ordinal()){case _:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:t=this.pos,r=!0;continue;default:return this.pos=t,r}return this.pos=t,r}},{key:"parseExponentValue",value:function(e){return!(e<=this.pos)&&(this.acceptPlus()||this.accept(45),this.parseDigits(e))}},{key:"parseExponent",value:function(e){var t=this.pos;switch(this.ordinal()){case 69:case 101:if(this.parseExponentValue(e))return!0}return this.pos=t,!1}},{key:"parseFraction",value:function(e){var t=this.pos;return!(e<=t)&&(!(!this.accept(46)||!this.parseDigits(e))||(this.pos=t,!1))}},{key:"parseInteger",value:function(e){return!(e<=this.pos)&&(!!this.accept(_)||this.parseDigits(e))}},{key:"parseNumberLiteral",value:function(e,t){var r=this.text,n=this.pos;if(this.accept(45),this.parseInteger(e)&&(this.parseFraction(e),this.parseExponent(e),this.pos===e)){var i=decodeURIComponent(r.substring(n,e));return t?i:Number(i)}this.pos=n}},{key:"parseStringLiteral",value:function(e,t){var r=this.text,n=this.pos,i=t||39!==r.charCodeAt(n)?r.substring(n,e):r.substring(n+1,e-1);return i=decodeURIComponent(i.replace(k,z)),this.pos=e,i}},{key:"parseTrueFalseNull",value:function(e,t){var r,n,i,o,s,a=this.text,u=this.pos;switch(e-u){case 4:if(r=a.charCodeAt(u),n=a.charCodeAt(u+1),i=a.charCodeAt(u+2),o=a.charCodeAt(u+3),116===r&&114===n&&117===i&&101===o)return this.pos=e,!t||"true";if(110===r&&117===n&&108===i&&108===o)return this.pos=e,t?"null":this.newNullValue();break;case 5:if(r=a.charCodeAt(u),n=a.charCodeAt(u+1),i=a.charCodeAt(u+2),o=a.charCodeAt(u+3),s=a.charCodeAt(u+4),102===r&&n===B&&108===i&&115===o&&101===s)return this.pos=e,!!t&&"false"}}},{key:"newEmptyValue",value:function(){var e=this.options;if(e.noEmptyComposite)return[];var t=e.emptyValue;return"function"==typeof t?t():t}},{key:"newNullValue",value:function(){var e=this.options,t=e.nullValue;return"function"==typeof t&&(t=t()),null==t&&e.coerceNullToEmptyString&&(t=K),t}}]),t}(),Y=function(t){n(o,t);var i=l(o);function o(t,r,n,s){return e(this,o),i.call(this,t,r,n,s)}return r(o,[{key:"ordinal",value:function(e){var t,r,n=e||this.pos,i=this.text.charCodeAt(n);return 37===i?(t=function(e,t,r){if(r<=t+1)throw new SyntaxError(O(m,t));return G(t,e.charCodeAt(t))<<4|G(t,e.charCodeAt(t+1))}(this.text,n+1,this.end),r=3):(t=i,r=1),void 0===e&&(this.pos+=r),t}},{key:"acceptPlus",value:function(){return this.accept(43)}},{key:"findLiteralEnd",value:function(){for(var e=this.end,t=this.pos,r=this.text,n=t;;){if(e<=this.pos)return this.pos=t,e;switch(50&g(r.charCodeAt(this.pos))){case 48:if(this.options.wwwFormUrlEncoded)return n=this.pos,this.pos=t,n;case 0:throw new SyntaxError(O(h,n))}switch(this.ordinal()){case J:case I:case M:case T:return this.pos=t,n;case 33:if(this.pos===e)throw new SyntaxError(O(w,n));this.ordinal(),n=this.pos;break;default:n=this.pos}}}},{key:"parseStringLiteral",value:function(e){var t=this.text,r=this.pos,n=decodeURIComponent(t.substring(r,e).replace(k,z));return this.pos=e,"!e"===n?K:n.replace(U,(function(e,t,n){if(2===e.length){var i=e.charCodeAt(1),o=Q[i];if(void 0!==o)return o}throw new SyntaxError(O(w,r+n))}))}}]),o}(X),ee=function(t){n(o,t);var i=l(o);function o(t){var r;return e(this,o),(r=i.call(this)).limits=t,r.parseDepth=0,r}return r(o,[{key:"replaceAndPush",value:function(e,t,r){if(this[this.parseDepth]=t,++this.parseDepth>=this.limits.maxParseDepth)throw new Error(O("JSON->URL: MaxParseDepth exceeded",e));this.push(r)}},{key:"replace",value:function(e){this[this.parseDepth]=e}},{key:"depth",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e&&(this.parseDepth--,this.pop()),this.parseDepth}}]),o}(u(Array)),te=function(t){n(o,t);var i=l(o);function o(t){var r;return e(this,o),(r=i.call(this)).limits=t,r.numValues=0,r}return r(o,[{key:"popObjectValue",value:function(e,t){t=t||this.pop();var r=this.pop(),n=this[this.length-1];return null===t&&e.isPresentAndTrue("ignoreNullObjectMembers")||(n[r]=t),n}},{key:"popArrayValue",value:function(e,t){t=t||this.pop();var r=this[this.length-1];return null===t&&e.isPresentAndTrue("ignoreNullArrayMembers")||r.push(t),r}},{key:"checkValueLimit",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.numValues+=t,this.numValues>this.limits.maxParseValues+1)throw new Error(O(y,e))}},{key:"appendArrayValue",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.checkValueLimit(e,r),this.push(t)}}]),o}(u(Array));function re(e){for(;"function"==typeof e;)e=e();return e}function ne(e,t,r,n){return"number"==typeof e?"number"!=typeof t&&(r=t):r=e,(r=re(r))instanceof S||(r=new S(r,n)),r}function ie(e,t,r,n){return n.AQF?new Y(e,t,r,n):new X(e,t,r,n)}function oe(e,t){return"number"==typeof e?e:t}function se(e,t,r,n,i){if(void 0!==e){n=ne(t,r,n,i),e=String(e);var o=oe(t,0),s=oe(r,e.length);if(s<=o){if(void 0!==n.impliedArray)return n.impliedArray;if(void 0!==n.impliedObject)return n.impliedObject;throw new SyntaxError(O("JSON->URL: expected value",0))}if(s>n.maxParseChars)throw new Error("JSON->URL: MaxParseChars exceeded");var a=n.wwwFormUrlEncoded&&(n.impliedObject||n.impliedArray),u=new te(n),c=new ee(n),l=ie(e,o,s,n);if(void 0!==n.impliedObject)u.push(n.impliedObject),c.push(6);else if(void 0!==n.impliedArray)u.push(n.impliedArray),c.push(2);else{if(l.structChar(!0)!==J){var y=l.parseLiteral(!1);if(l.done())return y;throw new SyntaxError(O(p,0))}c.push(1)}for(a&&l.skipAmps(!0);;){if(l.done())throw new SyntaxError(O(f,l.pos));var v=void 0,w=void 0,m=void 0;switch(c[c.depth()]){case 1:switch(l.structChar(!0)){case J:u.appendArrayValue(l.pos,[]),c.replaceAndPush(l.pos,3,1);continue;case I:if(-1===c.depth(!0)){if(l.done())return l.newEmptyValue();throw new SyntaxError(O(d,l.pos))}if(u.appendArrayValue(l.pos,l.newEmptyValue()),0===c.depth()&&(a&&l.skipAmps(),l.done())){if(n.impliedArray)return u.popArrayValue(n);if(n.impliedObject)return u.popObjectValue(n);throw new SyntaxError(O(f,l.pos))}continue}switch(u.checkValueLimit(l.pos),v=(w=l.isEmptyObject())?{}:l.parseLiteral(),m=l.pos,l.structChar()){case q:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,m));case T:c.replace(2),u.appendArrayValue(m,[]),u.push(v),u.popArrayValue(n);continue;case I:switch(w?u.push({}):u.appendArrayValue(m,[v]),c.depth(!0)){case-1:if(l.pos===s)return u[0];throw new SyntaxError(O(d,m));case 0:if(a&&l.skipAmps(),l.done()){if(n.impliedArray)return u.popArrayValue(n);if(n.impliedObject)return u.popObjectValue(n);throw new SyntaxError(O(f,m))}}continue;case 61:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,m));case M:c.replace(4),u.push({},v);continue;default:throw new SyntaxError(O(p,m))}case 2:if(l.accept(J)){c.replaceAndPush(l.pos,3,1);continue}if(u.checkValueLimit(l.pos),v=l.parseLiteral(!1),a&&l.skipAmps(),l.done()){if(0===c.depth()&&n.impliedArray)return u.popArrayValue(n,v);throw new SyntaxError(O(f,s))}c.replace(3),u.push(v);continue;case 3:switch(u.popArrayValue(n),l.structChar()){case q:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,l.pos));case T:c.replace(2);continue;case I:switch(c.depth(!0)){case-1:if(l.done()&&!n.impliedArray)return u[0];throw new SyntaxError(O(d,l.pos));case 0:if(a&&l.skipAmps(),l.done()){if(n.impliedArray)return u.popArrayValue(n);if(n.impliedObject)return u.popObjectValue(n);throw new SyntaxError(O(f,l.pos))}}continue}throw new SyntaxError(O("JSON->URL: expected comma or close paren",l.pos));case 4:if(l.accept(J)){c.replaceAndPush(l.pos,5,1);continue}if(u.checkValueLimit(l.pos),v=l.parseLiteral(!1),a&&l.skipAmps(),l.done()){if(0===c.depth()&&n.impliedObject)return u.popObjectValue(n,v);throw new SyntaxError(O(f,s))}c.replace(5),u.push(v);continue;case 5:switch(u.popObjectValue(n),m=l.pos,l.structChar()){case q:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,m));case T:c.replace(6);continue;case I:switch(c.depth(!0)){case-1:if(l.done()&&!n.impliedObject)return u[0];throw new SyntaxError(O(d,l.pos));case 0:if(a&&l.skipAmps(),l.done()){if(n.impliedArray)return u.popArrayValue(n);if(n.impliedObject)return u.popObjectValue(n);throw new SyntaxError(O(d,l.pos))}}continue}throw new SyntaxError(O("JSON->URL: expected comma, open paren, or close paren",l.pos));case 6:if(v=l.parseLiteral(!0),a&&l.skipAmps(),l.done()){if(n.impliedObject&&0==c.depth())return u.push(v,n.getMissingValue(v)),u.popObjectValue(n);throw new SyntaxError(O(f,s))}switch(l.structChar()){case 61:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,l.pos));case M:break;case q:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,l.pos));case T:if(n.impliedObject&&0==c.depth()){u.push(v,n.getMissingValue(v)),u.popObjectValue(n);continue}default:throw new SyntaxError(O(x,l.pos))}c.replace(4),u.push(v);continue;default:throw new SyntaxError(O("JSON->URL: internal error",l.pos))}}}}return function(){function t(r){for(e(this,t);"function"==typeof r;)r=r();void 0===r&&(r={}),this.maxParseDepth="number"==typeof r.maxParseDepth?parseInt(r.maxParseDepth):32,this.maxParseValues="number"==typeof r.maxParseValues?parseInt(r.maxParseValues):4096,this.maxParseChars="number"==typeof r.maxParseChars?parseInt(r.maxParseChars):32768,this.emptyValue=void 0===r.emptyValue?{}:r.emptyValue,this.nullValue=void 0===r.nullValue?null:r.nullValue}return r(t,[{key:"parseLiteral",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;void 0!==e&&(e=String(e)),void 0===r&&(r=e.length);var o=ie(e,t,r,ne(i));return o.parseLiteral(n)}},{key:"parse",value:function(e,t,r,n){return se(e,t,r,n,this)}}],[{key:"parse",value:function(e,t,r,n){return se(e,t,r,n,void 0)}},{key:"stringify",value:function(e,t){if(void 0!==e)return t=new V(re(t)),null===e?H(t):e.toJsonURLText(t,0)}}]),t}()}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).JsonURL=t()}(this,(function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(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,n.key,n)}}function r(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function a(e,t,r){return(a=s()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&o(i,r.prototype),i}).apply(null,arguments)}function u(e){var t="function"==typeof Map?new Map:void 0;return(u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,i(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(n,e)})(e)}function c(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function l(e){var t=s();return function(){var r,n=i(e);if(t){var o=i(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return c(this,r)}}var p="JSON->URL: expected literal value",h="JSON->URL: unexpected character",f="JSON->URL: unexpected end of text inside composite",d="JSON->URL: unexpected text after composite",y="JSON->URL: MaxParseValues exceeded",v="JSON->URL: the empty string is not allowed",w="JSON->URL: invalid escape sequence",m="JSON->URL: invalid percent-encoded sequence",x="JSON->URL: expected object value";function O(e,t){return void 0===t?e:e+" at position "+t}var b=16,A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,6,6,48,10,20,20,6,6,20,6,6,6,6,6,6,6,6,6,6,6,6,6,20,6,0,48,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,6,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,6,0];function g(e){return e>127?0:A[e]}var E=function(){function t(r){e(this,t),this.setOrDefault(r,"allowEmptyUnquotedValues"),this.setOrDefault(r,"allowEmptyUnquotedKeys"),this.setOrDefault(r,"AQF"),this.setOrDefault(r,"coerceNullToEmptyString"),this.setOrDefault(r,"ignoreNullArrayMembers"),this.setOrDefault(r,"ignoreNullObjectMembers"),this.setOrDefault(r,"impliedArray"),this.setOrDefault(r,"impliedObject"),this.setOrDefault(r,"impliedStringLiterals"),this.setOrDefault(r,"noEmptyComposite"),this.setOrDefault(r,"wwwFormUrlEncoded")}return r(t,[{key:"setOrDefault",value:function(e,t,r){void 0!==e&&t in e?t in this||(this[t]=e[t]):void 0===r||t in this||(this[t]=r)}},{key:"setOverride",value:function(e,t){void 0!==e&&t in e&&(this[t]=e[t])}},{key:"setOrDefaultInt",value:function(e,t,r){this.setOrDefault(e,t,void 0===r?r:parseInt(r))}},{key:"isPresentAndTrue",value:function(e){return e in this&&this[e]}}]),t}(),S=function(t){n(o,t);var i=l(o);function o(t,r){var n;return e(this,o),(n=i.call(this,t)).setOrDefault(t,"emptyValue"),n.setOrDefault(r,"emptyValue",{}),n.setOverride(t,"getMissingValue"),n.setOrDefaultInt(t,"maxParseChars"),n.setOrDefaultInt(r,"maxParseChars",32768),n.setOrDefaultInt(t,"maxParseDepth"),n.setOrDefaultInt(r,"maxParseDepth",32),n.setOrDefaultInt(t,"maxParseValues"),n.setOrDefaultInt(r,"maxParseValues",4096),n.setOrDefault(t,"nullValue"),n.setOrDefault(r,"nullValue",null),n}return r(o,[{key:"getMissingValue",value:function(e,t){throw new SyntaxError(O(x,t))}}]),o}(E),L=function(t){n(o,t);var i=l(o);function o(t){var r;e(this,o),r=i.call(this,t);var n=!(void 0===t||!("impliedStringLiterals"in t)||!t.impliedStringLiterals)||void 0;return r.setOrDefault(t,"allowEmptyUnquotedValues",n),r.setOrDefault(t,"allowEmptyUnquotedKeys",n),r.setOrDefault(t,"callFunctions"),r.setOrDefault(t,"isImplied"),r.setOrDefault(t,"ignoreNullArrayMembers",n),r.setOrDefault(t,"ignoreNullObjectMembers",n),r.setOrDefault(t,"ignoreUndefinedArrayMembers",n),r.setOrDefault(t,"ignoreUndefinedObjectMembers",n),r.isImplied=r.isImplied||r.impliedArray||r.impliedObject,r}return r(o)}(E);var U=/\+/g,V=/ /g,k=/(![\s\S]?)/g,j=/^[-A-Za-z0-9._~!$*;=@?/ ][-A-Za-z0-9._~!$*;=@?/' ]*$/,C=/^[-A-Za-z0-9._~!$*,;=@?/(): ]+$/,D=/^-?\d+(?:\.\d+)?(?:[eE][-+]?\d+)?$/,R=/[(),:]|%2[04]|%3B/gi,P={"%20":"+","%24":"$","(":"%28",")":"%29",",":"%2C",":":"%3A","%3B":";"},N=/[!(),:]|%2[01489C]|%3[AB]/gi,J={"%20":"+","%21":"!!","!":"!!","%24":"$","%28":"!(","(":"!(","%29":"!)",")":"!)","+":"!+","%2C":"!,",",":"!,","%3A":"!:",":":"!:","%3B":";"},T=40,F=41,I=44,M=58,_=38,q=48,B=65,$=97,Q=new Array(111);Q[33]="!",Q[40]="(",Q[41]=")",Q[43]="+",Q[44]=",",Q[45]=",",Q[48]="0",Q[49]="1",Q[50]="2",Q[51]="3",Q[52]="4",Q[53]="5",Q[54]="6",Q[55]="7",Q[56]="8",Q[57]="9",Q[58]=":",Q[116]="t",Q[102]="f",Q[110]="n";var K="",z=" ";function Z(e,t){var r=t?N:R,n=t?J:P;return encodeURIComponent(e).replace(r,(function(e){var t=n[e];return void 0===t?e:t}))}function G(e,t){switch(t){case q:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case B:case $:return 10;case 66:case 98:return 11;case 67:case 99:return 12;case 68:case 100:return 13;case 69:case 101:return 14;case 70:case 102:return 15;default:throw new SyntaxError(O(m,e))}}function H(e){if(e.coerceNullToEmptyString)return W(e,!1);if(e.impliedStringLiterals)throw new SyntaxError("JSON->URL: can not represent null with implied strings");return"null"}function W(e,t){if(t?e.allowEmptyUnquotedKeys:e.allowEmptyUnquotedValues)return K;if(e.AQF)return"!e";if(e.impliedStringLiterals)throw new SyntaxError(v);return"''"}!function(e){var t=e.toJsonURLText_Array,r=e.toJsonURLText_Boolean,n=e.toJsonURLText_Number,i=e.toJsonURLText_Object,o=e.toJsonURLText_String;Object.defineProperty(Array.prototype,"toJsonURLText",{value:t}),Object.defineProperty(Boolean.prototype,"toJsonURLText",{value:r}),Object.defineProperty(Number.prototype,"toJsonURLText",{value:n}),Object.defineProperty(Object.prototype,"toJsonURLText",{value:i}),Object.defineProperty(String.prototype,"toJsonURLText",{value:o})}({toJsonURLText_Array:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=void 0;return this.forEach((function(n){if("function"==typeof n){if(!e.callFunctions)return;for(;"function"==typeof n;)n=n()}if(void 0===n){if(e.ignoreUndefinedArrayMembers)return;n=H(e)}else if(null===n){if(e.ignoreNullArrayMembers)return;n=H(e)}else n=n.toJsonURLText(e,t+1);void 0===r?r=n:!e.wwwFormUrlEncoded||t>0?r+=","+n:r+="&"+n})),!e.isImplied||t>0?void 0===r?"()":"("+r+")":void 0===r?K:r},toJsonURLText_Boolean:function(){return!0===this?"true":"false"},toJsonURLText_Number:function(e){var t=String(this);return e.impliedStringLiterals&&-1!==t.indexOf("+")?Z(t,e):t},toJsonURLText_Object:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=void 0,n=Object.keys(this),i=this;return n.forEach((function(n){if(null!=n){var o=i[n];if("function"==typeof o){if(!e.callFunctions)return;for(;"function"==typeof o;)o=o()}if(void 0===o){if(e.ignoreUndefinedObjectMembers)return;o=H(e)}else if(null===o){if(e.ignoreNullObjectMembers)return;o=H(e)}else o=o.toJsonURLText(e,t+1);var s=n.toJsonURLText(e,t,!0);void 0===r?r=!e.wwwFormUrlEncoded||t>0?s+":"+o:s+"="+o:!e.wwwFormUrlEncoded||t>0?r+=","+s+":"+o:r+="&"+s+"="+o}})),!e.isImplied||t>0?(e.noEmptyComposite&&void 0===r&&(r=":"),void 0===r?"()":"("+r+")"):void 0===r?K:r},toJsonURLText_String:function(e,t,r){if(0===this.length)return W(e,r);if(e.impliedStringLiterals)return Z(this,e.AQF);if("true"===(n=this)||"false"===n||"null"===n||D.test(n))return!0===r?this:e.AQF?-1==this.indexOf("+")?"!"+this:this.replace("+","!+"):-1==this.indexOf("+")?"'"+this+"'":encodeURIComponent(this);var n;if(e.AQF)return Z(this,!0);if(j.test(this))return-1==this.indexOf(z)?this:this.replace(V,"+");if(C.test(this))return-1==this.indexOf(z)?"'"+this+"'":"'"+this.replace(V,"+")+"'";var i=Z(this);return 39==i.charCodeAt(0)?"%27"+i.substring(1):i}});var X=function(){function t(r,n,i,o){e(this,t),this.text=r,this.pos=this.markPos=n,this.end=i,this.options=o}return r(t,[{key:"skipAmps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.text,r=this.end,n=this.pos;if(e)for(;n<r&&t.charCodeAt(n)===_;)n++;else if(n<r&&t.charCodeAt(n)===_){for(n++;n<r&&t.charCodeAt(n)===_;n++);n!==r&&n--}this.pos=n}},{key:"structChar",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.options.wwwFormUrlEncoded){var t=this.text.charCodeAt(this.pos);switch(t){case _:case 61:if(e)return;return this.pos++,t}}var r=this.pos,n=this.ordinal();switch(n){case I:case M:if(e)return void(this.pos=r);case T:case F:return n;default:return void(this.pos=r)}}},{key:"ordinal",value:function(e){return void 0!==e?this.text.charCodeAt(e):this.text.charCodeAt(this.pos++)}},{key:"accept",value:function(e){var t=this.pos;return this.ordinal()===e||(this.pos=t,!1)}},{key:"acceptPlus",value:function(){return 43==this.text.charCodeAt(this.pos)&&(this.pos++,!0)}},{key:"done",value:function(){return this.end<=this.pos}},{key:"validateLiteral",value:function(e,t){for(var r=this.text,n=this.end;e<n;e++){switch(g(r.charCodeAt(e))&t){case 0:throw new SyntaxError(O(h,e));case b:return e;case 8:return e+1;default:continue}}}},{key:"findLiteralEnd",value:function(){var e=this.text,t=this.end,r=this.pos,n=39===e.charCodeAt(r);n&&r++;var i=n?28:18;if(void 0!==(r=this.validateLiteral(r,i)))return r;if(n)throw new SyntaxError(O("JSON->URL: quoted string still open",r));return t}},{key:"isEmptyObject",value:function(){if(this.options.noEmptyComposite){var e=this.pos;if(!this.accept(M))return!1;var t=this.pos,r=this.accept(F);return this.pos=r?t:e,r}return!1}},{key:"parseLiteral",value:function(e){var t=this.pos,r=this.options,n=this.findLiteralEnd();if(void 0===e&&(e=this.ordinal(n)==M),n<=t)return function(e,t){if(t)return K;throw new SyntaxError(O(v,e))}(t,e?this.options.allowEmptyUnquotedKeys:this.options.allowEmptyUnquotedValues);if(!0===r.impliedStringLiterals)return this.parseStringLiteral(n,!0);var i=this.parseTrueFalseNull(n,e);if(void 0!==i)return i;var o=this.parseNumberLiteral(n,e);return void 0!==o?o:this.parseStringLiteral(n,!1)}},{key:"parseDigits",value:function(e){for(var t,r=!1;this.pos<e;)switch(this.ordinal()){case q:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:t=this.pos,r=!0;continue;default:return this.pos=t,r}return this.pos=t,r}},{key:"parseExponentValue",value:function(e){return!(e<=this.pos)&&(this.acceptPlus()||this.accept(45),this.parseDigits(e))}},{key:"parseExponent",value:function(e){var t=this.pos;switch(this.ordinal()){case 69:case 101:if(this.parseExponentValue(e))return!0}return this.pos=t,!1}},{key:"parseFraction",value:function(e){var t=this.pos;return!(e<=t)&&(!(!this.accept(46)||!this.parseDigits(e))||(this.pos=t,!1))}},{key:"parseInteger",value:function(e){return!(e<=this.pos)&&(!!this.accept(q)||this.parseDigits(e))}},{key:"parseNumberLiteral",value:function(e,t){var r=this.text,n=this.pos;if(this.accept(45),this.parseInteger(e)&&(this.parseFraction(e),this.parseExponent(e),this.pos===e)){var i=decodeURIComponent(r.substring(n,e));return t?i:Number(i)}this.pos=n}},{key:"parseStringLiteral",value:function(e,t){var r=this.text,n=this.pos,i=t||39!==r.charCodeAt(n)?r.substring(n,e):r.substring(n+1,e-1);return i=decodeURIComponent(i.replace(U,z)),this.pos=e,i}},{key:"parseTrueFalseNull",value:function(e,t){var r,n,i,o,s,a=this.text,u=this.pos;switch(e-u){case 4:if(r=a.charCodeAt(u),n=a.charCodeAt(u+1),i=a.charCodeAt(u+2),o=a.charCodeAt(u+3),116===r&&114===n&&117===i&&101===o)return this.pos=e,!t||"true";if(110===r&&117===n&&108===i&&108===o)return this.pos=e,t?"null":this.newNullValue();break;case 5:if(r=a.charCodeAt(u),n=a.charCodeAt(u+1),i=a.charCodeAt(u+2),o=a.charCodeAt(u+3),s=a.charCodeAt(u+4),102===r&&n===$&&108===i&&115===o&&101===s)return this.pos=e,!!t&&"false"}}},{key:"newEmptyValue",value:function(){var e=this.options;if(e.noEmptyComposite)return[];var t=e.emptyValue;return"function"==typeof t?t():t}},{key:"newNullValue",value:function(){var e=this.options,t=e.nullValue;return"function"==typeof t&&(t=t()),null==t&&e.coerceNullToEmptyString&&(t=K),t}}]),t}(),Y=function(t){n(o,t);var i=l(o);function o(t,r,n,s){return e(this,o),i.call(this,t,r,n,s)}return r(o,[{key:"ordinal",value:function(e){var t,r,n=e||this.pos,i=this.text.charCodeAt(n);return 37===i?(t=function(e,t,r){if(r<=t+1)throw new SyntaxError(O(m,t));return G(t,e.charCodeAt(t))<<4|G(t,e.charCodeAt(t+1))}(this.text,n+1,this.end),r=3):(t=i,r=1),void 0===e&&(this.pos+=r),t}},{key:"acceptPlus",value:function(){return this.accept(43)}},{key:"findLiteralEnd",value:function(){for(var e=this.end,t=this.pos,r=this.text,n=t;;){if(e<=this.pos)return this.pos=t,e;switch(50&g(r.charCodeAt(this.pos))){case 48:if(this.options.wwwFormUrlEncoded)return n=this.pos,this.pos=t,n;case 0:throw new SyntaxError(O(h,n))}switch(this.ordinal()){case T:case F:case M:case I:return this.pos=t,n;case 33:if(this.pos===e)throw new SyntaxError(O(w,n));this.ordinal(),n=this.pos;break;default:n=this.pos}}}},{key:"parseStringLiteral",value:function(e){var t=this.text,r=this.pos,n=decodeURIComponent(t.substring(r,e).replace(U,z));return this.pos=e,"!e"===n?K:n.replace(k,(function(e,t,n){if(2===e.length){var i=e.charCodeAt(1),o=Q[i];if(void 0!==o)return o}throw new SyntaxError(O(w,r+n))}))}}]),o}(X),ee=function(t){n(o,t);var i=l(o);function o(t){var r;return e(this,o),(r=i.call(this)).limits=t,r.parseDepth=0,r}return r(o,[{key:"replaceAndPush",value:function(e,t,r){if(this[this.parseDepth]=t,++this.parseDepth>=this.limits.maxParseDepth)throw new Error(O("JSON->URL: MaxParseDepth exceeded",e));this.push(r)}},{key:"replace",value:function(e){this[this.parseDepth]=e}},{key:"depth",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e&&(this.parseDepth--,this.pop()),this.parseDepth}}]),o}(u(Array)),te=function(t){n(o,t);var i=l(o);function o(t){var r;return e(this,o),(r=i.call(this)).limits=t,r.numValues=0,r}return r(o,[{key:"popObjectValue",value:function(e,t){t=t||this.pop();var r=this.pop(),n=this[this.length-1];return null===t&&e.isPresentAndTrue("ignoreNullObjectMembers")||(n[r]=t),n}},{key:"popArrayValue",value:function(e,t){t=t||this.pop();var r=this[this.length-1];return null===t&&e.isPresentAndTrue("ignoreNullArrayMembers")||r.push(t),r}},{key:"checkValueLimit",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.numValues+=t,this.numValues>this.limits.maxParseValues+1)throw new Error(O(y,e))}},{key:"appendArrayValue",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.checkValueLimit(e,r),this.push(t)}}]),o}(u(Array));function re(e){for(;"function"==typeof e;)e=e();return e}function ne(e,t,r,n){return"number"==typeof e?"number"!=typeof t&&(r=t):r=e,(r=re(r))instanceof S||(r=new S(r,n)),r}function ie(e,t,r,n){return n.AQF?new Y(e,t,r,n):new X(e,t,r,n)}function oe(e,t){return"number"==typeof e?e:t}function se(e,t,r,n,i){if(void 0!==e){n=ne(t,r,n,i),e=String(e);var o=oe(t,0),s=oe(r,e.length);if(s<=o){if(void 0!==n.impliedArray)return n.impliedArray;if(void 0!==n.impliedObject)return n.impliedObject;throw new SyntaxError(O("JSON->URL: expected value",0))}if(s>n.maxParseChars)throw new Error("JSON->URL: MaxParseChars exceeded");var a=n.wwwFormUrlEncoded&&(n.impliedObject||n.impliedArray),u=new te(n),c=new ee(n),l=ie(e,o,s,n);if(void 0!==n.impliedObject)u.push(n.impliedObject),c.push(6);else if(void 0!==n.impliedArray)u.push(n.impliedArray),c.push(2);else{if(l.structChar(!0)!==T){var y=l.parseLiteral(!1);if(l.done())return y;throw new SyntaxError(O(p,0))}c.push(1)}for(a&&l.skipAmps(!0);;){if(l.done())throw new SyntaxError(O(f,l.pos));var v=void 0,w=void 0,m=void 0;switch(c[c.depth()]){case 1:switch(l.structChar(!0)){case T:u.appendArrayValue(l.pos,[]),c.replaceAndPush(l.pos,3,1);continue;case F:if(-1===c.depth(!0)){if(l.done())return l.newEmptyValue();throw new SyntaxError(O(d,l.pos))}if(u.appendArrayValue(l.pos,l.newEmptyValue()),0===c.depth()&&(a&&l.skipAmps(),l.done())){if(n.impliedArray)return u.popArrayValue(n);if(n.impliedObject)return u.popObjectValue(n);throw new SyntaxError(O(f,l.pos))}continue}switch(u.checkValueLimit(l.pos),v=(w=l.isEmptyObject())?{}:l.parseLiteral(),m=l.pos,l.structChar()){case _:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,m));case I:c.replace(2),u.appendArrayValue(m,[]),u.push(v),u.popArrayValue(n);continue;case F:switch(w?u.push({}):u.appendArrayValue(m,[v]),c.depth(!0)){case-1:if(l.pos===s)return u[0];throw new SyntaxError(O(d,m));case 0:if(a&&l.skipAmps(),l.done()){if(n.impliedArray)return u.popArrayValue(n);if(n.impliedObject)return u.popObjectValue(n);throw new SyntaxError(O(f,m))}}continue;case 61:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,m));case M:c.replace(4),u.push({},v);continue;default:throw new SyntaxError(O(p,m))}case 2:if(l.accept(T)){c.replaceAndPush(l.pos,3,1);continue}if(u.checkValueLimit(l.pos),v=l.parseLiteral(!1),a&&l.skipAmps(),l.done()){if(0===c.depth()&&n.impliedArray)return u.popArrayValue(n,v);throw new SyntaxError(O(f,s))}c.replace(3),u.push(v);continue;case 3:switch(u.popArrayValue(n),l.structChar()){case _:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,l.pos));case I:c.replace(2);continue;case F:switch(c.depth(!0)){case-1:if(l.done()&&!n.impliedArray)return u[0];throw new SyntaxError(O(d,l.pos));case 0:if(a&&l.skipAmps(),l.done()){if(n.impliedArray)return u.popArrayValue(n);if(n.impliedObject)return u.popObjectValue(n);throw new SyntaxError(O(f,l.pos))}}continue}throw new SyntaxError(O("JSON->URL: expected comma or close paren",l.pos));case 4:if(l.accept(T)){c.replaceAndPush(l.pos,5,1);continue}if(u.checkValueLimit(l.pos),v=l.parseLiteral(!1),a&&l.skipAmps(),l.done()){if(0===c.depth()&&n.impliedObject)return u.popObjectValue(n,v);throw new SyntaxError(O(f,s))}c.replace(5),u.push(v);continue;case 5:switch(u.popObjectValue(n),m=l.pos,l.structChar()){case _:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,m));case I:c.replace(6);continue;case F:switch(c.depth(!0)){case-1:if(l.done()&&!n.impliedObject)return u[0];throw new SyntaxError(O(d,l.pos));case 0:if(a&&l.skipAmps(),l.done()){if(n.impliedArray)return u.popArrayValue(n);if(n.impliedObject)return u.popObjectValue(n);throw new SyntaxError(O(d,l.pos))}}continue}throw new SyntaxError(O("JSON->URL: expected comma, open paren, or close paren",l.pos));case 6:if(v=l.parseLiteral(!0),a&&l.skipAmps(),l.done()){if(n.impliedObject&&0==c.depth())return u.push(v,n.getMissingValue(v)),u.popObjectValue(n);throw new SyntaxError(O(f,s))}switch(l.structChar()){case 61:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,l.pos));case M:break;case _:if(!n.wwwFormUrlEncoded||c.depth()>0)throw new SyntaxError(O(h,l.pos));case I:if(n.impliedObject&&0==c.depth()){u.push(v,n.getMissingValue(v)),u.popObjectValue(n);continue}default:throw new SyntaxError(O(x,l.pos))}c.replace(4),u.push(v);continue;default:throw new SyntaxError(O("JSON->URL: internal error",l.pos))}}}}return function(){function t(r){for(e(this,t);"function"==typeof r;)r=r();void 0===r&&(r={}),this.maxParseDepth="number"==typeof r.maxParseDepth?parseInt(r.maxParseDepth):32,this.maxParseValues="number"==typeof r.maxParseValues?parseInt(r.maxParseValues):4096,this.maxParseChars="number"==typeof r.maxParseChars?parseInt(r.maxParseChars):32768,this.emptyValue=void 0===r.emptyValue?{}:r.emptyValue,this.nullValue=void 0===r.nullValue?null:r.nullValue}return r(t,[{key:"parseLiteral",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;void 0!==e&&(e=String(e)),void 0===r&&(r=e.length);var o=ie(e,t,r,ne(i));return o.parseLiteral(n)}},{key:"parse",value:function(e,t,r,n){return se(e,t,r,n,this)}}],[{key:"parse",value:function(e,t,r,n){return se(e,t,r,n,void 0)}},{key:"stringify",value:function(e,t){if(void 0!==e)return t=new L(re(t)),null===e?H(t):e.toJsonURLText(t,0)}}]),t}()}));
{
"name": "@jsonurl/jsonurl",
"version": "1.1.5",
"version": "1.1.6",
"publishConfig": {

@@ -15,3 +15,3 @@ "access": "public"

"test": "jest",
"lint": "env DEBUG=eslint:cli-engine eslint .",
"lint": "./script/lint.sh",
"jsdoc": "jsdoc -c jsdoc.config.js -a public"

@@ -40,3 +40,5 @@ },

"@babel/preset-env": "^7.15.4",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-replace": "^3.0.1",
"babel-jest": "^27.1.0",

@@ -46,3 +48,3 @@ "editorconfig": "^0.15.3",

"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-jest": "^26.0.0",
"eslint-plugin-prettier": "^3.4.1",

@@ -49,0 +51,0 @@ "jest": "^27.1.0",

@@ -54,4 +54,4 @@ # JSON→URL

<script
src="https://cdn.jsdelivr.net/npm/@jsonurl/jsonurl@1.1.5"
integrity="sha512-PgDMK2pu/5iHU+sUvfCWIKugVg2NLSN1jmQJyJKbQw1MZAMvrU7XX3fPv4FJXgGBxTCsDnjhMmlZK5pzgPndTQ=="
src="https://cdn.jsdelivr.net/npm/@jsonurl/jsonurl@1.1.6"
integrity="sha512-XwwFcB+WGRTO/klfJWwRoi0xGhMVvZyioqS1p/kyOyHc9o/EExDVXTCsIwldO05Ad9R9E1zwgNZhVPNNqyhrFQ=="
crossorigin="anonymous"></script>

@@ -58,0 +58,0 @@ ```

@@ -9,4 +9,4 @@ # Security Policy

| ------- | ------------------ |
| 1.1.5 | :white_check_mark: |
| < 1.1.5 | :x: |
| 1.1.6 | :white_check_mark: |
| < 1.1.6 | :x: |

@@ -13,0 +13,0 @@ ## Reporting a Vulnerability

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

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