PromoCursed/node_modules/jsonpath/jsonpath.min.js

4 lines
84 KiB
JavaScript
Raw Normal View History

2024-08-20 23:25:37 +04:00
/*! jsonpath 1.1.1 */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.jsonpath=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({"./aesprim":[function(b,c,d){!function(b,c){"use strict";"function"==typeof a&&a.amd?a(["exports"],c):c(void 0!==d?d:b.esprima={})}(this,function(a){"use strict";function b(a,b){if(!a)throw new Error("ASSERT: "+b)}function c(a){return a>=48&&a<=57}function d(a){return"0123456789abcdefABCDEF".indexOf(a)>=0}function e(a){return"01234567".indexOf(a)>=0}function f(a){return 32===a||9===a||11===a||12===a||160===a||a>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(a)>=0}function g(a){return 10===a||13===a||8232===a||8233===a}function h(a){return 64==a||36===a||95===a||a>=65&&a<=90||a>=97&&a<=122||92===a||a>=128&&eb.NonAsciiIdentifierStart.test(String.fromCharCode(a))}function i(a){return 36===a||95===a||a>=65&&a<=90||a>=97&&a<=122||a>=48&&a<=57||92===a||a>=128&&eb.NonAsciiIdentifierPart.test(String.fromCharCode(a))}function j(a){switch(a){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function k(a){switch(a){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function l(a){return"eval"===a||"arguments"===a}function m(a){if(hb&&k(a))return!0;switch(a.length){case 2:return"if"===a||"in"===a||"do"===a;case 3:return"var"===a||"for"===a||"new"===a||"try"===a||"let"===a;case 4:return"this"===a||"else"===a||"case"===a||"void"===a||"with"===a||"enum"===a;case 5:return"while"===a||"break"===a||"catch"===a||"throw"===a||"const"===a||"yield"===a||"class"===a||"super"===a;case 6:return"return"===a||"typeof"===a||"delete"===a||"switch"===a||"export"===a||"import"===a;case 7:return"default"===a||"finally"===a||"extends"===a;case 8:return"function"===a||"continue"===a||"debugger"===a;case 10:return"instanceof"===a;default:return!1}}function n(a,c,d,e,f){var g;b("number"==typeof d,"Comment must have valid position"),ob.lastCommentStart>=d||(ob.lastCommentStart=d,g={type:a,value:c},pb.range&&(g.range=[d,e]),pb.loc&&(g.loc=f),pb.comments.push(g),pb.attachComment&&(pb.leadingComments.push(g),pb.trailingComments.push(g)))}function o(a){var b,c,d,e;for(b=ib-a,c={start:{line:jb,column:ib-kb-a}};ib<lb;)if(d=gb.charCodeAt(ib),++ib,g(d))return pb.comments&&(e=gb.slice(b+a,ib-1),c.end={line:jb,column:ib-kb-1},n("Line",e,b,ib-1,c)),13===d&&10===gb.charCodeAt(ib)&&++ib,++jb,void(kb=ib);pb.comments&&(e=gb.slice(b+a,ib),c.end={line:jb,column:ib-kb},n("Line",e,b,ib,c))}function p(){var a,b,c,d;for(pb.comments&&(a=ib-2,b={start:{line:jb,column:ib-kb-2}});ib<lb;)if(c=gb.charCodeAt(ib),g(c))13===c&&10===gb.charCodeAt(ib+1)&&++ib,++jb,++ib,kb=ib,ib>=lb&&O({},db.UnexpectedToken,"ILLEGAL");else if(42===c){if(47===gb.charCodeAt(ib+1))return++ib,++ib,void(pb.comments&&(d=gb.slice(a+2,ib-2),b.end={line:jb,column:ib-kb},n("Block",d,a,ib,b)));++ib}else++ib;O({},db.UnexpectedToken,"ILLEGAL")}function q(){var a,b;for(b=0===ib;ib<lb;)if(a=gb.charCodeAt(ib),f(a))++ib;else if(g(a))++ib,13===a&&10===gb.charCodeAt(ib)&&++ib,++jb,kb=ib,b=!0;else if(47===a)if(47===(a=gb.charCodeAt(ib+1)))++ib,++ib,o(2),b=!0;else{if(42!==a)break;++ib,++ib,p()}else if(b&&45===a){if(45!==gb.charCodeAt(ib+1)||62!==gb.charCodeAt(ib+2))break;ib+=3,o(3)}else{if(60!==a)break;if("!--"!==gb.slice(ib+1,ib+4))break;++ib,++ib,++ib,++ib,o(4)}}function r(a){var b,c,e,f=0;fo
AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},eb={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ--ℝℤΩℨK--ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA--zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ--ࢠࢢ----९ॱ-ॷॹ-ॿ--ঌএঐও-নপ-রলশ---ড়ঢ়য়----ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ---ੜਫ਼੦---ઍએ-ઑઓ-નપ-રલળવ----ૐૠ----ଌଏଐଓ-ନପ-ରଲଳଵ---ଡ଼ଢ଼ୟ--୯ୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-------ఌఎ-ఐఒ-నప-ళవ-హఽ---ౘౙౠ---ಌಎ-ಐಒ-ನಪ-ಳವ----ೞೠ--೯ೱೲ-ഌഎ-ഐഒ-ഺഽ-----൯ൺ-ൿ-ඖක-නඳ-රලව------๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ--ຽເ-ໄໆ--໙ໜ-ໟༀ--ཇཉ----က-၉ၐ--ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-
i.prototype.stringify=function(a){e.ok(a,"we need a path");var b="$",c={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return a=this._normalize(a),a.forEach(function(a){if("root"!=a.expression.type){var d,e=[a.scope,a.operation].join("-"),f=c[e];if(d="string_literal"==a.expression.type?JSON.stringify(a.expression.value):a.expression.value,!f)throw new Error("couldn't find template "+e);b+=f.replace(/{{value}}/,d)}}),b},i.prototype._normalize=function(a){if(e.ok(a,"we need a path"),"string"==typeof a)return this.parser.parse(a);if(Array.isArray(a)&&"string"==typeof a[0]){var b=[{expression:{type:"root",value:"$"}}];return a.forEach(function(a,c){if("$"!=a||0!==c)if("string"==typeof a&&a.match("^"+f.identifier+"$"))b.push({operation:"member",scope:"child",expression:{value:a,type:"identifier"}});else{var d="number"==typeof a?"numeric_literal":"string_literal";b.push({operation:"subscript",scope:"child",expression:{value:a,type:d}})}}),b}if(Array.isArray(a)&&"object"==typeof a[0])return a;throw new Error("couldn't understand path "+a)},i.Handlers=h,i.Parser=g;var j=new i;j.JSONPath=i,b.exports=j},{"./dict":2,"./handlers":4,"./parser":6,assert:8}],6:[function(a,b,c){var d=a("./grammar"),e=a("../generated/parser"),f=function(){var a=new e.Parser,b=a.parseError;return a.yy.parseError=function(){a.yy.ast&&a.yy.ast.initialize(),b.apply(a,arguments)},a};f.grammar=d,b.exports=f},{"../generated/parser":1,"./grammar":3}],7:[function(a,b,c){function d(a){return String(a).match(/^[0-9]+$/)?parseInt(a):Number.isFinite(a)?parseInt(a,10):0}b.exports=function(a,b,c,e){if("string"==typeof b)throw new Error("start cannot be a string");if("string"==typeof c)throw new Error("end cannot be a string");if("string"==typeof e)throw new Error("step cannot be a string");var f=a.length;if(0===e)throw new Error("step cannot be zero");if(e=e?d(e):1,b=b<0?f+b:b,c=c<0?f+c:c,b=d(0===b?0:b||(e>0?0:f-1)),c=d(0===c?0:c||(e>0?f:-1)),b=e>0?Math.max(0,b):Math.min(f,b),c=e>0?Math.min(c,f):Math.max(-1,c),e>0&&c<=b)return[];if(e<0&&b<=c)return[];for(var g=[],h=b;h!=c&&!(e<0&&h<=c||e>0&&h>=c);h+=e)g.push(a[h]);return g}},{}],8:[function(a,b,c){function d(a,b){return n.isUndefined(b)?""+b:n.isNumber(b)&&!isFinite(b)?b.toString():n.isFunction(b)||n.isRegExp(b)?b.toString():b}function e(a,b){return n.isString(a)?a.length<b?a:a.slice(0,b):a}function f(a){return e(JSON.stringify(a.actual,d),128)+" "+a.operator+" "+e(JSON.stringify(a.expected,d),128)}function g(a,b,c,d,e){throw new q.AssertionError({message:c,actual:a,expected:b,operator:d,stackStartFunction:e})}function h(a,b){a||g(a,!0,b,"==",q.ok)}function i(a,b){if(a===b)return!0;if(n.isBuffer(a)&&n.isBuffer(b)){if(a.length!=b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}return n.isDate(a)&&n.isDate(b)?a.getTime()===b.getTime():n.isRegExp(a)&&n.isRegExp(b)?a.source===b.source&&a.global===b.global&&a.multiline===b.multiline&&a.lastIndex===b.lastIndex&&a.ignoreCase===b.ignoreCase:n.isObject(a)||n.isObject(b)?k(a,b):a==b}function j(a){return"[object Arguments]"==Object.prototype.toString.call(a)}function k(a,b){if(n.isNullOrUndefined(a)||n.isNullOrUndefined(b))return!1;if(a.prototype!==b.prototype)return!1;if(n.isPrimitive(a)||n.isPrimitive(b))return a===b;var c=j(a),d=j(b);if(c&&!d||!c&&d)return!1;if(c)return a=o.call(a),b=o.call(b),i(a,b);var e,f,g=r(a),h=r(b);if(g.length!=h.length)return!1;for(g.sort(),h.sort(),f=g.length-1;f>=0;f--)if(g[f]!=h[f])return!1;for(f=g.length-1;f>=0;f--)if(e=g[f],!i(a[e],b[e]))return!1;return!0}function l(a,b){return!(!a||!b)&&("[object RegExp]"==Object.prototype.toString.call(b)?b.test(a):a instanceof b||!0===b.call({},a))}function m(a,b,c,d){var e;n.isString(c)&&(d=c,c=null);try{b()}catch(f){e=f}if(d=(c&&c.name?" ("+c.name+").":".")+(d?" "+d:"."),a&&!e&&g(e,c,"Missing expected exception"+d),!a&&l(e,c)&&g(e,c,"Got unwanted exception"+d),a&&e&&c&&!l(e,c)||!a&&e)throw e}var n=a("util/"),o=Array.prototype.slice,p=Object.prototype.hasOwnProperty,q=b.exports=h;q.AssertionError