@mxfb/tools 0.0.43 → 0.2.3
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/index.d.ts +4 -0
- package/agnostic/misc/elo/index.d.ts +31 -0
- package/agnostic/misc/elo/index.js +6 -0
- package/agnostic/misc/index.d.ts +6 -0
- package/agnostic/misc/index.js +16 -0
- package/agnostic/misc/tennis/index.d.ts +60 -0
- package/agnostic/misc/tennis/index.js +6 -0
- package/chunks/chunk-TTZHPIH7.js +237 -0
- package/chunks/chunk-ZC5RZBNY.js +33 -0
- package/components/index.d.ts +1 -0
- package/node/index.d.ts +2 -0
- package/node/mxfb-cli-config/index.js +113 -0
- package/package.json +18 -19
- package/shared/errors/index.d.ts +138 -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.d.ts +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/BEM.d.ts +0 -29
- package/utils/agnostic/bem/getNamesArr.d.ts +0 -2
- 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.d.ts +0 -3
- 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.d.ts +0 -5
- package/utils/agnostic/is-array-of/index.js +0 -1
- package/utils/agnostic/is-constructor-function/index.d.ts +0 -2
- package/utils/agnostic/is-constructor-function/index.js +0 -1
- package/utils/agnostic/is-falsy/index.d.ts +0 -8
- package/utils/agnostic/is-falsy/index.js +0 -1
- package/utils/agnostic/is-in-enum/index.d.ts +0 -1
- package/utils/agnostic/is-in-enum/index.js +0 -1
- package/utils/agnostic/is-nullish/index.d.ts +0 -5
- 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.d.ts +0 -3
- 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.d.ts +0 -11
- 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.d.ts +0 -1
- package/utils/agnostic/replace-all/index.js +0 -1
- package/utils/agnostic/responsive-harmonics/index.d.ts +0 -10
- 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.d.ts +0 -30
- package/utils/agnostic/throttle-debounce/index.js +0 -1
- package/utils/agnostic/throttle-debounce/types.d.ts +0 -3
- 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.d.ts +0 -9
- 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.d.ts +0 -5
- 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/node → node}/mxfb-cli-config/index.d.ts +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare function random(bound1?: number): number | undefined;
|
|
2
|
-
export declare function random(bound1?: number, bound2?: number | undefined): number | undefined;
|
|
3
|
-
export default random;
|
|
4
|
-
export declare function randomInt(...args: Parameters<typeof random>): number | undefined;
|
|
5
|
-
export declare const hexChars: string[];
|
|
6
|
-
export declare function randomHexChar(): string;
|
|
7
|
-
export declare function randomHash(length?: number): string;
|
|
8
|
-
export declare function randomHashPattern(pattern: number[], joiner?: string): string;
|
|
9
|
-
export declare function randomUUID(): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function o(n=1,r){let e=r===void 0?0:n,t=r===void 0?n:r;if(e===t||e>t)return;let u=t-e;return Math.random()*u+e}var f=o;function c(...n){let r=o(...n);return r!==void 0?Math.floor(r):void 0}var d=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function a(){let n=Math.floor(Math.random()*16);return d[n]}function i(n=4){return new Array(n).fill(null).map(a).join("")}function m(n,r="-"){return n.map(i).join(r)}function s(){return m([8,4,4,4,12])}export{f as default,d as hexChars,o as random,i as randomHash,m as randomHashPattern,a as randomHexChar,c as randomInt,s as randomUUID};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type FormatKey<Input extends {} = any> = keyof Input | string;
|
|
2
|
-
export type InputValue<Input extends {}, Key extends FormatKey<Input>> = Input extends Record<Key, infer V> ? V : undefined;
|
|
3
|
-
export type FormatterFunc<I, O> = (val: I) => O | Promise<O>;
|
|
4
|
-
export type Format<Input extends {} = any> = {
|
|
5
|
-
[Key in FormatKey<Input>]: FormatterFunc<InputValue<Input, Key>, any>;
|
|
6
|
-
};
|
|
7
|
-
export type UnwrapPromise<PromiseOrNot> = PromiseOrNot extends Promise<infer Resolved> ? Resolved : PromiseOrNot;
|
|
8
|
-
export type Formatted<F extends Format<{}>> = {
|
|
9
|
-
[Key in keyof F]: UnwrapPromise<ReturnType<F[Key]>>;
|
|
10
|
-
};
|
|
11
|
-
export default function recordFormat<I extends {}, F extends Format<I>>(input: I, format: F): Promise<Formatted<F>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
async function a(o,n){let t={};for(let e in n){let r=n[e];typeof r=="function"?t[e]=await r(o[e]):t[e]=r}return t}export{a as default};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare function mergeFlags(...flagStrs: string[]): string;
|
|
2
|
-
export declare function setFlags(regexp: RegExp, _flags: string): RegExp;
|
|
3
|
-
export declare function fromStart(regexp: RegExp, _flags?: string): RegExp;
|
|
4
|
-
export declare function toEnd(regexp: RegExp, _flags?: string): RegExp;
|
|
5
|
-
export declare function fromStartToEnd(regexp: RegExp, _flags?: string): RegExp;
|
|
6
|
-
export declare function stringStartsWith(string: string, _regexp: RegExp): boolean;
|
|
7
|
-
export declare function stringStartsWith(string: string, _regexp: RegExp, returnMatches: true): RegExpMatchArray | null;
|
|
8
|
-
export declare function stringStartsWith(string: string, _regexp: RegExp, returnMatches: false): boolean;
|
|
9
|
-
export declare function stringStartsWith(string: string, _regexp: RegExp, returnMatches: false, _flags: string): boolean;
|
|
10
|
-
export declare function stringStartsWith(string: string, _regexp: RegExp, returnMatches: true, _flags: string): RegExpMatchArray | null;
|
|
11
|
-
export declare function stringEndsWith(string: string, _regexp: RegExp): boolean;
|
|
12
|
-
export declare function stringEndsWith(string: string, _regexp: RegExp, returnMatches: true): RegExpMatchArray | null;
|
|
13
|
-
export declare function stringEndsWith(string: string, _regexp: RegExp, returnMatches: false): boolean;
|
|
14
|
-
export declare function stringEndsWith(string: string, _regexp: RegExp, returnMatches: false, _flags: string): boolean;
|
|
15
|
-
export declare function stringEndsWith(string: string, _regexp: RegExp, returnMatches: true, _flags: string): RegExpMatchArray | null;
|
|
16
|
-
export declare function stringIs(string: string, _regexp: RegExp): boolean;
|
|
17
|
-
export declare function stringIs(string: string, _regexp: RegExp, returnMatches: true): RegExpMatchArray | null;
|
|
18
|
-
export declare function stringIs(string: string, _regexp: RegExp, returnMatches: false): boolean;
|
|
19
|
-
export declare function stringIs(string: string, _regexp: RegExp, returnMatches: false, _flags: string): boolean;
|
|
20
|
-
export declare function stringIs(string: string, _regexp: RegExp, returnMatches: true, _flags: string): RegExpMatchArray | null;
|
|
21
|
-
export declare function stringsToRegexp(strings: string[]): RegExp;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function i(...t){let n=new Set;return t.forEach(e=>e.split("").forEach(r=>n.add(r))),[...n.values()].join("")}function M(t,n){let e=i(t.flags,n);return new RegExp(`${t.source}`,e)}function x(t,n="g"){let e=i(t.flags,n);return new RegExp(`^(${t.source})`,e)}function c(t,n="g"){let e=i(t.flags,n);return new RegExp(`(${t.source})$`,e)}function R(t,n="g"){let e=i(t.flags,n);return x(c(t,e),e)}function d(t,n,e=!0,r="g"){let s=x(n,r);return e?t.match(s):s.test(t)}function _(t,n,e=!0,r="g"){let s=c(n,r);return e?t.match(s):s.test(t)}function b(t,n,e=!1,r="g"){let s=R(n,r);return e?t.match(s):s.test(t)}function W(t){let n=a(t),e=f(n,!1);return new RegExp(e)}function l(t){return t.replace(/\s/igm,"\\s").replace(/\n/igm,"\\n").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a(t,n=new Map){return t.sort((r,s)=>r.length-s.length).forEach(r=>{let[s,...g]=r,E=g.length===0;if(s===void 0)return;let p=[...n.keys()].find(o=>new RegExp(`^(${l(o)})`).test(r)),u=p!==void 0?n.get(p)?.subRootsMap:void 0;if(p===void 0||u===void 0){let o=new Map;return a([g.join("")],o),n.set(s,{subRootsMap:o,isWordEnd:E})}a([g.join("")],u)}),n}function f(t,n){let e=[...t.entries()];if(e.length===0)return"";let r=e.map(([s,g])=>`${l(s)}${f(g.subRootsMap,g.isWordEnd)}`).join("|");return n?`(${r})?`:`(${r})`}export{x as fromStart,R as fromStartToEnd,i as mergeFlags,M as setFlags,_ as stringEndsWith,b as stringIs,d as stringStartsWith,W as stringsToRegexp,c as toEnd};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function replaceAll(input: string, pattern: string | RegExp, replacer: string | ((substring: string, ...args: any[]) => string), maxOps?: number): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function l(s,n,e,g=1e3){let t=s,i=0;for(;t.match(n)&&i<g;)i++,t=t.replace(n,e);return t}export{l as default};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare function getHarmonic(min: number, max: number, level: number, steps: number): number;
|
|
2
|
-
type ScaleDescriptor = {
|
|
3
|
-
screenBounds: [number, number];
|
|
4
|
-
lowLevel: [number, number];
|
|
5
|
-
highLevel: [number, number];
|
|
6
|
-
steps: number;
|
|
7
|
-
clamp?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare function createScale(descriptor: ScaleDescriptor): (level: number) => string | undefined;
|
|
10
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as c}from"../../../chunks/chunk-BW5CY5YB.js";function p(e,n,t,r){if(e===0)return console.warn("Cannot generate harmonics if min value is zero"),NaN;if(r<1)return console.warn("Cannot generate harmonics if steps is lower than one"),NaN;let o=n/e,u=1/parseInt(`${r}`),i=Math.pow(o,u);return e*Math.pow(i,t)}function h(e,n,t,r){let o=(r-n)/(t-e),u=n-e*o;return{slope:o,yIntercept:u}}function v(e){let{slope:n,yIntercept:t}=e,r=c(100*n,3),o=c(t,2);return`calc(${r}vw + ${o}px)`}function g(e){let{screenBounds:[n,t],lowLevel:[r,o],highLevel:[u,i],steps:s,clamp:b}=e;return function(m){if(s<2)return;let a=p(r,u,m-1,s-1),l=p(o,i,m-1,s-1);if(a===void 0||l===void 0)return;let d=h(n,a,t,l),f=v(d);return b===!0?`clamp(${c(a,2)}px, ${f}, ${c(l,2)}px)`:f}}export{g as createScale,p as getHarmonic};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function roundNumbers(number: number, nbDecimals: number): number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"../../../chunks/chunk-BW5CY5YB.js";export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function selectorToElement(selector: string, documentObj?: Document): Promise<HTMLElement>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as o}from"../../../chunks/chunk-LCLAV6Q2.js";async function x(e,m){let i=m??await o(),l=/^[A-Za-z]+/,d=/#[A-Za-z]+[\w\-\:]*/,r=/\.[A-Za-z]+[\w\-]*/,u=/\[[A-Za-z]+[\w\-]*(="[\w\-]+")?\]/,a=e.match(l)??[],n=e.match(d)??[],p=e.match(r)??[],g=e.match(u)??[],h=a[a.length-1]??"div",s=n[n.length-1]??null,f=p.map(t=>t.replace(/^\./,"")),A=g.map(t=>t.replace(/^\[/,"").replace(/\]$/,"").split("=")),c=i.createElement(h);return s!==null&&(c.id=s),c.classList.add(...f),A.forEach(([t,w=""])=>{t!==void 0&&c.setAttribute(t,w)}),c}export{x as default};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export declare function makeTextBlock(text: string, vPadding?: number, hPadding?: number): string;
|
|
2
|
-
export declare const styles: {
|
|
3
|
-
regular: (text: string) => string;
|
|
4
|
-
light: (text: string) => string;
|
|
5
|
-
danger: (text: string) => string;
|
|
6
|
-
important: (text: string) => string;
|
|
7
|
-
title: (text: string) => string;
|
|
8
|
-
info: (text: string) => string;
|
|
9
|
-
error: (text: string) => string;
|
|
10
|
-
warning: (text: string) => string;
|
|
11
|
-
};
|
|
12
|
-
type ConsoleMethod = 'assert' | 'count' | 'countReset' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'groupEnd' | 'info' | 'log' | 'table' | 'time' | 'timeEnd' | 'trace' | 'warn';
|
|
13
|
-
type ConsoleMethodsParams = {
|
|
14
|
-
assert: Parameters<typeof console.assert>;
|
|
15
|
-
count: Parameters<typeof console.count>;
|
|
16
|
-
countReset: Parameters<typeof console.countReset>;
|
|
17
|
-
debug: Parameters<typeof console.debug>;
|
|
18
|
-
dir: Parameters<typeof console.dir>;
|
|
19
|
-
dirxml: Parameters<typeof console.dirxml>;
|
|
20
|
-
error: Parameters<typeof console.error>;
|
|
21
|
-
group: Parameters<typeof console.group>;
|
|
22
|
-
groupCollapsed: Parameters<typeof console.groupCollapsed>;
|
|
23
|
-
groupEnd: Parameters<typeof console.groupEnd>;
|
|
24
|
-
info: Parameters<typeof console.info>;
|
|
25
|
-
log: Parameters<typeof console.log>;
|
|
26
|
-
table: Parameters<typeof console.table>;
|
|
27
|
-
time: Parameters<typeof console.time>;
|
|
28
|
-
timeEnd: Parameters<typeof console.timeEnd>;
|
|
29
|
-
trace: Parameters<typeof console.trace>;
|
|
30
|
-
warn: Parameters<typeof console.warn>;
|
|
31
|
-
};
|
|
32
|
-
declare class Log<T extends ConsoleMethod = ConsoleMethod> {
|
|
33
|
-
type: T;
|
|
34
|
-
data: ConsoleMethodsParams[T];
|
|
35
|
-
time: Date;
|
|
36
|
-
stack: string;
|
|
37
|
-
constructor(type: T, data: ConsoleMethodsParams[T]);
|
|
38
|
-
get displayTime(): string;
|
|
39
|
-
get elapsedTimeMs(): number;
|
|
40
|
-
get displayStack(): string;
|
|
41
|
-
}
|
|
42
|
-
export default class Logger {
|
|
43
|
-
_private_threads: Map<string, Log[]>;
|
|
44
|
-
constructor();
|
|
45
|
-
dir(thread: string | undefined, ...args: ConsoleMethodsParams['dir']): void;
|
|
46
|
-
error(thread?: string, ...args: ConsoleMethodsParams['error']): void;
|
|
47
|
-
log(thread?: string, ...args: ConsoleMethodsParams['log']): void;
|
|
48
|
-
warn(thread?: string, ...args: ConsoleMethodsParams['warn']): void;
|
|
49
|
-
setLog<T extends ConsoleMethod>(threadName: string, type: T, data: ConsoleMethodsParams[T]): this;
|
|
50
|
-
print(this: Logger, threadFilter?: string, withStack?: boolean): void;
|
|
51
|
-
printThreads(this: Logger, withStack?: boolean): void;
|
|
52
|
-
}
|
|
53
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import a from"chalk";function d(t,e=1,o=e){let n=t.split(`
|
|
2
|
-
`),r=Math.max(...n.map(i=>i.length)),s=new Array(n.length+2*e).fill(null).map(()=>new Array(r+o*2).fill(" "));return n.forEach((i,g)=>{let h=i.split("");s[g+e]?.splice(o,h.length,...h)}),s.map(i=>i.join("")).join(`
|
|
3
|
-
`)}var u={regular:t=>t,light:t=>a.grey(t),danger:t=>a.bold.bgRed.whiteBright(d(`/!\\
|
|
4
|
-
|
|
5
|
-
${t}
|
|
6
|
-
`,2,6)),important:t=>a.bold(t),title:t=>`# ${a.bold.underline(`${t}
|
|
7
|
-
`)}`,info:t=>a.blueBright(t),error:t=>a.red(t),warning:t=>a.yellow(t)},p=new Date,l=class{type;data;time;stack;constructor(e,o){this.type=e,this.data=o,this.time=new Date,this.stack=new Error().stack??""}get displayTime(){return this.time.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",weekday:"short",hour:"numeric",minute:"numeric",second:"numeric"})+`:${this.time.getMilliseconds()}`}get elapsedTimeMs(){return(this.time.getTime()-p.getTime())/1e3}get displayStack(){return this.stack.split(`
|
|
8
|
-
`).map(e=>e.trim()).slice(4).join(`
|
|
9
|
-
`)}},c=class{_private_threads=new Map;constructor(){this.dir=this.dir.bind(this),this.error=this.error.bind(this),this.log=this.log.bind(this),this.warn=this.warn.bind(this),this.setLog=this.setLog.bind(this),this.print=this.print.bind(this),this.printThreads=this.printThreads.bind(this)}dir(e="",...o){this.setLog(e,"dir",o)}error(e="",...o){this.setLog(e,"error",o)}log(e="",...o){this.setLog(e,"log",o)}warn(e="",...o){this.setLog(e,"warn",o)}setLog(e,o,n){let r=new l(o,n),s=this._private_threads.get(e)??[];return this._private_threads.set(e,[...s,r]),this}print(e,o){[...this._private_threads.entries()].map(([r,s])=>s.map(i=>({threadName:r,log:i}))).flat().sort((r,s)=>r.log.time.getTime()-s.log.time.getTime()).filter(({threadName:r})=>e===void 0?!0:r===e).forEach(({threadName:r,log:s})=>{console.log(`%c${r}`,"font-weight: 800; color: white; background: black; padding: 4px;",`+${s.elapsedTimeMs}s \u2013`,s.displayTime),o===!0&&console.log(`%c${s.displayStack}`,"color: grey; font-size: inherit;"),console[s.type](...s.data),console.log("")})}printThreads(e){[...this._private_threads.entries()].forEach(([o,n])=>{console.group(`%c${o}`,"font-weight: 800; color: white; background: black; padding: 4px;"),n.forEach(r=>{console.log(`+${r.elapsedTimeMs}s \u2013`,r.displayTime),e===!0&&console.log(`%c${r.displayStack}`,"color: grey; font-size: inherit;"),console[r.type](...r.data),console.log("")}),console.groupEnd()})}};export{c as default,d as makeTextBlock,u as styles};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Options as SanitizerOptions } from '~/utils/agnostic/clientside-html-sanitizer';
|
|
2
|
-
type Options = {
|
|
3
|
-
sanitize?: SanitizerOptions;
|
|
4
|
-
documentObj?: Document;
|
|
5
|
-
};
|
|
6
|
-
export default function strToNodes(dirtyStr: string, options?: Options): Promise<Node[]>;
|
|
7
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as i}from"../../../chunks/chunk-EFFU6KXJ.js";import{c as o}from"../../../chunks/chunk-LCLAV6Q2.js";async function a(n,e){let s=e?.documentObj??await o(),r=e?.sanitize!==void 0?await i(n,e.sanitize):n,t=s.createElement("div");return t.innerHTML=r,Array.from(t.childNodes).filter(d=>[Node.ELEMENT_NODE,Node.TEXT_NODE].includes(d.nodeType))}export{a as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export default function stringMatches(input: string, matcher: string | RegExp): boolean;
|
|
2
|
-
export { stringMatches };
|
|
3
|
-
export declare function stringMatchesSome(input: string, matchers: string | RegExp | Array<string | RegExp>): boolean;
|
|
4
|
-
export declare function stringMatchesEvery(input: string, matchers: string | RegExp | Array<string | RegExp>): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c}from"../../../chunks/chunk-KNE7WIIW.js";export{a as default,a as stringMatches,c as stringMatchesEvery,b as stringMatchesSome};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function stringNormalizeIndent(input: string, indentLevel?: number): string;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
type BasicFunction = (...args: any[]) => any;
|
|
2
|
-
/**
|
|
3
|
-
* Returns a throttled version of the function passed as an argument
|
|
4
|
-
* @param toThrottleFunc - The function that has to be throttled
|
|
5
|
-
* @param delayMs - The throttle delay in ms
|
|
6
|
-
*/
|
|
7
|
-
export declare function throttle<T extends BasicFunction = BasicFunction>(toThrottleFunc: T, delayMs: number): {
|
|
8
|
-
throttled: (...args: any[]) => {
|
|
9
|
-
returnValue: ReturnType<T> | undefined;
|
|
10
|
-
lastExecutedOn: number;
|
|
11
|
-
delayMs: number;
|
|
12
|
-
isCached: boolean;
|
|
13
|
-
};
|
|
14
|
-
setDelay: (delayMs: number) => void;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Returns a debounced version of the function passed as an argument
|
|
18
|
-
* @param toDebounceFunc - The function that has to be debounced
|
|
19
|
-
* @param delayMs - The debounce delay in ms
|
|
20
|
-
*/
|
|
21
|
-
export declare function debounce<T extends BasicFunction = BasicFunction>(toDebounceFunc: T, delayMs: number): {
|
|
22
|
-
debounced: (...args: any[]) => {
|
|
23
|
-
returnValue: ReturnType<T> | undefined;
|
|
24
|
-
lastExecutedOn: number;
|
|
25
|
-
delayMs: number;
|
|
26
|
-
isCached: boolean;
|
|
27
|
-
};
|
|
28
|
-
setDelay: (delayMs: number) => void;
|
|
29
|
-
};
|
|
30
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function T(s,c){let t=c,o=[],n=0,l,e=null;function r(){e!==null&&(clearTimeout(e),e=null);let a=Date.now(),i=n+t-a;e=setTimeout(()=>{e=null,l=s(...o),n=a},i)??null}function m(...a){let u=Date.now();return o=a,u-n>=c?(l=s(...o),n=u,{returnValue:l,lastExecutedOn:n,delayMs:t,isCached:!1}):(e===null&&r(),{returnValue:l,lastExecutedOn:n,delayMs:t,isCached:!0})}function d(a){t=a,e!==null&&r()}return{throttled:m,setDelay:d}}function y(s,c){let t=c,o=[],n=0,l=0,e,r=null;function m(){typeof r=="number"&&(clearTimeout(r),r=null);let u=Date.now(),x=n+t-u;r=setTimeout(()=>{r=null,e=s(...o),l=u},x)??null}function d(...u){let i=Date.now();return o=u,i-n>=t?(n=i,e=s(...o),l=i,{returnValue:e,lastExecutedOn:l,delayMs:t,isCached:!1}):(n=i,m(),{returnValue:e,lastExecutedOn:l,delayMs:t,isCached:!0})}function a(u){t=u,r!==null&&m()}return{debounced:d,setDelay:a}}export{y as debounce,T as throttle};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function toAlphanum(string: string, replacer?: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function g(e,n=""){let t=e.replace(/[^a-z0-9]/igm,n);return n.length===0?t:t.replace(new RegExp(`${n}+`,"igm"),n)}export{g as default};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export type Callback = (val: number, timeMs: number) => void;
|
|
2
|
-
export declare enum Ease {
|
|
3
|
-
LINEAR = "linear",
|
|
4
|
-
EASE_IN_QUAD = "ease-in-quad",
|
|
5
|
-
EASE_OUT_QUAD = "ease-out-quad",
|
|
6
|
-
EASE_IN_OUT_QUAD = "ease-in-out-quad",
|
|
7
|
-
EASE_IN_CUBIC = "ease-in-cubic",
|
|
8
|
-
EASE_OUT_CUBIC = "ease-out-cubic",
|
|
9
|
-
EASE_IN_OUT_CUBIC = "ease-in-out-cubic",
|
|
10
|
-
EASE_IN_QUART = "ease-in-quart",
|
|
11
|
-
EASE_OUT_QUART = "ease-out-quart",
|
|
12
|
-
EASE_IN_OUT_QUART = "ease-in-out-quart",
|
|
13
|
-
EASE_IN_QUINT = "ease-in-quint",
|
|
14
|
-
EASE_OUT_QUINT = "ease-out-quint",
|
|
15
|
-
EASE_IN_OUT_QUINT = "ease-in-out-quint",
|
|
16
|
-
EASE_IN_SINE = "ease-in-sine",
|
|
17
|
-
EASE_OUT_SINE = "ease-out-sine",
|
|
18
|
-
EASE_IN_OUT_SINE = "ease-in-out-sine",
|
|
19
|
-
EASE_IN_EXPO = "ease-in-expo",
|
|
20
|
-
EASE_OUT_EXPO = "ease-out-expo",
|
|
21
|
-
EASE_IN_OUT_EXPO = "ease-in-out-expo",
|
|
22
|
-
EASE_IN_CIRC = "ease-in-circ",
|
|
23
|
-
EASE_OUT_CIRC = "ease-out-circ",
|
|
24
|
-
EASE_IN_OUT_CIRC = "ease-in-out-circ",
|
|
25
|
-
EASE_IN_BACK = "ease-in-back",
|
|
26
|
-
EASE_OUT_BACK = "ease-out-back",
|
|
27
|
-
EASE_IN_OUT_BACK = "ease-in-out-back",
|
|
28
|
-
EASE_IN_ELASTIC = "ease-in-elastic",
|
|
29
|
-
EASE_OUT_ELASTIC = "ease-out-elastic",
|
|
30
|
-
EASE_IN_OUT_ELASTIC = "ease-in-out-elastic",
|
|
31
|
-
EASE_IN_BOUNCE = "ease-in-bounce",
|
|
32
|
-
EASE_OUT_BOUNCE = "ease-out-bounce",
|
|
33
|
-
EASE_IN_OUT_BOUNCE = "ease-in-out-bounce"
|
|
34
|
-
}
|
|
35
|
-
export type EasingFunction = (progress: number) => number;
|
|
36
|
-
export type EasingDictionary = Record<string, EasingFunction>;
|
|
37
|
-
export default function transition(to: number, durationMs: number, callbackOrEase: Ease | Callback, callback?: Callback): Promise<void>;
|
|
38
|
-
export declare const easingFunctions: EasingDictionary;
|
|
39
|
-
export declare const easings: Record<Ease, ((ratio: number) => number) | undefined>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as T}from"../../../chunks/chunk-PCAKH6ZJ.js";var f=(n=>(n.LINEAR="linear",n.EASE_IN_QUAD="ease-in-quad",n.EASE_OUT_QUAD="ease-out-quad",n.EASE_IN_OUT_QUAD="ease-in-out-quad",n.EASE_IN_CUBIC="ease-in-cubic",n.EASE_OUT_CUBIC="ease-out-cubic",n.EASE_IN_OUT_CUBIC="ease-in-out-cubic",n.EASE_IN_QUART="ease-in-quart",n.EASE_OUT_QUART="ease-out-quart",n.EASE_IN_OUT_QUART="ease-in-out-quart",n.EASE_IN_QUINT="ease-in-quint",n.EASE_OUT_QUINT="ease-out-quint",n.EASE_IN_OUT_QUINT="ease-in-out-quint",n.EASE_IN_SINE="ease-in-sine",n.EASE_OUT_SINE="ease-out-sine",n.EASE_IN_OUT_SINE="ease-in-out-sine",n.EASE_IN_EXPO="ease-in-expo",n.EASE_OUT_EXPO="ease-out-expo",n.EASE_IN_OUT_EXPO="ease-in-out-expo",n.EASE_IN_CIRC="ease-in-circ",n.EASE_OUT_CIRC="ease-out-circ",n.EASE_IN_OUT_CIRC="ease-in-out-circ",n.EASE_IN_BACK="ease-in-back",n.EASE_OUT_BACK="ease-out-back",n.EASE_IN_OUT_BACK="ease-in-out-back",n.EASE_IN_ELASTIC="ease-in-elastic",n.EASE_OUT_ELASTIC="ease-out-elastic",n.EASE_IN_OUT_ELASTIC="ease-in-out-elastic",n.EASE_IN_BOUNCE="ease-in-bounce",n.EASE_OUT_BOUNCE="ease-out-bounce",n.EASE_IN_OUT_BOUNCE="ease-in-out-bounce",n))(f||{});async function m(e,U,E,p){let N=R[typeof E=="string"?E:"linear"];if(N===void 0)return;let S=p??(typeof E=="function"?E:void 0);if(S===void 0)return;let b=Date.now(),l=new Array(e).fill(null).map((i,I)=>{let r=(I+1)/e,s=N(r);return{time:b+s*U,step:s*e}});for(let{time:i,step:I}of l){let r=Date.now(),s=i-r;s<=0||await T(s),S(I,i)}}var a=Math.pow,o=Math.sqrt,u=Math.sin,C=Math.cos,_=Math.PI,A=1.70158,c=A*1.525,Q=A+1,d=2*_/3,B=2*_/4.5,O=function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},t={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-a(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-a(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-a(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-a(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-a(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-a(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-a(-2*e+2,5)/2,easeInSine:e=>1-C(e*_/2),easeOutSine:e=>u(e*_/2),easeInOutSine:e=>-(C(_*e)-1)/2,easeInExpo:e=>e===0?0:a(2,10*e-10),easeOutExpo:e=>e===1?1:1-a(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?a(2,20*e-10)/2:(2-a(2,-20*e+10))/2,easeInCirc:e=>1-o(1-a(e,2)),easeOutCirc:e=>o(1-a(e-1,2)),easeInOutCirc:e=>e<.5?(1-o(1-a(2*e,2)))/2:(o(1-a(-2*e+2,2))+1)/2,easeInBack:e=>Q*e*e*e-A*e*e,easeOutBack:e=>1+Q*a(e-1,3)+A*a(e-1,2),easeInOutBack:e=>e<.5?a(2*e,2)*((c+1)*2*e-c)/2:(a(2*e-2,2)*((c+1)*(e*2-2)+c)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-a(2,10*e-10)*u((e*10-10.75)*d),easeOutElastic:e=>e===0?0:e===1?1:a(2,-10*e)*u((e*10-.75)*d)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(a(2,20*e-10)*u((20*e-11.125)*B))/2:a(2,-20*e+10)*u((20*e-11.125)*B)/2+1,easeInBounce:e=>1-O(1-e),easeOutBounce:O,easeInOutBounce:e=>e<.5?(1-O(1-2*e))/2:(1+O(2*e-1))/2},R={linear:t.linear,"ease-in-quad":t.easeInQuad,"ease-out-quad":t.easeOutQuad,"ease-in-out-quad":t.easeInOutQuad,"ease-in-cubic":t.easeInCubic,"ease-out-cubic":t.easeOutCubic,"ease-in-out-cubic":t.easeInOutCubic,"ease-in-quart":t.easeInQuart,"ease-out-quart":t.easeOutQuart,"ease-in-out-quart":t.easeInOutQuart,"ease-in-quint":t.easeInQuint,"ease-out-quint":t.easeOutQuint,"ease-in-out-quint":t.easeInOutQuint,"ease-in-sine":t.easeInSine,"ease-out-sine":t.easeOutSine,"ease-in-out-sine":t.easeInOutSine,"ease-in-expo":t.easeInExpo,"ease-out-expo":t.easeOutExpo,"ease-in-out-expo":t.easeInOutExpo,"ease-in-circ":t.easeInCirc,"ease-out-circ":t.easeOutCirc,"ease-in-out-circ":t.easeInOutCirc,"ease-in-back":t.easeInBack,"ease-out-back":t.easeOutBack,"ease-in-out-back":t.easeInOutBack,"ease-in-elastic":t.easeInElastic,"ease-out-elastic":t.easeOutElastic,"ease-in-out-elastic":t.easeInOutElastic,"ease-in-bounce":t.easeInBounce,"ease-out-bounce":t.easeOutBounce,"ease-in-out-bounce":t.easeInOutBounce};export{f as Ease,m as default,t as easingFunctions,R as easings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function wait(durationMs: number): Promise<unknown>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"../../../chunks/chunk-PCAKH6ZJ.js";export{a as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare function injectCssRule(rule: string, force?: boolean): string;
|
|
2
|
-
export declare function injectCssRule(rule: string, name: string, force?: boolean): string;
|
|
3
|
-
export declare function removeCssRule(name: string): void;
|
|
4
|
-
export declare function injectStylesheet(href: string, onLoad?: (event?: Event) => void, targetSelector?: string): HTMLLinkElement;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var o=new Map;function u(n,r,s){let e=typeof r=="string"?r:n,t=r===!0||s===!0,a=o.get(e);return(t===!0||a===void 0)&&(o.set(e,n),c()),e}function d(n){o.delete(n)&&c()}function c(){let n="__dynamic-styles";Array.from(document.querySelectorAll(`.${n}`)).forEach(s=>{let e=s.getAttribute("data-name");if(e===null||o.get(e)===void 0)return s.remove()}),o.forEach((s,e)=>{let t=e.replace(/[^\w]/igm,""),a=document.querySelector(`.${n}[data-name="${t}"]`),l=`/* ${e.replace(/[^\w]/,"-")} */
|
|
2
|
-
${s}`;if(a!==null)a.innerHTML=l;else{let i=document.createElement("style");i.classList.add(n),i.setAttribute("data-name",t),i.innerHTML=l,document.head.append(i)}})}function g(n,r,s){let e=s!==void 0?document.querySelector(s)??document.head:document.head,t=document.createElement("link");return t.setAttribute("rel","stylesheet"),t.setAttribute("href",n),r!==void 0&&t.addEventListener("load",r),e.appendChild(t),t}export{u as injectCssRule,g as injectStylesheet,d as removeCssRule};
|
|
@@ -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,9 +0,0 @@
|
|
|
1
|
-
export declare function getImageColorsFromUrl(url: string): Promise<string[]>;
|
|
2
|
-
export declare const compressorExtensions: {
|
|
3
|
-
jpgExtensions: string[];
|
|
4
|
-
pngExtensions: string[];
|
|
5
|
-
webpExtensions: string[];
|
|
6
|
-
avifExtensions: string[];
|
|
7
|
-
heifExtensions: string[];
|
|
8
|
-
};
|
|
9
|
-
export declare function compressImages(src: string, preExtension: string, sizes?: number[], qualities?: number[] | number): Promise<void>;
|
|
@@ -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,5 +0,0 @@
|
|
|
1
|
-
export declare const forceExitEvents: string[];
|
|
2
|
-
export declare function beforeForcedExit(callback: () => void | Promise<void>): void;
|
|
3
|
-
export declare function beforeExit(callback: () => void | Promise<void>): void;
|
|
4
|
-
export declare function onExit(callback: () => void | Promise<void>): void;
|
|
5
|
-
export declare function anyway(callback: () => void | Promise<void>): void;
|
|
@@ -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
|