���Root Mod By V1rus_Alfa
User / IP
:
216.73.216.158
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
node_modules.1
/
@iconify
/
utils
/
lib
/
loader
/
Viewing: fs.mjs
import { promises } from 'fs'; import { importModule } from 'local-pkg'; import { tryInstallPkg } from './install-pkg.mjs'; import { resolvePath } from 'mlly'; import '@antfu/install-pkg'; import '@antfu/utils'; import 'kolorist'; import './warn.mjs'; const _collections = /* @__PURE__ */ Object.create(null); const isLegacyExists = /* @__PURE__ */ Object.create(null); async function loadCollectionFromFS(name, autoInstall = false, scope = "@iconify-json", cwd = process.cwd()) { const cache = _collections[cwd] || (_collections[cwd] = /* @__PURE__ */ Object.create(null)); if (!await cache[name]) { cache[name] = task(); } return cache[name]; async function task() { const packageName = scope.length === 0 ? name : `${scope}/${name}`; let jsonPath = await resolvePath(`${packageName}/icons.json`, { url: cwd }).catch(() => void 0); if (scope === "@iconify-json") { if (isLegacyExists[cwd] === void 0) { const testResult = await resolvePath( `@iconify/json/collections.json`, { url: cwd } ).catch(() => void 0); isLegacyExists[cwd] = !!testResult; } const checkLegacy = isLegacyExists[cwd]; if (!jsonPath && checkLegacy) { jsonPath = await resolvePath( `@iconify/json/json/${name}.json`, { url: cwd } ).catch(() => void 0); } if (!jsonPath && !checkLegacy && autoInstall) { await tryInstallPkg(packageName, autoInstall); jsonPath = await resolvePath(`${packageName}/icons.json`, { url: cwd }).catch(() => void 0); } } else if (!jsonPath && autoInstall) { await tryInstallPkg(packageName, autoInstall); jsonPath = await resolvePath(`${packageName}/icons.json`, { url: cwd }).catch(() => void 0); } if (!jsonPath) { let packagePath = await resolvePath(packageName, { url: cwd }).catch(() => void 0); if (packagePath?.match(/^[a-z]:/i)) { packagePath = `file:///${packagePath}`.replace(/\\/g, "/"); } if (packagePath) { const { icons } = await importModule( packagePath ); if (icons) return icons; } } let stat; try { stat = jsonPath ? await promises.lstat(jsonPath) : void 0; } catch (err) { return void 0; } if (stat?.isFile()) { return JSON.parse( await promises.readFile(jsonPath, "utf8") ); } else { return void 0; } } } export { loadCollectionFromFS };
Coded With 💗 by
0x6ick Mod By V1rus_Alfa