File Explorer

/opt/rust

This explorer reads the filesystem of the server it runs on, so /workspace/user isn't present here. Browsing and the terminal still work against this server's own disk from /.

0 dirs
8 files
bytecode.js5.2 KB · 3 lines
const { process } = globalThis;"use strict";var g=Symbol.for("@vercel/node-module-precompile");var y=require("fs"),P=require("module"),A=require("v8");function m(o,t,n){if(o.sourcemap[t]){let[e,r,s]=o.sourcemap[t]??[];if(e===n)return o.buffer.subarray(r,s)}}var M=require("crypto"),v=require("path"),h=require("vm"),d={HIT:0,MISS:0,STALE:0};function E(o){return function(n,e){let r=I(n),s=(0,M.createHash)("sha1").update(r,"utf8").digest("hex"),c=m(o.byteCodeCache,e,s),u=new h.Script(o.Module.wrap(r),{cachedData:c,displayErrors:!0,filename:e,lineOffset:0,importModuleDynamically:h.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER});return c?.length?u.cachedDataRejected!==!1?d.STALE++:d.HIT++:d.MISS++,process.env.VERCEL_DEBUG_CODE_CACHE&&(c?.length?u.cachedDataRejected!==!1?console.log(`[Cache FAILED] ${e}`):console.log(`[Cache OK] ${e} (${c.length})`):console.log(`[Cache MISSING] ${e}`)),(o.nodeMajor>=22||r.indexOf("import (")===-1&&r.indexOf("import(")===-1)&&o.scriptsCache?.set(e,[s,u]),u.runInThisContext({columnOffset:0,displayErrors:!0,filename:e,lineOffset:0})}}function x(o){return function(n,e){let r=this;function s(i){return r.require(i)}function c(i,p){return o.Module._resolveFilename(i,r,!1,p)}s.resolve=c,c.paths=function(p){return o.Module._resolveLookupPaths(p,r,!0)},s.main=process.mainModule,s.extensions=o.Module._extensions,s.cache=o.Module._cache;let u=[r.exports,s,r,e,(0,v.dirname)(e),process,global,Buffer],a=o.precompile(n,e);return function(){return a.apply(r.exports,u)}}}function I(o){let t=o.length,n=o;if(t>=2&&n.charCodeAt(0)===35&&n.charCodeAt(1)===33)if(t===2)n="";else{let e=2;for(;e<t;++e){let r=n.charCodeAt(e);if(r===10||r===13)break}e===t?n="":n=n.slice(e)}return n}function _(o){let t=o.readUInt32LE(0);return{metadata:JSON.parse(o.subarray(4,t+4).toString("utf8")),buffer:o.subarray(t+4)}}function D(o,t){let n={},e=[],r=0,s=new Set([...Object.keys(o.metadata.sourcemap),...Object.keys(t.metadata.sourcemap)]);for(let c of s){let{invalidationKey:u,buffer:a}=R(c,o,t);n[c]=[u,r,r+a.length],r+=a.length,e.push(a)}return{buffer:Buffer.concat(e),metadata:{version:1,filename:t.metadata.filename,stats:t.metadata.stats,sourcemap:n,runtime:t.metadata.runtime??o.metadata.runtime}}}function R(o,t,n){let e=t.metadata.sourcemap[o],r=n.metadata.sourcemap[o];if(e&&r){let s=t.buffer.subarray(e[1],e[2]),c=n.buffer.subarray(r[1],r[2]);return s.length>c.length?{invalidationKey:e[0],buffer:s}:{invalidationKey:r[0],buffer:c}}return e?{invalidationKey:e[0],buffer:t.buffer.subarray(e[1],e[2])}:{invalidationKey:r[0],buffer:n.buffer.subarray(r[1],r[2])}}var l=P.Module,T=".v8-cache/BLOB",[C]=process.versions.node.split(".").map(Number);function b(){return{node:process.version,v8:process.versions.v8,cachedDataVersionTag:(0,A.cachedDataVersionTag)(),arch:process.arch,platform:process.platform}}function L(o){let t="runtime"in o.metadata?o.metadata.runtime:void 0;if(!t)return C!==20;let n=b();return t.node===n.node&&t.v8===n.v8&&t.cachedDataVersionTag===n.cachedDataVersionTag&&t.arch===n.arch&&t.platform===n.platform}function O(){let o=l.prototype._compile;if(!o||o[g]||C<20||process.versions.bun)return;performance.mark("vc:bytecode-started");let t=T,n=!1,e={buffer:Buffer.alloc(0),sourcemap:{}};try{let a=_((0,y.readFileSync)(t));n=(0,y.existsSync)(`${t}.ro`);let i=L(a),p="runtime"in a.metadata,f=!!process.env.VERCEL_DEBUG_CODE_CACHE;i?(!p&&f&&console.log(`[Cache V1] ${t} (missing runtime metadata; compatibility mode)`),e.sourcemap=a.metadata.sourcemap,e.buffer=a.buffer):f&&console.log(`[Cache SKIP] ${t} (runtime mismatch)`)}catch{process.env.VERCEL_DEBUG_CODE_CACHE&&console.error("Failed to deserialize the cache")}let r=n?null:new Map,s=E({Module:l,scriptsCache:r,byteCodeCache:e,nodeMajor:C}),c=x({Module:l,scriptsCache:r,byteCodeCache:e,precompile:s,nodeMajor:C}),u=new Set;l.prototype._compile=function(i,p){try{return c.call(this,i,p).call(this)}catch(f){if(f instanceof SyntaxError)return process.env.VERCEL_DEBUG_CODE_CACHE&&console.log(`[Cache SKIP] ${p} (SyntaxError: ESM module)`),o.call(this,i,p);throw f}},Object.defineProperty(l.prototype._compile,g,{enumerable:!1,value:!0}),Object.defineProperty(globalThis,Symbol.for("@vercel/get-code-cache"),{enumerable:!1,value:{getSnapshot:async({minByteCodeSize:a,maxByteCodeSize:i,dedupeKey:p})=>{if(!r)return{snapshot:null};if(a===void 0||i===void 0||a<=0||i<=0||a>i)return{snapshot:null};if(u.has(p))return{snapshot:null};u.add(p);let f=j({filepath:t,byteCodeCache:e,scriptsCache:r}),S=f.metadata.stats.generated.length;if(S>=a&&S<=i){let V={buffer:e.buffer,metadata:{version:1,stats:{generated:{scripts:0,length:0},rejections:0},sourcemap:e.sourcemap,filename:t,runtime:b()}},B=D(V,f);return e.sourcemap={...B.metadata.sourcemap},e.buffer=B.buffer,{snapshot:f}}return{snapshot:null}},getStatus:()=>d}}),performance.mark("vc:bytecode-finished")}function j(o){let t={generated:{scripts:0,length:0},rejections:0},n={},e=[],r=0;for(let[s,[c,u]]of o.scriptsCache){let a=u.createCachedData();u.cachedDataRejected&&(t.rejections+=1);let i=m(o.byteCodeCache,s,c);(!i||i.length<a.length)&&(t.generated.length+=a.length-(i?.length??0),t.generated.scripts+=1,n[s]=[c,r,r+a.length],r+=a.length,e.push(a))}return{metadata:{filename:o.filepath,sourcemap:n,stats:t,runtime:b()},buffer:Buffer.concat(e)}}O();