Edit: /tmp/tsx-0/17887-49d2b81ed321aa517c8068bc2ae6f530c024b80d (2909B)
{"code":"__filename=\"/opt/canhelp/node_modules/jose/dist/webapi/util/decode_jwt.js\";(()=>{\nvar __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,\"name\",{value,configurable:true});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from===\"object\"||typeof from===\"function\"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},\"__esModule\",{value:true}),mod);var decode_jwt_exports={};__export(decode_jwt_exports,{decodeJwt:()=>decodeJwt});module.exports=__toCommonJS(decode_jwt_exports);var import_base64url=require(\"./base64url.js\");var import_buffer_utils=require(\"../lib/buffer_utils.js\");var import_type_checks=require(\"../lib/type_checks.js\");var import_errors=require(\"./errors.js\");function decodeJwt(jwt){if(typeof jwt!==\"string\")throw new import_errors.JWTInvalid(\"JWTs must use Compact JWS serialization, JWT must be a string\");const{1:payload,length}=jwt.split(\".\");if(length===5)throw new import_errors.JWTInvalid(\"Only JWTs using Compact JWS serialization can be decoded\");if(length!==3)throw new import_errors.JWTInvalid(\"Invalid JWT\");if(!payload)throw new import_errors.JWTInvalid(\"JWTs must contain a payload\");let decoded;try{decoded=(0,import_base64url.decode)(payload)}catch{throw new import_errors.JWTInvalid(\"Failed to base64url decode the payload\")}let result;try{result=JSON.parse(import_buffer_utils.decoder.decode(decoded))}catch{throw new import_errors.JWTInvalid(\"Failed to parse the decoded payload as JSON\")}if(!(0,import_type_checks.isObject)(result))throw new import_errors.JWTInvalid(\"Invalid JWT Claims Set\");return result}__name(decodeJwt,\"decodeJwt\");0&&(module.exports={decodeJwt});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,sJAA+B,0BAC/B,wBAAwB,kCACxB,uBAAyB,iCACzB,kBAA2B,uBACpB,SAAS,UAAU,IAAK,CAC3B,GAAI,OAAO,MAAQ,SACf,MAAM,IAAI,yBAAW,+DAA+D,EACxF,KAAM,CAAE,EAAG,QAAS,MAAO,EAAI,IAAI,MAAM,GAAG,EAC5C,GAAI,SAAW,EACX,MAAM,IAAI,yBAAW,0DAA0D,EACnF,GAAI,SAAW,EACX,MAAM,IAAI,yBAAW,aAAa,EACtC,GAAI,CAAC,QACD,MAAM,IAAI,yBAAW,6BAA6B,EACtD,IAAI,QACJ,GAAI,CACA,WAAU,iBAAAA,QAAK,OAAO,CAC1B,MACM,CACF,MAAM,IAAI,yBAAW,wCAAwC,CACjE,CACA,IAAI,OACJ,GAAI,CACA,OAAS,KAAK,MAAM,4BAAQ,OAAO,OAAO,CAAC,CAC/C,MACM,CACF,MAAM,IAAI,yBAAW,6CAA6C,CACtE,CACA,GAAI,IAAC,6BAAS,MAAM,EAChB,MAAM,IAAI,yBAAW,wBAAwB,EACjD,OAAO,MACX,CA3BgB","names":["b64u"],"ignoreList":[],"sources":["/opt/canhelp/node_modules/jose/dist/webapi/util/decode_jwt.js"],"sourcesContent":[null]}}