cn-font-split
Version:
划时代的字体切割工具,CJK与任何字符!支持 otf、ttf、woff2 字体多线程切割,完美地细颗粒度地进行包大小控制。A revolutionary font subetter that supports CJK and any characters! It enables multi-threaded subset of otf, ttf, and woff2 fonts, allowing for precise control over package size.
31 lines (30 loc) • 917 B
JavaScript
import { readFileSync as s } from "fs";
import { execSync as t } from "child_process";
const c = () => {
let r = !1;
return process.platform === "linux" && (r = l(), r === null && (r = n()), r === null && (r = u())), !!r;
}, l = () => {
try {
return s("/usr/bin/ldd", "utf-8").includes("musl");
} catch {
return null;
}
}, n = () => {
const r = typeof process.report.getReport == "function" ? process.report.getReport() : null;
return r ? r.header && r.header.glibcVersionRuntime ? !1 : !!(Array.isArray(r.sharedObjects) && r.sharedObjects.some(
(e) => e.includes("libc.musl-") || e.includes("ld-musl-")
)) : null;
}, u = () => {
try {
return t("ldd --version", { encoding: "utf8" }).includes("musl");
} catch {
return !1;
}
};
export {
c as isMusl,
u as isMuslFromChildProcess,
l as isMuslFromFilesystem,
n as isMuslFromReport
};
//# sourceMappingURL=isMusl.mjs.map