Edit: /tmp/tsx-0/17887-3ffdd5894731a8eb7605d81fffe488775c3f1fef (2449B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/dist/utils/get-request-ip.mjs\";(()=>{\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 get_request_ip_exports={};__export(get_request_ip_exports,{getIp:()=>getIp});module.exports=__toCommonJS(get_request_ip_exports);var import_env=require(\"@better-auth/core/env\");var import_ip=require(\"@better-auth/core/utils/ip\");const LOCALHOST_IP=\"127.0.0.1\";function getIp(req,options){if(options.advanced?.ipAddress?.disableIpTracking)return null;const headers=\"headers\"in req?req.headers:req;const ipHeaders=options.advanced?.ipAddress?.ipAddressHeaders||[\"x-forwarded-for\"];for(const key of ipHeaders){const value=\"get\"in headers?headers.get(key):headers[key];if(typeof value===\"string\"){const ip=value.split(\",\")[0].trim();if((0,import_ip.isValidIP)(ip))return(0,import_ip.normalizeIP)(ip,{ipv6Subnet:options.advanced?.ipAddress?.ipv6Subnet})}}if((0,import_env.isTest)()||(0,import_env.isDevelopment)())return LOCALHOST_IP;return null}__name(getIp,\"getIp\");0&&(module.exports={getIp});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,oJAAsC,iCACtC,cAAuC,sCAGvC,MAAM,aAAe,YACrB,SAAS,MAAM,IAAK,QAAS,CAC5B,GAAI,QAAQ,UAAU,WAAW,kBAAmB,OAAO,KAC3D,MAAM,QAAU,YAAa,IAAM,IAAI,QAAU,IACjD,MAAM,UAAY,QAAQ,UAAU,WAAW,kBAAoB,CAAC,iBAAiB,EACrF,UAAW,OAAO,UAAW,CAC5B,MAAM,MAAQ,QAAS,QAAU,QAAQ,IAAI,GAAG,EAAI,QAAQ,GAAG,EAC/D,GAAI,OAAO,QAAU,SAAU,CAC9B,MAAM,GAAK,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,EACpC,MAAI,qBAAU,EAAE,EAAG,SAAO,uBAAY,GAAI,CAAE,WAAY,QAAQ,UAAU,WAAW,UAAW,CAAC,CAClG,CACD,CACA,MAAI,mBAAO,MAAK,0BAAc,EAAG,OAAO,aACxC,OAAO,IACR,CAbS","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/dist/utils/get-request-ip.mjs"],"sourcesContent":[null]}}