@mxfb/tools 0.0.43 → 0.1.1
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/agnostic/_WIP_tennis/index.js +62 -0
- package/agnostic/arrays/index.d.ts +11 -0
- package/{utils/agnostic → agnostic/arrays}/is-array-of/index.d.ts +2 -2
- package/agnostic/arrays/is-array-of/index.js +23 -0
- package/agnostic/async/index.d.ts +8 -0
- package/agnostic/async/index.js +20 -0
- package/agnostic/async/timeout-call/index.d.ts +1 -0
- package/agnostic/async/timeout-call/index.js +6 -0
- package/agnostic/async/transitions/index.d.ts +41 -0
- package/agnostic/async/transitions/index.js +7 -0
- package/agnostic/async/wait/index.d.ts +1 -0
- package/agnostic/async/wait/index.js +6 -0
- package/agnostic/booleans/index.d.ts +8 -0
- package/agnostic/booleans/index.js +17 -0
- package/{utils/agnostic → agnostic/booleans}/is-falsy/index.d.ts +1 -2
- package/agnostic/booleans/is-falsy/index.js +11 -0
- package/agnostic/css/bem/index.d.ts +7 -0
- package/agnostic/css/bem/index.js +9 -0
- package/{utils/agnostic → agnostic/css}/generate-nice-color/index.d.ts +0 -1
- package/agnostic/css/generate-nice-color/index.js +8 -0
- package/agnostic/css/index.d.ts +14 -0
- package/agnostic/css/index.js +177 -0
- package/agnostic/css/is-valid-css-class-name/index.d.ts +2 -0
- package/agnostic/css/is-valid-css-class-name/index.js +8 -0
- package/agnostic/css/styles-set/index.d.ts +37 -0
- package/agnostic/errors/index.d.ts +30 -0
- package/agnostic/errors/index.js +6 -0
- package/agnostic/html/get-node-ancestors/index.d.ts +1 -0
- package/agnostic/html/get-node-ancestors/index.js +6 -0
- package/agnostic/html/get-position-inside-parent/index.d.ts +1 -0
- package/agnostic/html/get-position-inside-parent/index.js +6 -0
- package/agnostic/html/index.d.ts +17 -0
- package/agnostic/html/index.js +39 -0
- package/agnostic/html/insert-node/index.d.ts +2 -0
- package/agnostic/html/insert-node/index.js +6 -0
- package/agnostic/html/placeholders/index.d.ts +9 -0
- package/agnostic/html/placeholders/index.js +6 -0
- package/agnostic/html/sanitize/index.d.ts +24 -0
- package/agnostic/html/sanitize/index.js +9 -0
- package/agnostic/html/selector-to-element/index.d.ts +1 -0
- package/agnostic/html/selector-to-element/index.js +9 -0
- package/agnostic/html/string-to-nodes/index.d.ts +7 -0
- package/agnostic/html/string-to-nodes/index.js +10 -0
- package/agnostic/index.d.ts +26 -0
- package/agnostic/misc/assert/index.d.ts +5 -0
- package/agnostic/misc/assert/index.js +6 -0
- package/agnostic/misc/cast/index.d.ts +9 -0
- package/agnostic/misc/cast/index.js +8 -0
- package/agnostic/misc/crossenv/index.d.ts +13 -0
- package/agnostic/misc/crossenv/index.js +6 -0
- package/agnostic/misc/get-current-downlink/index.d.ts +1 -0
- package/agnostic/misc/get-current-downlink/index.js +6 -0
- package/agnostic/misc/index.d.ts +22 -0
- package/agnostic/misc/index.js +45 -0
- package/{utils/agnostic → agnostic/misc}/is-constructor-function/index.d.ts +1 -1
- package/agnostic/misc/is-constructor-function/index.js +6 -0
- package/{utils/agnostic → agnostic/misc}/is-nullish/index.d.ts +0 -1
- package/agnostic/misc/is-nullish/index.js +10 -0
- package/agnostic/misc/logs/index.d.ts +55 -0
- package/agnostic/misc/logs/index.js +6 -0
- package/agnostic/misc/random/index.d.ts +10 -0
- package/agnostic/misc/random/index.js +6 -0
- package/agnostic/numbers/absolute-modulo/index.d.ts +1 -0
- package/agnostic/numbers/absolute-modulo/index.js +6 -0
- package/agnostic/numbers/clamp/index.d.ts +1 -0
- package/agnostic/numbers/clamp/index.js +6 -0
- package/agnostic/numbers/index.d.ts +13 -0
- package/agnostic/numbers/index.js +30 -0
- package/agnostic/numbers/interpolate/index.d.ts +1 -0
- package/agnostic/numbers/interpolate/index.js +6 -0
- package/agnostic/numbers/responsive-harmonics/index.js +9 -0
- package/agnostic/numbers/round/index.d.ts +1 -0
- package/agnostic/numbers/round/index.js +6 -0
- package/agnostic/objects/enums/index.d.ts +4 -0
- package/agnostic/objects/enums/index.js +7 -0
- package/{utils/agnostic → agnostic/objects/enums}/is-in-enum/index.d.ts +1 -1
- package/agnostic/objects/enums/is-in-enum/index.js +6 -0
- package/agnostic/objects/flatten-getters/index.d.ts +1 -0
- package/agnostic/objects/flatten-getters/index.js +9 -0
- package/agnostic/objects/index.d.ts +12 -0
- package/agnostic/objects/index.js +32 -0
- package/agnostic/objects/is-object/index.d.ts +1 -0
- package/agnostic/objects/is-object/index.js +6 -0
- package/agnostic/objects/is-record/index.d.ts +1 -0
- package/agnostic/objects/is-record/index.js +6 -0
- package/agnostic/objects/record-format/index.js +16 -0
- package/agnostic/objects/validation/index.d.ts +3 -0
- package/agnostic/objects/validation/index.js +6 -0
- package/agnostic/optim/index.d.ts +7 -0
- package/agnostic/optim/index.js +18 -0
- package/{utils/agnostic → agnostic/optim}/memoize/index.d.ts +1 -1
- package/agnostic/optim/memoize/index.js +6 -0
- package/agnostic/optim/throttle-debounce/index.js +8 -0
- package/{utils/agnostic → agnostic/optim}/throttle-debounce/types.d.ts +0 -1
- package/agnostic/regexps/index.d.ts +23 -0
- package/agnostic/regexps/index.js +89 -0
- package/agnostic/strings/char-codes/index.d.ts +17 -0
- package/agnostic/strings/char-codes/index.js +6 -0
- package/agnostic/strings/index.d.ts +14 -0
- package/agnostic/strings/index.js +32 -0
- package/agnostic/strings/matches/index.d.ts +3 -0
- package/agnostic/strings/matches/index.js +10 -0
- package/agnostic/strings/normalize-indent/index.d.ts +1 -0
- package/agnostic/strings/normalize-indent/index.js +6 -0
- package/{utils/agnostic → agnostic/strings}/replace-all/index.d.ts +1 -1
- package/agnostic/strings/replace-all/index.js +6 -0
- package/agnostic/strings/to-alphanum/index.d.ts +1 -0
- package/agnostic/strings/to-alphanum/index.js +6 -0
- package/chunks/chunk-32IRF4OP.js +9 -0
- package/chunks/chunk-34U4HX4V.js +73 -0
- package/chunks/chunk-4GDNHUCZ.js +162 -0
- package/chunks/chunk-4QQBKBYH.js +59 -0
- package/chunks/chunk-4VC5PT5T.js +13 -0
- package/chunks/chunk-5LNUCDQ6.js +132 -0
- package/chunks/chunk-7AWTHZLY.js +12 -0
- package/chunks/chunk-7DBNMU6N.js +14 -0
- package/chunks/chunk-7YW5HL6N.js +168 -0
- package/chunks/chunk-COVPTTAD.js +10 -0
- package/chunks/chunk-DNIOWD7K.js +8 -0
- package/chunks/chunk-DQNJQBC6.js +10 -0
- package/chunks/chunk-E6MSDKON.js +13 -0
- package/chunks/chunk-EDVNAV3G.js +72 -0
- package/chunks/chunk-EW46EXFB.js +8 -0
- package/chunks/chunk-FPEW3A27.js +14 -0
- package/chunks/chunk-GJOU3UAL.js +36 -0
- package/chunks/chunk-HC6ZOHCS.js +14 -0
- package/chunks/chunk-HGCG2J77.js +122 -0
- package/chunks/chunk-IFD7GSGK.js +130 -0
- package/chunks/chunk-JQXNEJAP.js +18 -0
- package/chunks/chunk-JWBDZPQG.js +18 -0
- package/chunks/chunk-K37RALUX.js +8 -0
- package/chunks/chunk-KQT5CTGF.js +21 -0
- package/chunks/chunk-LEXQ6E6L.js +31 -0
- package/chunks/chunk-LQFKUNVQ.js +19 -0
- package/chunks/chunk-MF56TTC5.js +15 -0
- package/chunks/chunk-MT74WIQR.js +41 -0
- package/chunks/chunk-NRITRUZW.js +10 -0
- package/chunks/chunk-NRJQKVQV.js +31 -0
- package/chunks/chunk-OSAXBA7G.js +10 -0
- package/chunks/chunk-PO3V3I57.js +23 -0
- package/chunks/chunk-QXAJXTXV.js +19 -0
- package/chunks/chunk-RCO57B6F.js +9 -0
- package/chunks/chunk-SQZGZ3VT.js +15 -0
- package/chunks/chunk-UYTXXUU7.js +54 -0
- package/chunks/chunk-VTPRO4NJ.js +10 -0
- package/chunks/chunk-VYW4IADX.js +35 -0
- package/chunks/chunk-VZDUZTW6.js +113 -0
- package/chunks/chunk-W5A2TON3.js +10 -0
- package/chunks/chunk-W7YBGJ4H.js +28 -0
- package/chunks/chunk-WLL3FNVL.js +40 -0
- package/chunks/chunk-WOAYU6LB.js +13 -0
- package/chunks/chunk-XA4HVHJ4.js +18 -0
- package/chunks/chunk-XN3PZIVL.js +38 -0
- package/chunks/chunk-YDIBNEGA.js +9 -0
- package/components/index.d.ts +4 -0
- package/index.d.ts +3 -0
- package/node/files/index.d.ts +9 -0
- package/node/files/index.js +21 -0
- package/node/files/is-in-directory/index.d.ts +1 -0
- package/node/files/is-in-directory/index.js +6 -0
- package/node/files/read-write/index.d.ts +9 -0
- package/node/files/read-write/index.js +6 -0
- package/node/files/subpaths/index.d.ts +34 -0
- package/node/files/subpaths/index.js +7 -0
- package/node/image/index.js +74 -0
- package/node/index.d.ts +6 -0
- package/node/mxfb-cli-config/index.js +113 -0
- package/node/process/index.d.ts +8 -0
- package/node/process/index.js +20 -0
- package/{utils/node/process-exit → node/process/on-exit}/index.d.ts +1 -1
- package/node/process/on-exit/index.js +14 -0
- package/package.json +12 -13
- package/shared/errors/index.d.ts +14 -0
- package/shared/index.d.ts +0 -0
- package/chunks/chunk-BEZTX3QU.js +0 -1
- package/chunks/chunk-BW5CY5YB.js +0 -1
- package/chunks/chunk-DIPJ73JH.js +0 -1
- package/chunks/chunk-EFFU6KXJ.js +0 -1
- package/chunks/chunk-KNE7WIIW.js +0 -1
- package/chunks/chunk-LCLAV6Q2.js +0 -1
- package/chunks/chunk-PCAKH6ZJ.js +0 -1
- package/chunks/chunk-QQRJPDR7.js +0 -1
- package/chunks/chunk-WZBNXYN3.js +0 -1
- package/chunks/chunk-XCKXCF4A.js +0 -1
- package/chunks/chunk-ZVJO36JU.js +0 -1
- package/components/Comp/index.js +0 -1
- package/index.js +0 -102
- package/utils/agnostic/_WIP_tennis/index.js +0 -1
- package/utils/agnostic/absolute-modulo/index.d.ts +0 -1
- package/utils/agnostic/absolute-modulo/index.js +0 -1
- package/utils/agnostic/array/index.d.ts +0 -7
- package/utils/agnostic/array/index.js +0 -1
- package/utils/agnostic/assert/index.d.ts +0 -3
- package/utils/agnostic/assert/index.js +0 -1
- package/utils/agnostic/await-timeout/index.d.ts +0 -2
- package/utils/agnostic/await-timeout/index.js +0 -1
- package/utils/agnostic/bem/index.d.ts +0 -5
- package/utils/agnostic/bem/index.js +0 -1
- package/utils/agnostic/cast/index.d.ts +0 -7
- package/utils/agnostic/cast/index.js +0 -1
- package/utils/agnostic/charcode-string/index.d.ts +0 -2
- package/utils/agnostic/charcode-string/index.js +0 -1
- package/utils/agnostic/clamp/index.d.ts +0 -1
- package/utils/agnostic/clamp/index.js +0 -1
- package/utils/agnostic/clientside-html-sanitizer/index.d.ts +0 -22
- package/utils/agnostic/clientside-html-sanitizer/index.js +0 -1
- package/utils/agnostic/crossenv/index.d.ts +0 -11
- package/utils/agnostic/crossenv/index.js +0 -1
- package/utils/agnostic/flatten-getters/index.d.ts +0 -1
- package/utils/agnostic/flatten-getters/index.js +0 -1
- package/utils/agnostic/generate-html-placeholders/index.d.ts +0 -7
- package/utils/agnostic/generate-html-placeholders/index.js +0 -5
- package/utils/agnostic/generate-nice-color/index.js +0 -1
- package/utils/agnostic/insert-node/index.d.ts +0 -2
- package/utils/agnostic/insert-node/index.js +0 -1
- package/utils/agnostic/interpolate/index.d.ts +0 -3
- package/utils/agnostic/interpolate/index.js +0 -1
- package/utils/agnostic/is-array-of/index.js +0 -1
- package/utils/agnostic/is-constructor-function/index.js +0 -1
- package/utils/agnostic/is-falsy/index.js +0 -1
- package/utils/agnostic/is-in-enum/index.js +0 -1
- package/utils/agnostic/is-nullish/index.js +0 -1
- package/utils/agnostic/is-object/index.d.ts +0 -1
- package/utils/agnostic/is-object/index.js +0 -1
- package/utils/agnostic/is-record/index.d.ts +0 -1
- package/utils/agnostic/is-record/index.js +0 -1
- package/utils/agnostic/is-valid-css-class-name/index.d.ts +0 -2
- package/utils/agnostic/is-valid-css-class-name/index.js +0 -1
- package/utils/agnostic/memoize/index.js +0 -1
- package/utils/agnostic/object-validate-from-partial/index.d.ts +0 -1
- package/utils/agnostic/object-validate-from-partial/index.js +0 -1
- package/utils/agnostic/random/index.d.ts +0 -9
- package/utils/agnostic/random/index.js +0 -1
- package/utils/agnostic/record-format/index.js +0 -1
- package/utils/agnostic/regexp/index.d.ts +0 -21
- package/utils/agnostic/regexp/index.js +0 -1
- package/utils/agnostic/replace-all/index.js +0 -1
- package/utils/agnostic/responsive-harmonics/index.js +0 -1
- package/utils/agnostic/round-numbers/index.d.ts +0 -1
- package/utils/agnostic/round-numbers/index.js +0 -1
- package/utils/agnostic/selector-to-element/index.d.ts +0 -1
- package/utils/agnostic/selector-to-element/index.js +0 -1
- package/utils/agnostic/silent-log/index.d.ts +0 -53
- package/utils/agnostic/silent-log/index.js +0 -9
- package/utils/agnostic/str-to-nodes/index.d.ts +0 -7
- package/utils/agnostic/str-to-nodes/index.js +0 -1
- package/utils/agnostic/string-matches/index.d.ts +0 -4
- package/utils/agnostic/string-matches/index.js +0 -1
- package/utils/agnostic/string-normalize-indent/index.d.ts +0 -1
- package/utils/agnostic/string-normalize-indent/index.js +0 -3
- package/utils/agnostic/throttle-debounce/index.js +0 -1
- package/utils/agnostic/to-alphanum/index.d.ts +0 -1
- package/utils/agnostic/to-alphanum/index.js +0 -1
- package/utils/agnostic/transition/index.d.ts +0 -39
- package/utils/agnostic/transition/index.js +0 -1
- package/utils/agnostic/wait/index.d.ts +0 -1
- package/utils/agnostic/wait/index.js +0 -1
- package/utils/browser/dynamic-css/index.d.ts +0 -4
- package/utils/browser/dynamic-css/index.js +0 -2
- package/utils/browser/get-current-downlink/index.d.ts +0 -1
- package/utils/browser/get-current-downlink/index.js +0 -1
- package/utils/browser/get-node-ancestors/index.d.ts +0 -1
- package/utils/browser/get-node-ancestors/index.js +0 -1
- package/utils/node/image/index.js +0 -1
- package/utils/node/is-in-directory/index.d.ts +0 -1
- package/utils/node/is-in-directory/index.js +0 -1
- package/utils/node/list-subpaths/index.d.ts +0 -33
- package/utils/node/list-subpaths/index.js +0 -1
- package/utils/node/mxfb-cli-config/index.js +0 -2
- package/utils/node/process-exit/index.js +0 -1
- package/utils/node/read-write-file/index.d.ts +0 -12
- package/utils/node/read-write-file/index.js +0 -1
- /package/{utils/agnostic → agnostic}/_WIP_tennis/index.d.ts +0 -0
- /package/{utils/agnostic → agnostic/css}/bem/BEM.d.ts +0 -0
- /package/{utils/agnostic → agnostic/css}/bem/getNamesArr.d.ts +0 -0
- /package/{utils/agnostic → agnostic/numbers}/responsive-harmonics/index.d.ts +0 -0
- /package/{utils/agnostic → agnostic/objects}/record-format/index.d.ts +0 -0
- /package/{utils/agnostic → agnostic/optim}/throttle-debounce/index.d.ts +0 -0
- /package/{utils/node → node}/image/index.d.ts +0 -0
- /package/{utils/node → node}/mxfb-cli-config/index.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function getCurrentDownlink(): number | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function o(){let n=window.navigator;return(n?.connection??n?.mozConnection??n?.webkitConnection)?.downlink}export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function getNodeAncestors(node: Node): Element[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function l(t){let n=[],e=t.parentElement;for(;e!==null;)n.push(e),e=e.parentElement;return n}export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import f from"node:path";import v from"node-fetch";import z from"get-image-colors";import g from"fs-extra";import A from"sharp";async function U(o){let n=await(await v(o)).blob(),s=await n.arrayBuffer(),p=Buffer.from(s);return(await z(p,n.type)).map(c=>c.hex())}var P={jpgExtensions:[".jpg",".jpeg"],pngExtensions:[".png"],webpExtensions:[".wepb"],avifExtensions:[".avif",".avifs"],heifExtensions:[".heif",".heifs",".hif"]};async function W(o,a,n=[],s=100){if(!f.isAbsolute(o))throw new Error("Source path must be absolute.");let p=await g.readdir(o),{jpgExtensions:m,pngExtensions:u,webpExtensions:c,avifExtensions:d,heifExtensions:h}=P,$=[...m,...u,...c,...d,...h].flat();for(let w of p){let E=f.join(o,w);if((await g.stat(E)).isDirectory())continue;let t=f.extname(w);if(!$.includes(t.toLowerCase()))continue;let b=w.replace(new RegExp(`${t}$`),""),x=b.split(".").slice(1).slice(-1)[0]??"";if((x===""?x:`.${x}`)===a)continue;let F=b.replace(new RegExp(`${a}$`),"");for(let y in n){let l=n[y],j=`${F}.${l}${a}${t}`,e=f.join(o,j),i=Array.isArray(s)?s[y]??s.slice(-1)[0]??100:s,r=A(E).withMetadata().resize(l,l,{fit:"inside",withoutEnlargement:!0});m.includes(t)&&await r.jpeg({quality:i}).toFile(e),u.includes(t)&&await r.png({quality:i}).toFile(e),c.includes(t)&&await r.webp({quality:i}).toFile(e),d.includes(t)&&await r.avif({quality:i}).toFile(e),h.includes(t)&&await r.heif({quality:i}).toFile(e),console.log(e),console.log("size",l),console.log("quality",i),console.log("poids",(await g.stat(e)).size)}}}export{W as compressImages,P as compressorExtensions,U as getImageColorsFromUrl};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function isInDirectory(childPath: string, parentPath: string): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"node:path";function n(r,i){let t=e.relative(i,r);return t!==""&&!t.startsWith("..")}export{n as default};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Stats } from 'node:fs';
|
|
3
|
-
export type ChildType = 'file' | 'directory' | 'symlink';
|
|
4
|
-
export type ChildDetails = {
|
|
5
|
-
type: ChildType;
|
|
6
|
-
hidden: boolean;
|
|
7
|
-
realPath: string;
|
|
8
|
-
};
|
|
9
|
-
export type Options = {
|
|
10
|
-
directories?: boolean;
|
|
11
|
-
files?: boolean;
|
|
12
|
-
symlinks?: boolean;
|
|
13
|
-
hidden?: boolean;
|
|
14
|
-
followSimlinks?: boolean;
|
|
15
|
-
dedupeSimlinksContents?: boolean;
|
|
16
|
-
maxDepth?: number;
|
|
17
|
-
returnRelative?: boolean;
|
|
18
|
-
exclude?: RegExp | string | (RegExp | string)[] | null;
|
|
19
|
-
include?: RegExp | string | (RegExp | string)[] | null;
|
|
20
|
-
filter?: ((path: string, details: ChildDetails) => boolean | Promise<boolean>);
|
|
21
|
-
};
|
|
22
|
-
export declare const defaultOptions: Required<Options>;
|
|
23
|
-
export declare const fillOptions: (input: Options) => Required<Options>;
|
|
24
|
-
export type Context = {
|
|
25
|
-
depth?: number;
|
|
26
|
-
lstats?: Stats | null;
|
|
27
|
-
rootPath?: string | null;
|
|
28
|
-
};
|
|
29
|
-
export declare const defaultContext: Required<Context>;
|
|
30
|
-
export declare const fillContext: (input: Context) => Required<Context>;
|
|
31
|
-
export default function listSubpaths(...args: Parameters<typeof listAbsoluteSubpaths>): Promise<string[]>;
|
|
32
|
-
declare function listAbsoluteSubpaths(inputPath: string, _options?: Options, __private_context?: Context): Promise<string[]>;
|
|
33
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as x}from"../../../chunks/chunk-KNE7WIIW.js";import{promises as a}from"node:fs";import h from"node:path";var P={directories:!0,files:!0,symlinks:!0,hidden:!0,followSimlinks:!1,dedupeSimlinksContents:!1,maxDepth:1/0,returnRelative:!1,exclude:null,include:null,filter:()=>!0},S=s=>({...P,...s}),v={depth:0,lstats:null,rootPath:null},O=s=>({...v,...s});async function E(...s){let[c,u]=s,t=S(u??{}),e=await p(...s);return t.returnRelative?e.map(i=>h.relative(c,i)):e}async function p(s,c={},u={}){let t=S(c),e=O(u);e.rootPath===null&&(e.rootPath=s);let i=[];if(e.depth>t.maxDepth)return i;try{if(!(e.lstats??await a.lstat(s)).isDirectory())return i}catch{return i}let k=await a.readdir(s);return await Promise.all(k.map(async d=>{let o=h.join(s,d),R=h.relative(e.rootPath??s,o),r=await a.lstat(o);try{let n=r.isDirectory(),l=r.isSymbolicLink(),f=!n&&!l,w=h.basename(o).startsWith("."),g=n?"directory":l?"symlink":"file";if(n&&t.directories===!1)throw!0;if(l&&t.symlinks===!1||f&&t.files===!1||w&&t.hidden===!1)throw!1;let m=l?await a.realpath(o):o,y=t.returnRelative?R:o,C=x(y,t.exclude??[]),D=x(y,t.include??[]);if(C&&!D)throw!1;if(!await t.filter(y,{type:g,hidden:w,realPath:m}))throw!0;if(l)if(t.followSimlinks===!1)i.push(o);else{let b=await p(m,t,{...e,depth:e.depth+1});i.push(m,...b)}else if(n){let b=await p(o,t,{...e,depth:e.depth+1,lstats:r});i.push(o,...b)}else i.push(o)}catch(n){if(typeof n!="boolean")throw new Error("This try/catch block should only throw booleans");if(!n)return[];let f=await p(o,t,{...e,depth:e.depth+1,lstats:r});i.push(...f)}})),t.dedupeSimlinksContents?Array.from(new Set(i)):i}export{E as default,v as defaultContext,P as defaultOptions,O as fillContext,S as fillOptions};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import u from"node:os";import{promises as n}from"node:fs";import a from"node:path";var g=u.homedir(),f=a.join(g,".config/mxfb-cli"),o=a.join(f,"config.json"),p={};async function y(t=!1){await n.mkdir(f,{recursive:!0});try{if(await n.stat(o),t===!0)throw"create anyway";return!0}catch{try{return await n.writeFile(o,`${JSON.stringify(p,null,2)}
|
|
2
|
-
`,{encoding:"utf-8"}),!0}catch(e){return e instanceof Error?e:typeof e=="string"?new Error(e):new Error(`${e}`)}}}var s="THIS IS A DESTRUCTIVE AND DEFINITIVE ACTION";async function P(t){return t!==s?new Error("You must provide the security phrase"):(await n.rm(f,{recursive:!0,force:!0}),!0)}async function b(t){return t!==s?new Error("You must provide the security phrase"):(await n.rm(f),!0)}async function l(){try{return await n.stat(o),!0}catch{try{let r=await y();if(r instanceof Error)throw r;return!0}catch(r){return r instanceof Error?r:typeof r=="string"?new Error(r):new Error(`${r}`)}}}async function E(){try{return await n.readFile(o,{encoding:"utf-8"})}catch(t){return t instanceof Error?t:typeof t=="string"?new Error(t):new Error(`${t}`)}}function w(t){return!0}function m(t){try{let r=JSON.parse(t);if(!w(r))throw new Error(`Invalid config file shape: ${t}`);return r}catch(r){return r instanceof Error?r:typeof r=="string"?new Error(r):new Error(`${r}`)}}async function C(t=!1){if(t){let i=await l();if(i!==!0)return i}let r=await E();if(r instanceof Error)return r;let e=m(r);return e instanceof Error,e}async function F(t,r=!1){let e=await C(r);if(e instanceof Error)return e;let i=typeof t=="function"?t(e):{...e,...t},c=JSON.stringify(i,null,2);return await n.writeFile(o,c,{encoding:"utf-8"}),!0}export{y as createConfigFile,P as deleteConfigDir,b as deleteConfigFile,p as emptyConfigObj,l as ensureConfigFile,C as getConfig,E as getConfigFile,m as parseConfigFile,F as updateConfig,w as validateConfigObj};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var i=["SIGINT","SIGTERM","uncaughtException"];function t(o){i.forEach(e=>process.on(e,o))}function r(o){process.on("beforeExit",o)}function n(o){process.on("exit",o)}function s(o){t(o),r(o),n(o)}export{s as anyway,r as beforeExit,t as beforeForcedExit,i as forceExitEvents,n as onExit};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
|
-
import { promises as fs } from 'node:fs';
|
|
5
|
-
type Path = Parameters<typeof fs.writeFile>[0];
|
|
6
|
-
type ReadFileData = Awaited<ReturnType<typeof fs.readFile>>;
|
|
7
|
-
type WriteFileData = Parameters<typeof fs.writeFile>[1];
|
|
8
|
-
type ReadOptions = Parameters<typeof fs.readFile>[1];
|
|
9
|
-
type WriteOptions = Parameters<typeof fs.writeFile>[2];
|
|
10
|
-
export type EditorFunc = (curr: ReadFileData) => WriteFileData;
|
|
11
|
-
export default function readWriteFile(path: Path, editor: EditorFunc, ...options: [ReadOptions?, WriteOptions?]): Promise<string | import("stream").Stream | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView>>;
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{promises as r}from"node:fs";async function d(e,s,...t){let[i,o]=t,p=await r.readFile(e,i),a=s(p),n=t.length===2?o:i;return await r.writeFile(e,a,n),a}export{d as default};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|