@stacksjs/dtsx
Version:
A modern, fast .d.ts generation tool, powered by Bun.
4 lines (3 loc) • 638 B
JavaScript
// @bun
import{Ye as M,Ze as N}from"./chunk-9re4jfrt.js";import{lf as F,rf as L}from"./chunk-wk18gvz1.js";import{xf as g}from"./chunk-pwwfmfhh.js";var R=100,$=0,q=new Map;function K(w,x,G=!0,Q=!1){if(F(x))w=L(w);let U=g(w),W=`${x}:${G?1:0}:${Q?1:0}`,z=q.get(W);if(z&&z.contentHash===U)return z.lastAccess=++$,z.declarations;let Y=Q?M(w,x,G):N(w,x,G);if(q.set(W,{declarations:Y,contentHash:U,lastAccess:++$}),q.size>R){let O=Math.max(1,Math.ceil(q.size*0.1)),B=[];for(let[j,J]of q)B.push([j,J.lastAccess]);B.sort((j,J)=>j[1]-J[1]);for(let j=0;j<O&&j<B.length;j++)q.delete(B[j][0])}return Y}function V(){q.clear()}
export{K as Ve,V as We};