@easbot/utils 0.3.17 → 0.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{chunk-PVTJQVMO.cjs → chunk-5XHOPT4Y.cjs} +1 -1
- package/dist/chunks/chunk-GVXRTRAT.cjs +2 -0
- package/dist/chunks/{chunk-QBLZGSTI.cjs → chunk-KKCFNFFR.cjs} +5 -5
- package/dist/chunks/{chunk-JI7GHGIF.mjs → chunk-N26SFBEH.mjs} +2 -2
- package/dist/chunks/{chunk-ZA3GGWB3.mjs → chunk-OEWMITBM.mjs} +1 -1
- package/dist/chunks/chunk-XGZ7XJWW.mjs +2 -0
- package/dist/chunks/filesystem-DXKLXORJ.cjs +1 -0
- package/dist/chunks/filesystem-YGESISP6.mjs +1 -0
- package/dist/chunks/registry-CEQNVNEA.cjs +1 -0
- package/dist/chunks/registry-JMOZUWPG.mjs +1 -0
- package/dist/chunks/shell-4USPDVM2.cjs +1 -0
- package/dist/chunks/shell-GC34UPJP.mjs +1 -0
- package/dist/index.cjs +22 -58
- package/dist/index.d.cts +66 -40
- package/dist/index.d.ts +66 -40
- package/dist/index.mjs +20 -56
- package/package.json +2 -2
- package/dist/chunks/chunk-AJU5GBQB.cjs +0 -2
- package/dist/chunks/chunk-QNKOAEBG.mjs +0 -2
- package/dist/chunks/filesystem-TBYCQ7D2.cjs +0 -1
- package/dist/chunks/filesystem-WCPIBXDN.mjs +0 -1
- package/dist/chunks/registry-7SGIVICB.cjs +0 -1
- package/dist/chunks/registry-ZZW4VHED.mjs +0 -1
- package/dist/chunks/shell-NYVVJ4D5.mjs +0 -1
- package/dist/chunks/shell-XYMW3MHM.cjs +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {f}from'./chunk-6GV3NECV.mjs';import ut,{mkdir,stat,cp,readFile,writeFile}from'fs/promises';import {statSync,createWriteStream,realpathSync}from'fs';import {extname,basename,resolve,relative}from'path';import {Readable}from'stream';import {pipeline}from'stream/promises';import St from'os';import {glob,globSync}from'glob';f();f();f();function V(e,n){let s=new Set,i=0;for(;i<e.length;){let c=e[i];if(e[i+1]==="-"&&i+2<e.length){let l=e[i+2],g=c.charCodeAt(0),m=l.charCodeAt(0);if(g>m)return null;for(let S=g;S<=m;S++)s.add(String.fromCharCode(S));i+=3;}else s.add(c),i++;}return {kind:"class",chars:s,negate:n}}function _(e){let n=[],s="",i=0;for(;i<e.length;){let c=e[i];if(c==="\\"&&i+1<e.length){s+=e[i+1],i+=2;continue}if(c==="["){let r=e.indexOf("]",i+1);if(r!==-1){let l=e.slice(i+1,r),g=false,m=0;(l.startsWith("!")||l.startsWith("^"))&&(g=true,m=1);let S=V(l.slice(m),g);if(S){s&&(n.push({kind:"literal",text:s}),s=""),n.push(S),i=r+1;continue}}}s+=c,i++;}return s&&n.push({kind:"literal",text:s}),n}function tt(e){let n=et(e);if(n===-1)return null;let s=nt(e,n);if(s===-1)return null;let i=e.slice(n+1,s),c=it(i);if(!c)return null;let r=e.slice(0,n),l=e.slice(s+1),g=[];for(let m of c)g.push(r+m+l);return g}function et(e){for(let n=0;n<e.length;n++){if(e[n]==="\\"&&n+1<e.length){n++;continue}if(e[n]==="{")return n}return -1}function nt(e,n){let s=1;for(let i=n+1;i<e.length;i++){if(e[i]==="\\"&&i+1<e.length){i++;continue}if(e[i]==="{")s++;else if(e[i]==="}"&&(s--,s===0))return i}return -1}function it(e){let n=[],s="",i=0;for(let c=0;c<e.length;c++){let r=e[c];if(r==="\\"&&c+1<e.length){s+=e[c+1],c++;continue}if(r==="{")i++,s+=r;else if(r==="}"){if(i--,s+=r,i<0)return null}else r===","&&i===0?(n.push(s),s=""):s+=r;}return i!==0?null:(n.push(s),n)}function rt(e){let n=tt(e);return n?[{kind:"brace",alternatives:n.map(i=>F(i))}]:F(e)}function F(e,n=false){let s=[],i="",c=0,r=n?e.length-2:e.length;for(;c<r;){let l=e[c];if(l==="\\"&&c+1<r){i+=e[c+1],c+=2;continue}if(l==="*"&&e[c+1]==="*"&&(c+2>=r||e[c+2]==="/")&&(c===0||e[c-1]==="/")){i&&(s.push(..._(i)),i=""),s.push({kind:"starstar"}),c+=2,e[c]==="/"&&c++;continue}if(l==="*"){i&&(s.push(..._(i)),i=""),s.push({kind:"star"}),c++;continue}if(l==="?"){i&&(s.push(..._(i)),i=""),s.push({kind:"question"}),c++;continue}i+=l,c++;}return i&&s.push(..._(i)),s}function st(e){let n=0;for(;n<e.length;){let s=e[n];if(s==="\\"&&n+1<e.length){n+=2;continue}if(s===" ")return e[n+1]==="*"&&n+2===e.length;n++;}return false}function C(e,n,s=0,i=0){for(;s<e.length;){let c=e[s];if(c.kind==="literal"){if(!n.startsWith(c.text,i))return false;i+=c.text.length;}else if(c.kind==="star"){let r=s+1;for(;r<e.length&&e[r].kind==="star";)r++;if(r>=e.length){for(let l=i;l<n.length;l++)if(n[l]==="/")return false;return true}for(let l=i;l<=n.length;l++){if(C(e,n,r,l))return true;if(n[l]==="/")break}return false}else if(c.kind==="starstar"){let r=s+1;for(;r<e.length&&e[r].kind==="starstar";)r++;if(r>=e.length)return true;for(let l=i;l<=n.length;l++)if(C(e,n,r,l))return true;return false}else if(c.kind==="question"){if(i>=n.length||n[i]==="/")return false;i++;}else if(c.kind==="class"){let r=n[i];if(r===void 0||c.chars.has(r)===c.negate)return false;i++;}else if(c.kind==="brace"){for(let r of c.alternatives)if(C(r,n,0,i))return true;return false}s++;}return i===n.length}function N(e){return e.sort((n,s)=>{let i=n[0].length-s[0].length;return i!==0?i:n[0].localeCompare(s[0])})}var A=new Map,ot=1024;function G(e){let n=A.get(e);if(n)return n;let s=rt(e);if(A.size>=ot){let i=A.keys().next().value;i!==void 0&&A.delete(i);}return A.set(e,s),s}var w;(c=>{function e(r,l){if(!l)return r==="";try{if(n(r,l))return !0;if(st(l)){let g=l.slice(0,-2);if(n(r,g))return !0}return !1}catch{return false}}c.match=e;function n(r,l){if(!r)return ct(l);let g=G(l);return C(g,r)}function s(r,l){let g=N(Object.entries(l)),m;for(let[S,y]of g)e(r,S)&&(m=y);return m}c.all=s;function i(r,l){let g=N(Object.entries(l)),m;for(let[S,y]of g){let u=S.split(/\s+/);u.length!==0&&e(r.head,u[0])&&(u.length===1||at(r.tail,u.slice(1)))&&(m=y);}return m}c.allStructured=i;})(w||(w={}));function at(e,n){if(n.length===0)return true;if(e.length<n.length)return false;for(let s=0;s<n.length;s++)if(!w.match(e[s],n[s]))return false;return true}function ct(e){let n=G(e);return C(n,"")}var z;(y=>{y.DEFAULT_MAX_DEPTH=20;function n(u){let d;return u.maxDepth===void 0?d=20:u.maxDepth<1?d=1:u.maxDepth>20?d=20:d=u.maxDepth,{...u,follow:u.symlink??false,nodir:u.include!=="all",maxDepth:d}}async function s(u,d={}){let x=await glob(u,n(d));return c(x)}y.scan=s;function i(u,d={}){let x=globSync(u,n(d));return c(x)}y.scanSync=i;function c(u){let d=false;for(let x of u)if(x.indexOf("\\")!==-1){d=true;break}return d?u.map(x=>D.toUnixPath(x)):u}function r(u,d){return w.match(d,u)}y.match=r;async function l(u){try{let d=await ut.readFile(u,"utf-8");return g(d)}catch{return []}}y.parseGitignore=l;function g(u){let d=[],x=u.split(/\r?\n/);for(let T of x){let E=T.trim();if(!E||E.startsWith("#")||E.startsWith("!"))continue;let h=E;h.endsWith("/")&&(h=`${h}**`),!h.includes("*")&&!h.includes("?")&&!h.includes("[")&&(h=`**/${h}/**`),d.push(h);}return d}y.parseGitignoreContent=g;function m(u,d){let x=u.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/$/,"");for(let T of d)if(w.match(x,T)||w.match(x,`${T}/**`))return true;return false}y.isIgnored=m,y.DEFAULT_IGNORE_PATTERNS=["**/node_modules/**","**/dist/**","**/build/**","**/out/**","**/target/**","**/.cache/**","**/.vite/**","**/.turbo/**","**/.next/**","**/.nuxt/**","**/coverage/**","**/.nyc_output/**","**/logs/**","**/*.log","**/.DS_Store","**/Thumbs.db","**/tmp/**","**/temp/**","**/.git/**","**/*.min.js","**/*.min.ts","**/*.db","**/data/**"];})(z||(z={}));var U=process.platform==="win32",Q={".html":"text/html",".htm":"text/html",".css":"text/css",".csv":"text/csv",".txt":"text/plain",".md":"text/markdown",".xml":"application/xml",".yaml":"application/yaml",".yml":"application/yaml",".toml":"application/toml",".ini":"text/plain",".cfg":"text/plain",".conf":"text/plain",".log":"text/plain",".sh":"application/x-sh",".bash":"application/x-bash",".zsh":"application/x-zsh",".fish":"application/x-fish",".ps1":"application/x-powershell",".bat":"application/x-batch",".cmd":"application/x-batch",".dockerfile":"application/x-dockerfile",".makefile":"application/x-makefile",".properties":"text/plain",".js":"application/javascript",".mjs":"application/javascript",".cjs":"application/javascript",".jsx":"text/javascript",".ts":"application/typescript",".tsx":"text/typescript",".mts":"application/typescript",".json":"application/json",".jsonc":"application/json",".json5":"application/json",".webmanifest":"application/manifest+json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".webp":"image/webp",".avif":"image/avif",".heic":"image/heic",".heif":"image/heif",".bmp":"image/bmp",".tiff":"image/tiff",".tif":"image/tiff",".mp4":"video/mp4",".webm":"video/webm",".ogg":"video/ogg",".avi":"video/x-msvideo",".mkv":"video/x-matroska",".mov":"video/quicktime",".mp3":"audio/mpeg",".wav":"audio/wav",".flac":"audio/flac",".aac":"audio/aac",".opus":"audio/opus",".m4a":"audio/mp4",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".rtf":"application/rtf",".epub":"application/epub+zip",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".tgz":"application/gzip",".bz2":"application/x-bzip2",".xz":"application/x-xz",".7z":"application/x-7z-compressed",".rar":"application/vnd.rar",".wasm":"application/wasm",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject",".db":"application/x-sqlite3",".sqlite":"application/vnd.sqlite3",".proto":"application/protobuf"},vt=Object.fromEntries(Object.entries(Q).map(([e,n])=>[n,e])),D;(jt=>{async function e(t,a){await mkdir(t,{recursive:a?.recursive??true});}jt.mkdir=e;async function n(t,a,o){let p=o?.recursive??true;try{(await stat(t)).isDirectory()||(p=!1);}catch{}await cp(t,a,{recursive:p,dereference:o?.dereference??true,force:o?.force??true});}jt.cp=n;async function s(t){try{return await stat(t),!0}catch{return false}}jt.exists=s;function i(t){try{return statSync(t).isDirectory()}catch{return false}}jt.isDir=i;function c(t){try{return statSync(t)}catch{return}}jt.stat=c;async function r(t){return c(t)?.size??0}jt.size=r;async function l(t){return readFile(t,"utf-8")}jt.readText=l;async function g(t){let a=await readFile(t,"utf-8");try{return JSON.parse(a)}catch(o){let f=o instanceof Error?o.message:String(o);throw new Error(`Invalid JSON in ${t}: ${f}`,{cause:o})}}jt.readJson=g;async function m(t){return readFile(t)}jt.readBytes=m;async function S(t){let a=await readFile(t);return a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)}jt.readArrayBuffer=S;async function y(t,a,o){let f=o!==void 0?{mode:o}:void 0;try{await writeFile(t,a,f);}catch(p){if(wt(p)){await mkdir(h(t),{recursive:true}),await writeFile(t,a,f);return}throw p}}jt.write=y;async function u(t,a,o){return y(t,JSON.stringify(a,null,2),o)}jt.writeJson=u;async function d(t,a,o){await mkdir(h(t),{recursive:true});let f=a instanceof ReadableStream?Readable.fromWeb(a):a,p=o!==void 0?createWriteStream(t,{mode:o}):createWriteStream(t);await pipeline(f,p);}jt.writeStream=d;function x(t){let a=extname(t).toLowerCase();return Q[a]||"application/octet-stream"}jt.mimeType=x;function T(t){return vt[t]}jt.mimeTypeToExt=T;function E(t){return t?!!(t.startsWith("text/")||t==="application/json"||t==="application/xml"||t==="application/javascript"||t==="application/typescript"||t==="application/x-javascript"||t==="application/yaml"||t==="application/x-yaml"||t==="application/toml"||t==="application/x-sh"||t==="application/x-bash"||t==="application/x-zsh"||t==="application/x-powershell"||t==="application/x-batch"||t==="application/x-dockerfile"||t==="application/x-makefile"):false}jt.isTextMime=E;function h(t){if(!t)return ".";let a=b(t).replace(/\/+$/,"")||"/";if(a==="/")return "/";let o=a.lastIndexOf("/");return o===-1?".":o===0?"/":a.slice(0,o)}jt.dirname=h;function kt(t,a){if(!t)return "";let o=b(t).replace(/\/+$/,"");if(!o||o==="/")return "";let f=o.lastIndexOf("/"),p=f===-1?o:o.slice(f+1);return p?(a&&p.endsWith(a)&&(p=p.slice(0,-a.length)),p):""}jt.basename=kt;function Tt(t){if(!t)return "";let a=basename(b(t));if(!a||a==="."||a==="..")return "";let o=a.lastIndexOf(".");return o<=0?"":a.slice(o)}jt.extname=Tt;function b(t){return t==null?"":String(t).replace(/\\/g,"/")}jt.toUnixPath=b;function Y(t,a){if(!t||!a)return "";let o=b(t),f=b(a),p=O(o)?o:resolve(o),v=O(f)?f:resolve(f);return b(relative(p,v))}jt.relative=Y;function L(t=process.env,a=St.homedir){let o=[t.EASBOT_TEST_HOME,t.EASBOT_HOME,t.HOME,t.USERPROFILE];for(let f of o)if(f?.trim())return b(f.trim());try{return b(a())}catch{return ""}}function P(t,a){let o=a??L();if(!t)return o;if(U&&(t=B(t)),t==="~"?t=o:t.startsWith("~/")?t=j(o,t.slice(2)):O(t)||(t=resolve(t)),t=b(t),U)try{t=b(realpathSync.native(t));}catch{}return t}jt.normalize=P;function Et(t,a){let o=a??L();return t?(U&&(t=B(t)),t==="~"?t=o:t.startsWith("~/")?t=j(o,t.slice(2)):O(t)||(t=resolve(t)),b(t)):o}jt.resolve=Et;function O(t){return t?!!(t.startsWith("/")||/^[a-zA-Z]:[/\\]?$/.test(t)||/^[a-zA-Z]:[/\\]/.test(t)):false}jt.isAbsolute=O;function j(t,...a){let o=b(t);for(let f of a){let p=b(f);O(p)?o=p:(o&&!o.endsWith("/")&&(o+="/"),o+=p);}return o}jt.join=j;function B(t){return U?t.replace(/^\/([a-zA-Z]):(?:[\\/]|$)/,(a,o)=>`${o.toUpperCase()}:/`).replace(/^\/([a-zA-Z])(?:\/|$)/,(a,o)=>`${o.toUpperCase()}:/`).replace(/^\/cygdrive\/([a-zA-Z])(?:\/|$)/,(a,o)=>`${o.toUpperCase()}:/`).replace(/^\/mnt\/([a-zA-Z])(?:\/|$)/,(a,o)=>`${o.toUpperCase()}:/`):t}jt.windowsPath=B;function M(t,a){if(!t||!a)return false;let o=P(t),f=P(a);if(!o||!f)return false;let p=Y(o,f);return p?p!==".."&&!p.startsWith("../"):o===f}jt.contains=M;function Pt(t,a){return !t||!a?false:M(t,a)||M(a,t)}jt.overlaps=Pt;async function Ot(t,a,o){let f=[];return await K(a,o,P,h,async p=>{let v=j(p,t);await s(v)&&f.push(v);}),f}jt.findUp=Ot;async function*At(t){let{targets:a,stop:o}=t;yield*yt(t.start,o,P,h,async function*(f){for(let p of a){let v=j(f,p);await s(v)&&(yield v);}});}jt.up=At;async function Ct(t,a,o){let f=[];return await K(a,o,P,h,async p=>{try{let v=await z.scan(t,{cwd:p,absolute:!0,include:"file",dot:!0});f.push(...v);}catch{}}),f}jt.globUp=Ct;})(D||(D={}));async function K(e,n,s,i,c){let r=s(e);if(!r)return;let l=n?s(n):void 0,g=new Set;for(;r&&!g.has(r)&&(g.add(r),await c(r),!(l&&r===l));){let m=i(r);if(m===r)break;r=m;}}async function*yt(e,n,s,i,c){let r=s(e);if(!r)return;let l=n?s(n):void 0,g=new Set;for(;r&&!g.has(r)&&(g.add(r),yield*c(r),!(l&&r===l));){let m=i(r);if(m===r)break;r=m;}}function wt(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}
|
|
2
|
-
export{w as a,z as b,Q as c,D as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkAJU5GBQB_cjs=require('./chunk-AJU5GBQB.cjs');require('./chunk-K7PV4FXJ.cjs');Object.defineProperty(exports,"Filesystem",{enumerable:true,get:function(){return chunkAJU5GBQB_cjs.d}});Object.defineProperty(exports,"MIME_TYPES",{enumerable:true,get:function(){return chunkAJU5GBQB_cjs.c}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{d as Filesystem,c as MIME_TYPES}from'./chunk-QNKOAEBG.mjs';import'./chunk-6GV3NECV.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkPVTJQVMO_cjs=require('./chunk-PVTJQVMO.cjs');require('./chunk-K7PV4FXJ.cjs');Object.defineProperty(exports,"PackageRegistry",{enumerable:true,get:function(){return chunkPVTJQVMO_cjs.o}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{o as PackageRegistry}from'./chunk-ZA3GGWB3.mjs';import'./chunk-6GV3NECV.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{H as $,G as Shell}from'./chunk-JI7GHGIF.mjs';import'./chunk-QNKOAEBG.mjs';import'./chunk-ZA3GGWB3.mjs';import'./chunk-6GV3NECV.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkQBLZGSTI_cjs=require('./chunk-QBLZGSTI.cjs');require('./chunk-AJU5GBQB.cjs'),require('./chunk-PVTJQVMO.cjs'),require('./chunk-K7PV4FXJ.cjs');Object.defineProperty(exports,"$",{enumerable:true,get:function(){return chunkQBLZGSTI_cjs.H}});Object.defineProperty(exports,"Shell",{enumerable:true,get:function(){return chunkQBLZGSTI_cjs.G}});
|