@easbot/utils 0.2.44 → 0.2.46
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-2ISW3RDH.mjs +1 -0
- package/dist/chunks/chunk-YPKMFQLR.cjs +1 -0
- package/dist/chunks/filesystem-KGIAOOG5.mjs +1 -0
- package/dist/chunks/{filesystem-ALW6PJKX.cjs → filesystem-OYOMZ7F3.cjs} +1 -1
- package/dist/index.cjs +36 -36
- package/dist/index.d.cts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.mjs +34 -34
- package/package.json +2 -2
- package/dist/chunks/chunk-2XMNW35H.mjs +0 -1
- package/dist/chunks/chunk-JL3GR4P7.cjs +0 -1
- package/dist/chunks/filesystem-BAT2ZG5X.mjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkAHO55TRS_cjs=require('./chunk-AHO55TRS.cjs'),chunkVRQQ33YH_cjs=require('./chunk-VRQQ33YH.cjs'),L=require('fs/promises'),fs=require('fs'),path=require('path'),stream=require('stream'),promises=require('stream/promises'),minimatch=require('minimatch'),j=require('os');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var L__default=/*#__PURE__*/_interopDefault(L);var j__default=/*#__PURE__*/_interopDefault(j);chunkVRQQ33YH_cjs.j();chunkVRQQ33YH_cjs.j();exports.a=void 0;(_=>{function m(o){return {...o,follow:o.symlink??false,nodir:o.include!=="all",maxDepth:o.maxDepth??20}}async function g(o,s={}){return chunkAHO55TRS_cjs.b(o,m(s))}_.scan=g;function F(o,s={}){return chunkAHO55TRS_cjs.a(o,m(s))}_.scanSync=F;function E(o,s){return minimatch.minimatch(s,o,{dot:true})}_.match=E;async function Z(o){try{let s=await L__default.default.readFile(o,"utf-8");return T(s)}catch{return []}}_.parseGitignore=Z;function T(o){let s=[],d=o.split(/\r?\n/);for(let W of d){let x=W.trim();if(!x||x.startsWith("#")||x.startsWith("!"))continue;let f=x;f.endsWith("/")&&(f=f+"**"),!f.includes("*")&&!f.includes("?")&&(f="**/"+f+"/**"),s.push(f);}return s}_.parseGitignoreContent=T;function q(o,s){for(let d of s)if(minimatch.minimatch(o,d,{dot:true})||minimatch.minimatch(o,d+"/**",{dot:true}))return true;return false}_.isIgnored=q,_.DEFAULT_IGNORE_PATTERNS=["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/__pycache__/**","**/*.min.js","**/*.min.ts","**/coverage/**","**/data/**","**/*.db","**/logs/**","**/*.log","**/.DS_Store","**/Thumbs.db"];})(exports.a||(exports.a={}));var nt=path.sep,A=nt==="\\";var G={".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":"text/x-sh",".bash":"text/x-bash",".zsh":"text/x-zsh",".fish":"text/x-fish",".ps1":"text/x-powershell",".bat":"text/x-batch",".cmd":"text/x-batch",".dockerfile":"text/x-dockerfile",".makefile":"text/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"},rt=Object.fromEntries(Object.entries(G).map(([m,g])=>[g,m]));exports.c=void 0;(ut=>{async function m(t,e){await L.mkdir(t,{recursive:e?.recursive??true});}ut.mkdir=m;async function g(t){return fs.existsSync(t)}ut.exists=g;async function F(t){try{return fs.statSync(t).isDirectory()}catch{return false}}ut.isDir=F;function E(t){return fs.statSync(t,{throwIfNoEntry:false})??void 0}ut.stat=E;async function Z(t){let e=E(t)?.size??0;return typeof e=="bigint"?Number(e):e}ut.size=Z;async function T(t){return L.readFile(t,"utf-8")}ut.readText=T;async function q(t){return JSON.parse(await L.readFile(t,"utf-8"))}ut.readJson=q;async function J(t){return L.readFile(t)}ut.readBytes=J;async function _(t){let e=await L.readFile(t);return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}ut.readArrayBuffer=_;function o(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="ENOENT"}async function s(t,e,n){try{n?await L.writeFile(t,e,{mode:n}):await L.writeFile(t,e);}catch(r){if(o(r)){await L.mkdir(h(t),{recursive:true}),n?await L.writeFile(t,e,{mode:n}):await L.writeFile(t,e);return}throw r}}ut.write=s;async function d(t,e,n){return s(t,JSON.stringify(e,null,2),n)}ut.writeJson=d;async function W(t,e,n){let r=h(t);fs.existsSync(r)||await L.mkdir(r,{recursive:true});let i=e instanceof ReadableStream?stream.Readable.fromWeb(e):e,a=fs.createWriteStream(t);await promises.pipeline(i,a),n&&await L.chmod(t,n);}ut.writeStream=W;function x(t){let e=path.extname(t).toLowerCase();return G[e]||"application/octet-stream"}ut.mimeType=x;function f(t){return rt[t]}ut.mimeTypeToExt=f;function h(t){if(!t||t.length===0)return ".";let e=p(t);if(e=e.replace(/\/+$/,""),!e||e===""||e==="/")return "/";let n=e.lastIndexOf("/");return n===-1?".":n===0?"/":e.slice(0,n)}ut.dirname=h;function it(t,e){if(!t||t.length===0)return "";let n=p(t);if(n=n.replace(/\/+$/,""),!n||n===""||n==="/")return "";let r=n.lastIndexOf("/"),i=r===-1?n:n.slice(r+1);return i?(e&&i.endsWith(e)&&(i=i.slice(0,-e.length)),i):""}ut.basename=it;function ot(t){if(!t)return "";let e=p(t);if(!e)return "";let n=path.basename(e);if(!n||n===".")return "";let r=n.lastIndexOf(".");return r===-1||r===0?"":n.slice(r)}ut.extname=ot;function p(t){return t?t.replace(/\\/g,"/"):""}ut.toUnixPath=p;function c(t){if(!t||t.length===0)return j__default.default.homedir();if(A&&(t=N(t)),t.startsWith("~/")||t==="~"?t=b(j__default.default.homedir(),t.slice(1)):z(t)||(t=path.resolve(t)),t=p(t),A)try{t=fs.realpathSync.native(t),t=p(t);}catch{}return t}ut.normalize=c;function st(t){return !t||t.length===0?j__default.default.homedir():(A&&(t=N(t)),t.startsWith("~/")||t==="~"?t=b(j__default.default.homedir(),t.slice(1)):z(t)||(t=path.resolve(t)),p(t))}ut.resolve=st;function z(t){return !!(t.startsWith("/")||/^[a-zA-Z]:[/\\]/.test(t)||/^[a-zA-Z]:$/.test(t))}ut.isAbsolute=z;function b(t,...e){let n=p(t);for(let r of e){let i=p(r);z(i)?n=i:(n.endsWith("/")||(n+="/"),n+=i);}return n.replace(/\\/g,"/")}ut.join=b;function N(t){return process.platform!=="win32"?t:t.replace(/^\/([a-zA-Z]):(?:[\\/]|$)/,(e,n)=>`${n.toUpperCase()}:/`).replace(/^\/([a-zA-Z])(?:\/|$)/,(e,n)=>`${n.toUpperCase()}:/`).replace(/^\/cygdrive\/([a-zA-Z])(?:\/|$)/,(e,n)=>`${n.toUpperCase()}:/`).replace(/^\/mnt\/([a-zA-Z])(?:\/|$)/,(e,n)=>`${n.toUpperCase()}:/`)}ut.windowsPath=N;function at(t,e){let n=c(t),r=c(e),i=path.relative(n,r),a=path.relative(r,n);return !i?.startsWith("..")||!a?.startsWith("..")}ut.overlaps=at;function ct(t,e){let n=c(t),r=c(e);return !path.relative(n,r).startsWith("..")}ut.contains=ct;async function ft(t,e,n){let r=c(e),i=n?c(n):void 0,a=[];for(;;){let l=b(r,t);if(await g(l)&&a.push(l),i&&r===i)break;let u=h(r);if(u===r)break;r=u;}return a}ut.findUp=ft;async function*pt(t){let{targets:e,start:n,stop:r}=t,i=c(n),a=r?c(r):void 0;for(;;){for(let u of e){let R=b(i,u);await g(R)&&(yield R);}if(a&&i===a)break;let l=h(i);if(l===i)break;i=l;}}ut.up=pt;async function lt(t,e,n){let r=c(e),i=n?c(n):void 0,a=[];for(;;){try{let u=await exports.a.scan(t,{cwd:r,absolute:!0,include:"file",dot:!0});a.push(...u);}catch{}if(i&&r===i)break;let l=h(r);if(l===r)break;r=l;}return a}ut.globUp=lt;})(exports.c||(exports.c={}));exports.b=G;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{c as Filesystem,b as MIME_TYPES}from'./chunk-2XMNW35H.mjs';import'./chunk-DAYGB2XR.mjs';import'./chunk-V6YNYGNC.mjs';
|