@design-edito/tools 0.0.19 → 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
- package/chunks/chunk-7MQW6NRB.js +1 -0
- package/chunks/chunk-AFA3GSXO.js +1 -0
- package/chunks/chunk-BW5CY5YB.js +1 -0
- package/chunks/chunk-CF6GPH7Z.js +1 -0
- package/chunks/chunk-DIPJ73JH.js +1 -0
- package/chunks/chunk-LCBMRJKP.js +1 -0
- package/chunks/chunk-PCAKH6ZJ.js +1 -0
- package/chunks/chunk-PMZGSBLC.js +1 -0
- package/chunks/chunk-QQRJPDR7.js +1 -0
- package/chunks/chunk-SL2VL6LV.js +1 -0
- package/chunks/chunk-WZBNXYN3.js +1 -0
- package/index.js +74 -2
- package/package.json +10 -8
- package/utils/agnostic/absolute-modulo/index.d.ts +1 -0
- package/utils/agnostic/absolute-modulo/index.js +1 -0
- package/utils/agnostic/array-random-pick/index.d.ts +1 -0
- package/utils/agnostic/array-random-pick/index.js +1 -0
- package/utils/agnostic/bem/BEM.d.ts +29 -0
- package/utils/agnostic/bem/getNamesArr.d.ts +2 -0
- package/utils/agnostic/bem/index.d.ts +5 -0
- package/utils/agnostic/bem/index.js +1 -0
- package/utils/agnostic/cast/index.d.ts +7 -0
- package/utils/agnostic/cast/index.js +1 -0
- package/utils/agnostic/charcode-string/index.d.ts +2 -0
- package/utils/agnostic/charcode-string/index.js +1 -0
- package/utils/agnostic/clamp/index.d.ts +1 -0
- package/utils/agnostic/clamp/index.js +1 -0
- package/utils/agnostic/clientside-html-sanitizer/index.d.ts +22 -0
- package/utils/agnostic/clientside-html-sanitizer/index.js +1 -0
- package/utils/agnostic/detect-runtime/index.d.ts +10 -0
- package/utils/agnostic/detect-runtime/index.js +1 -0
- package/utils/agnostic/flatten-getters/index.d.ts +1 -0
- package/utils/agnostic/flatten-getters/index.js +1 -0
- package/utils/agnostic/generate-html-placeholders/index.d.ts +7 -0
- package/utils/agnostic/generate-html-placeholders/index.js +5 -0
- package/utils/agnostic/generate-nice-color/index.d.ts +3 -0
- package/utils/agnostic/generate-nice-color/index.js +1 -0
- package/utils/agnostic/get-document/index.d.ts +1 -0
- package/utils/agnostic/get-document/index.js +1 -0
- package/utils/agnostic/insert-node/index.d.ts +2 -0
- package/utils/agnostic/insert-node/index.js +1 -0
- package/utils/agnostic/interpolate/index.d.ts +3 -0
- package/utils/agnostic/interpolate/index.js +1 -0
- package/utils/agnostic/is-array-of/index.d.ts +5 -0
- package/utils/agnostic/is-array-of/index.js +1 -0
- package/utils/agnostic/is-constructor-function/index.d.ts +2 -0
- package/utils/agnostic/is-constructor-function/index.js +1 -0
- package/utils/agnostic/is-falsy/index.d.ts +4 -0
- package/utils/agnostic/is-falsy/index.js +1 -0
- package/utils/agnostic/is-in-enum/index.d.ts +1 -0
- package/utils/agnostic/is-in-enum/index.js +1 -0
- package/utils/agnostic/is-nullish/index.d.ts +4 -0
- package/utils/agnostic/is-nullish/index.js +1 -0
- package/utils/agnostic/is-object/index.d.ts +1 -0
- package/utils/agnostic/is-object/index.js +1 -0
- package/utils/agnostic/is-valid-css-class-name/index.d.ts +2 -0
- package/utils/agnostic/is-valid-css-class-name/index.js +1 -0
- package/utils/agnostic/memoize/index.d.ts +3 -0
- package/utils/agnostic/memoize/index.js +1 -0
- package/utils/agnostic/object-validate-from-partial/index.d.ts +1 -0
- package/utils/agnostic/object-validate-from-partial/index.js +1 -0
- package/utils/agnostic/random-uuid/index.d.ts +5 -0
- package/utils/agnostic/random-uuid/index.js +1 -0
- package/utils/agnostic/record-format/index.d.ts +6 -0
- package/utils/agnostic/record-format/index.js +1 -0
- package/utils/agnostic/replace-all/index.d.ts +1 -0
- package/utils/agnostic/replace-all/index.js +1 -0
- package/utils/agnostic/responsive-harmonics/index.d.ts +10 -0
- package/utils/agnostic/responsive-harmonics/index.js +1 -0
- package/utils/agnostic/round-numbers/index.d.ts +1 -0
- package/utils/agnostic/round-numbers/index.js +1 -0
- package/utils/agnostic/selector-to-element/index.d.ts +1 -0
- package/utils/agnostic/selector-to-element/index.js +1 -0
- package/utils/agnostic/silent-log/index.d.ts +53 -0
- package/utils/agnostic/silent-log/index.js +9 -0
- package/utils/agnostic/str-to-nodes/index.d.ts +7 -0
- package/utils/agnostic/str-to-nodes/index.js +1 -0
- package/utils/agnostic/throttle-debounce/index.d.ts +30 -0
- package/utils/agnostic/throttle-debounce/index.js +1 -0
- package/utils/agnostic/throttle-debounce/types.d.ts +3 -0
- package/utils/agnostic/transition/index.d.ts +39 -0
- package/utils/agnostic/transition/index.js +1 -0
- package/utils/agnostic/wait/index.d.ts +1 -0
- package/utils/agnostic/wait/index.js +1 -0
- package/utils/browser/dynamic-css/index.d.ts +4 -0
- package/utils/browser/dynamic-css/index.js +2 -0
- package/utils/browser/get-current-downlink/index.d.ts +1 -0
- package/utils/browser/get-current-downlink/index.js +1 -0
- package/utils/browser/get-node-ancestors/index.d.ts +1 -0
- package/utils/browser/get-node-ancestors/index.js +1 -0
- package/utils/node/list-subpaths/index.d.ts +8 -2
- package/utils/node/list-subpaths/index.js +1 -1
- package/utils/node/list-subdirectories-indexes/index.d.ts +0 -1
- package/utils/node/list-subdirectories-indexes/index.js +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
import{b as o}from"./chunk-SL2VL6LV.js";function f(r){return typeof r=="boolean"?r:typeof r=="string"?r.toLowerCase().trim()==="true":!o(r)}function e(r){return typeof r=="number"?r:typeof r=="string"?parseFloat(r):0}function c(r){return typeof r=="string"?r:String(r)}function p(r){return null}function u(r){return Array.isArray(r)?r:typeof r=="object"&&r!==null?Object.entries(r).map((t,n)=>({key:t,value:n})):[r]}function s(r){return u(r).map(n=>e(n))}function y(r){let t={};try{Object.keys(r).forEach(n=>{t[n]=r[n]})}catch{return t}return t}export{f as a,e as b,c,p as d,u as e,s as f,y as g};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{b as n}from"./chunk-CF6GPH7Z.js";async function o(){let t=n();return["Browser","Electron"].includes(t)?window.document:new(await import("jsdom")).JSDOM().window.document}export{o as a};
|
@@ -0,0 +1 @@
|
|
1
|
+
function t(u,n){let r=Math.pow(10,n);return Math.round(u*r)/r}export{t as a};
|
@@ -0,0 +1 @@
|
|
1
|
+
var n=(e=>(e.NODE="Node.js",e.BROWSER="Browser",e.DENO="Deno",e.REACT_NATIVE="React Native",e.ELECTRON="Electron",e.CLOUDFLARE="Cloudflare Workers",e.AWS_LAMBDA="AWS Lambda",e))(n||{});function r(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"?"Node.js":typeof window<"u"&&typeof window.document<"u"?"Browser":typeof Deno<"u"?"Deno":typeof process<"u"&&typeof navigator.userAgent=="string"&&/ReactNative/.test(navigator.userAgent)?"React Native":typeof process<"u"&&typeof process.versions<"u"&&typeof process.version.electron<"u"?"Electron":typeof self<"u"&&typeof self.addEventListener=="function"&&typeof Headers<"u"?"Cloudflare Workers":typeof AWS<"u"&&typeof AWS.Lambda<"u"?"AWS Lambda":null}export{n as a,r as b};
|
@@ -0,0 +1 @@
|
|
1
|
+
function t(n){return typeof n!="function"?!1:"prototype"in n&&"constructor"in n.prototype}export{t as a};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a as N}from"./chunk-AFA3GSXO.js";var E={depth:20};async function z(d,o=E){let l=(o.documentObj??await N()).createElement("div"),{inputFreeTransform:a}=o;return l.innerHTML=a!==void 0?a(d):d,y(l,o)?.innerHTML??""}function y(d,o=E){let{tagName:e,attributes:l,childNodes:a}=d,{allowedTags:g=[],allowedAttributes:b={},forbiddenTags:m=[],forbiddenAttributes:A={},depth:w=20,verbose:s=!1}=o;if(w<=0)return console.warn("Max depth reached"),null;let f=e.toLowerCase().trim();if(m.includes("*")||m.includes(f))return s===!0&&console.warn(e,"tag is forbidden"),null;if(!(g.includes("*")||g.includes(f)))return s===!0&&console.warn(e,"tag is not allowed"),null;let p=document.createElement(e);Array.from(l).filter(({name:t,value:i})=>{let I=A["*"]??[],O=A[f]??[];if([...I,...O].some(({attributeName:r,attributeValues:u})=>typeof r=="string"&&r!=="*"&&t!==r||typeof r!="string"&&!r.test(t)?!1:u===void 0||u.includes("*")?(s===!0&&console.warn(t,"attribute on",e,"tag is forbidden"),!0):u.some(n=>typeof n=="string"&&i===n||typeof n!="string"&&n.test(i)?(s===!0&&console.warn(i,"value for",t,"attribute on",e,"tag is forbidden. Rule:",n),!0):!1)))return!1;let F=b["*"]??[],P=b[f]??[],x=[...F,...P],c=[e,"has no allowed attributes"];return x.some(({attributeName:r,attributeValues:u})=>typeof r=="string"&&r!=="*"&&t!==r?(c=[t,"attribute on",e,"tag is not allowed"],!1):typeof r!="string"&&!r.test(t)?(c=[t,"attribute on",e,"tag is not allowed"],!1):u===void 0||u.includes("*")?!0:u.some(n=>typeof n=="string"&&i===n||typeof n!="string"&&n.test(i)?!0:(c=[i,"value for",t,"attribute on",e,"tag is not allowed"],!1)))?!0:(s===!0&&console.warn(...c),!1)}).forEach(({name:t,value:i})=>{p.setAttribute(t,i)});let h=Array.from(a).map(t=>t.nodeType===Node.ELEMENT_NODE?y(t,{...o,depth:w-1}):t.nodeType===Node.TEXT_NODE||o.keepComments===!0&&t.nodeType===Node.COMMENT_NODE?t:null).filter(t=>t!==null);return p.replaceChildren(...h),p}export{E as a,z as b,y as c};
|
@@ -0,0 +1 @@
|
|
1
|
+
async function n(e){return new Promise(t=>{setTimeout(()=>t(!0),e)})}export{n as a};
|
@@ -0,0 +1 @@
|
|
1
|
+
var l=[null,void 0];function e(n){return l.includes(n)}var u=e;export{l as a,u as b};
|
@@ -0,0 +1 @@
|
|
1
|
+
function e(t){return typeof t=="object"&&t!==null}export{e as a};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a as n}from"./chunk-PMZGSBLC.js";var e=[...n,!1,"",0,-0,NaN];window.BigInt!==void 0&&e.push(window.BigInt(0));var l=i=>e.includes(i);var o=l;export{e as a,o as b};
|
@@ -0,0 +1 @@
|
|
1
|
+
var t=/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/;function a(e){return t.test(e)}export{t as a,a as b};
|
package/index.js
CHANGED
@@ -1,14 +1,86 @@
|
|
1
1
|
import * as Comp from './components/Comp/index.js'
|
2
|
+
import * as absoluteModulo from './utils/agnostic/absolute-modulo/index.js'
|
3
|
+
import * as arrayRandomPick from './utils/agnostic/array-random-pick/index.js'
|
4
|
+
import * as bem from './utils/agnostic/bem/index.js'
|
5
|
+
import * as cast from './utils/agnostic/cast/index.js'
|
6
|
+
import * as charcodeString from './utils/agnostic/charcode-string/index.js'
|
7
|
+
import * as clamp from './utils/agnostic/clamp/index.js'
|
8
|
+
import * as clientsideHtmlSanitizer from './utils/agnostic/clientside-html-sanitizer/index.js'
|
9
|
+
import * as detectRuntime from './utils/agnostic/detect-runtime/index.js'
|
2
10
|
import * as findDuplicatesInArray from './utils/agnostic/find-duplicates-in-array/index.js'
|
11
|
+
import * as flattenGetters from './utils/agnostic/flatten-getters/index.js'
|
12
|
+
import * as generateHtmlPlaceholders from './utils/agnostic/generate-html-placeholders/index.js'
|
13
|
+
import * as generateNiceColor from './utils/agnostic/generate-nice-color/index.js'
|
14
|
+
import * as getDocument from './utils/agnostic/get-document/index.js'
|
15
|
+
import * as insertNode from './utils/agnostic/insert-node/index.js'
|
16
|
+
import * as interpolate from './utils/agnostic/interpolate/index.js'
|
17
|
+
import * as isArrayOf from './utils/agnostic/is-array-of/index.js'
|
18
|
+
import * as isConstructorFunction from './utils/agnostic/is-constructor-function/index.js'
|
19
|
+
import * as isFalsy from './utils/agnostic/is-falsy/index.js'
|
20
|
+
import * as isInEnum from './utils/agnostic/is-in-enum/index.js'
|
21
|
+
import * as isNullish from './utils/agnostic/is-nullish/index.js'
|
22
|
+
import * as isObject from './utils/agnostic/is-object/index.js'
|
3
23
|
import * as isRecord from './utils/agnostic/is-record/index.js'
|
24
|
+
import * as isValidCssClassName from './utils/agnostic/is-valid-css-class-name/index.js'
|
25
|
+
import * as memoize from './utils/agnostic/memoize/index.js'
|
26
|
+
import * as objectValidateFromPartial from './utils/agnostic/object-validate-from-partial/index.js'
|
27
|
+
import * as randomUuid from './utils/agnostic/random-uuid/index.js'
|
28
|
+
import * as recordFormat from './utils/agnostic/record-format/index.js'
|
29
|
+
import * as replaceAll from './utils/agnostic/replace-all/index.js'
|
30
|
+
import * as responsiveHarmonics from './utils/agnostic/responsive-harmonics/index.js'
|
31
|
+
import * as roundNumbers from './utils/agnostic/round-numbers/index.js'
|
32
|
+
import * as selectorToElement from './utils/agnostic/selector-to-element/index.js'
|
33
|
+
import * as silentLog from './utils/agnostic/silent-log/index.js'
|
34
|
+
import * as strToNodes from './utils/agnostic/str-to-nodes/index.js'
|
35
|
+
import * as throttleDebounce from './utils/agnostic/throttle-debounce/index.js'
|
36
|
+
import * as transition from './utils/agnostic/transition/index.js'
|
37
|
+
import * as wait from './utils/agnostic/wait/index.js'
|
38
|
+
import * as dynamicCss from './utils/browser/dynamic-css/index.js'
|
39
|
+
import * as getCurrentDownlink from './utils/browser/get-current-downlink/index.js'
|
40
|
+
import * as getNodeAncestors from './utils/browser/get-node-ancestors/index.js'
|
4
41
|
import * as isInDirectory from './utils/node/is-in-directory/index.js'
|
5
|
-
import * as listSubdirectoriesIndexes from './utils/node/list-subdirectories-indexes/index.js'
|
6
42
|
import * as listSubpaths from './utils/node/list-subpaths/index.js'
|
7
43
|
import * as readWriteFile from './utils/node/read-write-file/index.js'
|
8
44
|
export { Comp }
|
45
|
+
export { absoluteModulo }
|
46
|
+
export { arrayRandomPick }
|
47
|
+
export { bem }
|
48
|
+
export { cast }
|
49
|
+
export { charcodeString }
|
50
|
+
export { clamp }
|
51
|
+
export { clientsideHtmlSanitizer }
|
52
|
+
export { detectRuntime }
|
9
53
|
export { findDuplicatesInArray }
|
54
|
+
export { flattenGetters }
|
55
|
+
export { generateHtmlPlaceholders }
|
56
|
+
export { generateNiceColor }
|
57
|
+
export { getDocument }
|
58
|
+
export { insertNode }
|
59
|
+
export { interpolate }
|
60
|
+
export { isArrayOf }
|
61
|
+
export { isConstructorFunction }
|
62
|
+
export { isFalsy }
|
63
|
+
export { isInEnum }
|
64
|
+
export { isNullish }
|
65
|
+
export { isObject }
|
10
66
|
export { isRecord }
|
67
|
+
export { isValidCssClassName }
|
68
|
+
export { memoize }
|
69
|
+
export { objectValidateFromPartial }
|
70
|
+
export { randomUuid }
|
71
|
+
export { recordFormat }
|
72
|
+
export { replaceAll }
|
73
|
+
export { responsiveHarmonics }
|
74
|
+
export { roundNumbers }
|
75
|
+
export { selectorToElement }
|
76
|
+
export { silentLog }
|
77
|
+
export { strToNodes }
|
78
|
+
export { throttleDebounce }
|
79
|
+
export { transition }
|
80
|
+
export { wait }
|
81
|
+
export { dynamicCss }
|
82
|
+
export { getCurrentDownlink }
|
83
|
+
export { getNodeAncestors }
|
11
84
|
export { isInDirectory }
|
12
|
-
export { listSubdirectoriesIndexes }
|
13
85
|
export { listSubpaths }
|
14
86
|
export { readWriteFile }
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@design-edito/tools",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.26",
|
4
4
|
"description": "",
|
5
5
|
"author": "Maxime Fabas",
|
6
6
|
"license": "ISC",
|
@@ -11,23 +11,25 @@
|
|
11
11
|
"type": "module",
|
12
12
|
"main": "index.js",
|
13
13
|
"module": "index.js",
|
14
|
-
"dependencies": {},
|
15
14
|
"peerDependencies": {
|
15
|
+
"chalk": "^5.3.0",
|
16
|
+
"jsdom": "^24.0.0",
|
16
17
|
"react": "^18.2.0",
|
17
18
|
"react-dom": "^18.2.0"
|
18
19
|
},
|
19
20
|
"devDependencies": {
|
20
|
-
"@types/
|
21
|
-
"@types/
|
21
|
+
"@types/chalk": "^2.2.0",
|
22
|
+
"@types/jsdom": "^21.1.6",
|
23
|
+
"@types/node": "^20.12.5",
|
22
24
|
"@types/prompts": "^2.4.9",
|
23
|
-
"@types/react": "^18.2.
|
24
|
-
"@types/react-dom": "^18.2.
|
25
|
+
"@types/react": "^18.2.74",
|
26
|
+
"@types/react-dom": "^18.2.24",
|
25
27
|
"@types/semver": "^7.5.8",
|
26
28
|
"camelcase": "^8.0.0",
|
27
29
|
"esbuild": "^0.20.2",
|
28
30
|
"prompts": "^2.4.2",
|
29
31
|
"semver": "^7.6.0",
|
30
|
-
"simple-git": "^3.
|
31
|
-
"typescript": "^5.4.
|
32
|
+
"simple-git": "^3.24.0",
|
33
|
+
"typescript": "^5.4.4"
|
32
34
|
}
|
33
35
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function absoluteModulo(nbr: number, modulo: number): number;
|
@@ -0,0 +1 @@
|
|
1
|
+
function r(n,e){return(n%e+e)%e}export{r as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function arrayRandomPick(arr: any[], exclude?: any[]): any;
|
@@ -0,0 +1 @@
|
|
1
|
+
function l(t,r=[]){let n=[...t].filter(e=>!r.includes(e)),a=n.length,o=Math.floor(Math.random()*a);return n[o]}export{l as default};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
export interface Block {
|
2
|
+
name: string;
|
3
|
+
modifiers: string[];
|
4
|
+
}
|
5
|
+
declare class BEM {
|
6
|
+
constructor();
|
7
|
+
addBlock(blockNameArg: any): BEM;
|
8
|
+
addElement(elementNameArg: any): BEM;
|
9
|
+
addModifier(modifierNameArg: any): BEM;
|
10
|
+
copy(): BEM;
|
11
|
+
block(blockNameArg: any): BEM;
|
12
|
+
element(elementNameArg: any): BEM;
|
13
|
+
modifier(modifierNameArg: any): BEM;
|
14
|
+
blk(blockNameArg: any): BEM;
|
15
|
+
elt(elementNameArg: any): BEM;
|
16
|
+
mod(modifierNameArg: any): BEM;
|
17
|
+
cp(): BEM;
|
18
|
+
get value(): string;
|
19
|
+
get val(): string;
|
20
|
+
private blocks;
|
21
|
+
private findBlockByName;
|
22
|
+
private addSingleBlock;
|
23
|
+
private addSingleElement;
|
24
|
+
private addSingleModifier;
|
25
|
+
private setCurrentBlockByName;
|
26
|
+
private createBlockByName;
|
27
|
+
private getCurrentBlock;
|
28
|
+
}
|
29
|
+
export default BEM;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{b as c}from"../../../chunks/chunk-WZBNXYN3.js";import{b as h}from"../../../chunks/chunk-SL2VL6LV.js";import"../../../chunks/chunk-PMZGSBLC.js";function r(e){let i=[];return typeof e=="string"?e.trim().split(/\s+/gm).forEach(t=>{c(t)&&i.push(t)}):Array.isArray(e)?e.forEach(t=>i.push(...r(t))):typeof e=="object"&&e!==null&&Object.entries(e).forEach(([t,s])=>{h(s)||i.push(...r(t))}),i}var n=r;var o=class e{constructor(){this.findBlockByName=this.findBlockByName.bind(this),this.addBlock=this.addBlock.bind(this),this.addElement=this.addElement.bind(this),this.addModifier=this.addModifier.bind(this),this.copy=this.copy.bind(this),this.block=this.block.bind(this),this.element=this.element.bind(this),this.modifier=this.modifier.bind(this),this.blk=this.blk.bind(this),this.elt=this.elt.bind(this),this.mod=this.mod.bind(this),this.cp=this.cp.bind(this),this.addSingleBlock=this.addSingleBlock.bind(this),this.addSingleElement=this.addSingleElement.bind(this),this.addSingleModifier=this.addSingleModifier.bind(this),this.setCurrentBlockByName=this.setCurrentBlockByName.bind(this),this.createBlockByName=this.createBlockByName.bind(this),this.getCurrentBlock=this.getCurrentBlock.bind(this)}addBlock(i){return n(i).forEach(this.addSingleBlock),this}addElement(i){return n(i).forEach(this.addSingleElement),this}addModifier(i){return this.getCurrentBlock()===void 0?this:(n(i).forEach(this.addSingleModifier),this)}copy(){let i=new e;return this.blocks.forEach(t=>{i.addBlock(t.name),t.modifiers.forEach(i.addModifier)}),i}block(i){return this.copy().addBlock(i)}element(i){return this.copy().addElement(i)}modifier(i){return this.copy().addModifier(i)}blk(i){return this.block(i)}elt(i){return this.element(i)}mod(i){return this.modifier(i)}cp(){return this.copy()}get value(){return this.blocks.map(i=>[i.name,...i.modifiers.map(t=>`${i.name}_${t}`)].join(" ")).join(" ")}get val(){return this.value}blocks=[];findBlockByName(i){return this.blocks.find(t=>t.name===i)}addSingleBlock(i){if(this.findBlockByName(i)!==void 0)this.setCurrentBlockByName(i);else{let t=this.createBlockByName(i);this.blocks.push(t)}return this}addSingleElement(i){let t=this.getCurrentBlock();return t===void 0?this.addBlock(i):t.name=t.name+"__"+i,this}addSingleModifier(i){let t=this.getCurrentBlock();return t!==void 0&&t.modifiers.push(i),this}setCurrentBlockByName(i){let t=this.findBlockByName(i);if(t!==void 0){let s=this.blocks.indexOf(t);this.blocks=[...this.blocks.slice(0,s),...this.blocks.slice(s+1),t]}return this}createBlockByName(i){return{name:i,modifiers:[]}}getCurrentBlock(){return this.blocks.slice(-1)[0]}},d=o;function l(e){let i=new d;return e instanceof d?e.copy():i.addBlock(e)}var y=l;export{d as BEM,l as bem,y as default,n as getNamesArr};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export declare function toBoolean(value: unknown): boolean;
|
2
|
+
export declare function toNumber(value: unknown): number;
|
3
|
+
export declare function toString(value: unknown): string;
|
4
|
+
export declare function toNull(_value: unknown): null;
|
5
|
+
export declare function toArray(value: unknown): any[];
|
6
|
+
export declare function toNumberArr(value: unknown): number[];
|
7
|
+
export declare function toRecord(value: unknown): Record<string, unknown>;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a,b,c,d,e,f,g}from"../../../chunks/chunk-7MQW6NRB.js";import"../../../chunks/chunk-SL2VL6LV.js";import"../../../chunks/chunk-PMZGSBLC.js";export{e as toArray,a as toBoolean,d as toNull,b as toNumber,f as toNumberArr,g as toRecord,c as toString};
|
@@ -0,0 +1 @@
|
|
1
|
+
function t(r){if(r.length!==1)return console.error("input char length must be of one");let n=r.charCodeAt(0);return Number.isInteger(n)?n.toString(36):console.error(`Input "${r}" charCode is not an integer: ${n}`)}function e(r){let n=parseInt(r,36);return Number.isInteger(n)?String.fromCharCode(n):console.error(`Input "${r}" parsing did not return an integer: ${n}`)}function o(r){return r.split("").map(t).join(",")}function i(r){return r.split(",").map(e).join("")}export{o as toCharcodes36,i as toString};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function clamp(num: number, bound1: number, bound2: number): number;
|
@@ -0,0 +1 @@
|
|
1
|
+
function r(t,m,n){let a=Math.min(m,n),e=Math.max(m,n);return Math.min(Math.max(t,a),e)}export{r as default};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
export type AttributeNameValPair = {
|
2
|
+
attributeName: string | RegExp;
|
3
|
+
attributeValues?: Array<string | RegExp>;
|
4
|
+
};
|
5
|
+
export type Options = {
|
6
|
+
inputFreeTransform?: (input: string) => string;
|
7
|
+
keepComments?: boolean;
|
8
|
+
allowedTags?: string[];
|
9
|
+
forbiddenTags?: string[];
|
10
|
+
allowedAttributes?: {
|
11
|
+
[tagName: string]: AttributeNameValPair[];
|
12
|
+
};
|
13
|
+
forbiddenAttributes?: {
|
14
|
+
[tagName: string]: AttributeNameValPair[];
|
15
|
+
};
|
16
|
+
depth?: number;
|
17
|
+
verbose?: boolean;
|
18
|
+
documentObj?: Document;
|
19
|
+
};
|
20
|
+
export declare const defaultOptions: Options;
|
21
|
+
export default function sanitize(inputStr: string, options?: Options): Promise<string>;
|
22
|
+
export declare function sanitizeElement(element: Element, options?: Options): Element | null;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a,b,c}from"../../../chunks/chunk-LCBMRJKP.js";import"../../../chunks/chunk-AFA3GSXO.js";import"../../../chunks/chunk-CF6GPH7Z.js";export{b as default,a as defaultOptions,c as sanitizeElement};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export declare enum RuntimeName {
|
2
|
+
NODE = "Node.js",
|
3
|
+
BROWSER = "Browser",
|
4
|
+
DENO = "Deno",
|
5
|
+
REACT_NATIVE = "React Native",
|
6
|
+
ELECTRON = "Electron",
|
7
|
+
CLOUDFLARE = "Cloudflare Workers",
|
8
|
+
AWS_LAMBDA = "AWS Lambda"
|
9
|
+
}
|
10
|
+
export default function detectRuntime(): RuntimeName | null;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a,b}from"../../../chunks/chunk-CF6GPH7Z.js";export{a as RuntimeName,b as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function flattenGetters(obj: unknown): Record<string, unknown>;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{g as o}from"../../../chunks/chunk-7MQW6NRB.js";import"../../../chunks/chunk-SL2VL6LV.js";import"../../../chunks/chunk-PMZGSBLC.js";function f(r){try{let{entries:n,getOwnPropertyDescriptors:c}=Object,s=o(r),i=n(c(r)).filter(([t,u])=>typeof u.get=="function").map(([t])=>t),e={...s};return i.forEach(t=>{e[t]=r[t]}),e}catch{return{}}}export{f as default};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export declare const EightKiloByteOfLoremIpsumSentences: string[];
|
2
|
+
export declare const generateSentence: () => string | undefined;
|
3
|
+
export declare const generateSentences: (amount?: number) => (string | undefined)[];
|
4
|
+
export declare const generateTitle: () => string;
|
5
|
+
export declare const generateIntertitle: () => string;
|
6
|
+
export declare const generateParagraph: () => string;
|
7
|
+
export declare const generateContentPage: (len?: number) => string;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
var u="Etiam consequat interdum elit eu interdum. Nunc eu nulla vel arcu mattis venenatis sit amet gravida sem. Mauris pretium aliquam augue vitae tempor. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nam mollis in ipsum nec efficitur. Nullam imperdiet et urna vitae suscipit. In hac habitasse platea dictumst. Nullam lacinia commodo enim non iaculis. Nam elementum tellus ac lectus aliquam porta. Mauris ut lorem nec magna porttitor efficitur sed sed odio. Ut in dapibus nulla, non eleifend elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Maecenas posuere leo neque, a luctus quam feugiat in. Phasellus lobortis egestas cursus. In sit amet massa et sem scelerisque facilisis quis fringilla felis. Praesent purus velit, vehicula id orci ac, placerat congue quam. Cras vulputate nisi eu justo accumsan malesuada. Vestibulum ex urna, volutpat non quam in, vulputate pellentesque est. Pellentesque interdum orci in quam finibus faucibus. In eget lectus augue. Vestibulum lobortis vulputate odio. Nam vitae felis in lorem dignissim venenatis. Curabitur bibendum, est quis tempor efficitur, magna orci facilisis erat, id rhoncus massa ante non tellus. Etiam id gravida elit. Mauris ut semper risus. Nulla sed interdum lorem. Nullam eu consectetur purus. Praesent ut enim diam. Nulla hendrerit dapibus eros, sit amet rhoncus eros consequat aliquam. Duis viverra erat vel commodo facilisis. Quisque hendrerit posuere sapien, id cursus ligula rhoncus vitae. Ut et turpis augue. Aliquam augue lorem, fringilla at magna eu, egestas sagittis ex. Vestibulum elementum diam facilisis elit ultrices, eget viverra massa venenatis. Nullam finibus ligula est. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nam condimentum, justo pulvinar posuere tincidunt, mi libero convallis sapien, id consectetur nunc tellus eget nisi. Fusce tincidunt sit amet enim vitae feugiat. Etiam in nulla vitae orci consequat vulputate. Vestibulum sodales urna sit amet velit elementum, vel fringilla eros iaculis. Vestibulum gravida tempus nulla, at vulputate nunc aliquam vitae. Phasellus ac augue et augue finibus congue ut nec nunc. Ut in dictum lectus, eget efficitur dui. Suspendisse bibendum congue arcu, sit amet maximus felis dictum sit amet. Morbi scelerisque feugiat risus, id pellentesque elit cursus nec. Vivamus at erat id magna sagittis cursus vitae eu magna. Integer pretium nec lorem at consectetur. Integer id justo vitae nunc gravida posuere eu vel magna. Donec ex nunc, condimentum id laoreet et, scelerisque nec enim. Sed venenatis, augue vel posuere ullamcorper, lorem velit auctor erat, a auctor mi odio id velit. Donec justo erat, tempor ut diam sed, scelerisque aliquam dolor. Donec erat dui, dictum a tortor sit amet, pellentesque blandit risus. Donec tincidunt ligula ex, vel tincidunt leo posuere sit amet. Curabitur lacinia blandit pellentesque. Donec fringilla aliquam purus ac porta. Fusce faucibus convallis leo, ut aliquet libero maximus nec. Morbi ac magna lorem. Quisque suscipit quis nisi interdum condimentum. Pellentesque imperdiet lorem diam, eu molestie ipsum scelerisque vel. Vivamus hendrerit, ipsum id sollicitudin pharetra, justo justo laoreet lorem, ac scelerisque turpis justo vitae augue. Nullam lacinia magna nec neque auctor scelerisque. Nunc sit amet lacus condimentum, interdum nisl eu, pharetra lorem. Morbi consectetur eros ac nisi facilisis, facilisis placerat magna aliquet. Donec bibendum leo ac est aliquam dictum. Quisque commodo magna risus, ut rhoncus ex feugiat nec. Sed vel tellus porta, feugiat sem quis, facilisis enim. Quisque accumsan imperdiet felis id laoreet. Etiam condimentum at ligula nec vehicula. Phasellus eget placerat quam. Cras efficitur mauris id ex tempus porttitor. Quisque pulvinar tellus id tempus ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In non erat justo. Nulla blandit placerat hendrerit. Sed blandit mattis magna eget sodales. Morbi eget accumsan sapien. Sed ornare interdum tortor iaculis volutpat. Maecenas vel tortor quis urna placerat mollis. Mauris ultrices, magna sit amet molestie sagittis, libero mi tincidunt diam, eu scelerisque nulla est vel dolor. Aenean congue congue eros bibendum elementum. Phasellus lobortis faucibus eros, et cursus lectus ultricies et. Vivamus augue metus, iaculis eget egestas in, tincidunt et lectus. Mauris varius arcu at cursus auctor. Curabitur eget nunc tellus. In eget tempor odio, vitae dictum massa. Proin in cursus est. Curabitur lobortis, velit eu accumsan sollicitudin, orci orci aliquam velit, ac iaculis massa justo sit amet massa. Duis a mauris iaculis, aliquam ipsum vel, vulputate mauris. Sed ex augue, cursus a dapibus sed, iaculis lacinia quam. Vivamus sit amet justo tellus. Nunc ac neque mattis, euismod velit id, feugiat massa. Etiam vitae auctor orci. Pellentesque sollicitudin est nibh, vitae scelerisque lacus sagittis eu. Morbi convallis metus eu enim gravida, non finibus enim accumsan. In quis pharetra justo, et tempor nibh. Duis non interdum diam. Vestibulum nec felis rhoncus, pharetra ipsum eu, rutrum magna. Integer dignissim odio eu mi finibus sollicitudin. Sed ut magna a nulla porttitor lobortis in id nibh. Pellentesque in lobortis ligula, vel malesuada neque. Aenean commodo arcu nunc, et posuere eros vulputate et. Mauris vestibulum euismod molestie. Vestibulum luctus sapien sollicitudin, cursus ante vel, varius massa. Mauris non magna pharetra, luctus felis sed, dapibus massa. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec posuere sapien diam, vitae porttitor nisi dictum sed. Maecenas sit amet eleifend odio. In luctus, neque eget eleifend ultricies, neque ante vestibulum leo, non ullamcorper enim orci vestibulum erat. Phasellus bibendum urna at aliquet elementum. Nulla facilisi. Sed porttitor lacus id hendrerit iaculis. Vivamus facilisis ex eget odio malesuada bibendum. Vestibulum fermentum at sem nec dignissim. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nunc faucibus augue id odio ornare, et maximus quam placerat. Nullam rutrum enim justo, id hendrerit felis faucibus sed. Aenean id nulla arcu. Nulla vitae eleifend ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ipsum risus, cursus at ligula convallis, interdum fringilla quam. Curabitur libero sapien, mollis in consectetur sit amet, accumsan vel justo. Nulla a eros sit amet nibh pharetra ultricies. Proin et dapibus mauris. Maecenas at lacinia felis. Vestibulum consectetur vestibulum ante. Interdum et malesuada fames ac ante ipsum primis in faucibus. In imperdiet ipsum ac facilisis interdum. Nullam vestibulum dictum vestibulum. Cras pharetra vehicula neque.".split(".").map(e=>e.trim()),i=()=>{let e=Math.floor(Math.random()*u.length);return u[e]},r=(e=1)=>new Array(e).fill(null).map(i),n=()=>`<h1 class="title">${i()}</h1>`,l=()=>`<h2 class="intertitle">${i()}</h2>`,t=()=>{let e=Math.floor(Math.random()*5)+3;return`<p class="paragraph">${new Array(e).fill(null).map(i).join(". ")}</p>`},m=(e=1)=>{let a=(Math.floor(Math.random()*3)+3)*Math.round(e),s=new Array(a).fill(null).map(()=>Math.random()<.2?l():t()).join("");return`<div class="content-page">
|
2
|
+
${n()}
|
3
|
+
${s}
|
4
|
+
${t()}
|
5
|
+
</div>`};export{u as EightKiloByteOfLoremIpsumSentences,m as generateContentPage,l as generateIntertitle,t as generateParagraph,i as generateSentence,r as generateSentences,n as generateTitle};
|
@@ -0,0 +1 @@
|
|
1
|
+
var e=["fuchsia","teal","aliceblue","bisque","blueviolet","burlywood","chocolate","coral","cornflowerblue","crimson","darkblue","darkgoldenrod","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkslateblue","darkslategray","darkviolet","deeppink","deepskyblue","dodgerblue","firebrick","floralwhite","gainsboro","gold","hotpink","indianred","indigo","khaki","lavender","lightcoral","lightgreen","lightsalmon","lightsteelblue","limegreen","magenta","mediumseagreen","mediumspringgreen","mediumvioletred","moccasin","orangered","orchid","palegoldenrod","palevioletred","peachpuff","peru","plum","royalblue","sandybrown","springgreen","tan","thistle","tomato","violet","wheat","yellowgreen"],o=()=>{let r=Math.floor(Math.random()*e.length);return e[r]},a=o;export{a as default,o as generateNiceColor,e as niceColors};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function getDocument(): Promise<any>;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a}from"../../../chunks/chunk-AFA3GSXO.js";import"../../../chunks/chunk-CF6GPH7Z.js";export{a as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
function o(t,l,i){l==="after"?i.nextSibling!==null?i.parentNode?.insertBefore(t,i.nextSibling):i.parentNode?.appendChild(t):l==="before"?i.parentNode?.insertBefore(t,i):l==="startof"&&i.firstChild!==null?i.insertBefore(t,i.firstChild):i.appendChild(t)}export{o as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
function t(e,r,n){return r+e*(n-r)}function u(e,r,n){return n===void 0?e/r:(e-r)/(n-r)}export{t as default,u as ratio};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { ConstructorFunction } from '~/utils/agnostic/is-constructor-function';
|
2
|
+
type TypeCheckerFunction = (input: unknown) => boolean;
|
3
|
+
type TypeChecker = ConstructorFunction | TypeCheckerFunction;
|
4
|
+
export default function isArrayOf<T extends unknown = unknown>(input: unknown, _types?: TypeChecker | TypeChecker[]): input is T[];
|
5
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a as i}from"../../../chunks/chunk-DIPJ73JH.js";function f(t,o=[]){if(!Array.isArray(t))return!1;let u=Array.isArray(o)?o:[o];return u.length===0?!0:t.every(r=>u.some(n=>{let e=i(n);if(!e)return n(r);if(n===Number)return typeof r=="number";if(n===String)return typeof r=="string";if(n===Boolean)return typeof r=="boolean";if(e)return r instanceof n}))}export{f as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a}from"../../../chunks/chunk-DIPJ73JH.js";export{a as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a,b}from"../../../chunks/chunk-SL2VL6LV.js";import"../../../chunks/chunk-PMZGSBLC.js";export{b as default,a as falsyValues};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function isInEnum<E extends Object>(enumObj: E, value: unknown): value is E[keyof E];
|
@@ -0,0 +1 @@
|
|
1
|
+
function u(e,n){return Object.values(e).includes(n)}export{u as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a,b}from"../../../chunks/chunk-PMZGSBLC.js";export{b as default,a as nullishValues};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function isObject(unk: unknown): unk is object;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a}from"../../../chunks/chunk-QQRJPDR7.js";export{a as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a,b}from"../../../chunks/chunk-WZBNXYN3.js";export{b as default,a as regex};
|
@@ -0,0 +1 @@
|
|
1
|
+
function i(c){let e,t;return function(...n){let s=e!==void 0&&n.every((r,a)=>e[a]===r),d=e!==void 0&&e.every((r,a)=>n[a]===r);if(s&&d)return t;let u=c(...n);return t=u,u}}export{i as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function validateScheme<T>(obj: T, scheme: Partial<T>): boolean;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a as r}from"../../../chunks/chunk-QQRJPDR7.js";function n(e,t){return r(e)?Object.entries(t).every(([a,i])=>e[a]===i):!1}export{n as default};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export declare const hexChars: string[];
|
2
|
+
export declare function randomHexChar(): string;
|
3
|
+
export declare function randomHash(length?: number): string;
|
4
|
+
export declare function randomHashPattern(pattern: number[], joiner?: string): string;
|
5
|
+
export default function randomUUID(): string;
|
@@ -0,0 +1 @@
|
|
1
|
+
var o=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function a(){let r=Math.floor(Math.random()*16);return o[r]}function e(r=4){return new Array(r).fill(null).map(n=>a()).join("")}function u(r,n="-"){return r.map(t=>e(t)).join(n)}function i(){return u([8,4,4,4,12])}export{i as default,o as hexChars,e as randomHash,u as randomHashPattern,a as randomHexChar};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
type FuncRecord = Record<string, (...args: any[]) => any>;
|
2
|
+
type UnwrapPromise<PromiseOrNot> = PromiseOrNot extends Promise<infer Resolved> ? Resolved : PromiseOrNot;
|
3
|
+
export default function recordFormat<Format extends FuncRecord>(input: Record<string, unknown>, format: Format): Promise<{
|
4
|
+
[Key in keyof Format]: UnwrapPromise<ReturnType<Format[Key]>>;
|
5
|
+
}>;
|
6
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
async function y(n,s){let e={},r=[];return Object.entries(s).forEach(async([o,a])=>{let i=n[o],t=a(i);r.push(t);let m=await t;e[o]=m}),await Promise.all(r),e}export{y as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function replaceAll(input: string, pattern: string | RegExp, replacer: string | ((substring: string, ...args: any[]) => string), maxOps?: number): string;
|
@@ -0,0 +1 @@
|
|
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};
|
@@ -0,0 +1,10 @@
|
|
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 {};
|
@@ -0,0 +1 @@
|
|
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};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function roundNumbers(number: number, nbDecimals: number): number;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a}from"../../../chunks/chunk-BW5CY5YB.js";export{a as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function selectorToElement(selector: string, documentObj?: Document): Promise<any>;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a as o}from"../../../chunks/chunk-AFA3GSXO.js";import"../../../chunks/chunk-CF6GPH7Z.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};
|
@@ -0,0 +1,53 @@
|
|
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) => any;
|
5
|
+
danger: (text: string) => any;
|
6
|
+
important: (text: string) => any;
|
7
|
+
title: (text: string) => string;
|
8
|
+
info: (text: string) => any;
|
9
|
+
error: (text: string) => any;
|
10
|
+
warning: (text: string) => any;
|
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 {};
|
@@ -0,0 +1,9 @@
|
|
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};
|
@@ -0,0 +1,7 @@
|
|
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 {};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{b as i}from"../../../chunks/chunk-LCBMRJKP.js";import{a as o}from"../../../chunks/chunk-AFA3GSXO.js";import"../../../chunks/chunk-CF6GPH7Z.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};
|
@@ -0,0 +1,30 @@
|
|
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 {};
|
@@ -0,0 +1 @@
|
|
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"&&(window.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};
|
@@ -0,0 +1,39 @@
|
|
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>;
|
@@ -0,0 +1 @@
|
|
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};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function wait(durationMs: number): Promise<unknown>;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{a}from"../../../chunks/chunk-PCAKH6ZJ.js";export{a as default};
|
@@ -0,0 +1,4 @@
|
|
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;
|
@@ -0,0 +1,2 @@
|
|
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};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function getCurrentDownlink(): number | undefined;
|
@@ -0,0 +1 @@
|
|
1
|
+
function o(){let n=window.navigator;return(n?.connection??n?.mozConnection??n?.webkitConnection)?.downlink}export{o as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
export default function getNodeAncestors(node: Node): Element[];
|
@@ -0,0 +1 @@
|
|
1
|
+
function l(t){let n=[],e=t.parentElement;for(;e!==null;)n.push(e),e=e.parentElement;return n}export{l as default};
|
@@ -14,14 +14,20 @@ export type Options = {
|
|
14
14
|
followSimlinks?: boolean;
|
15
15
|
dedupeSimlinksContents?: boolean;
|
16
16
|
maxDepth?: number;
|
17
|
-
|
17
|
+
returnRelative?: boolean;
|
18
|
+
exclude?: RegExp | null;
|
19
|
+
include?: RegExp | null;
|
20
|
+
filter?: ((path: string, details: ChildDetails) => boolean | Promise<boolean>);
|
18
21
|
};
|
19
22
|
export declare const defaultOptions: Required<Options>;
|
20
23
|
export declare const fillOptions: (input: Options) => Required<Options>;
|
21
24
|
export type Context = {
|
22
25
|
depth?: number;
|
23
26
|
lstats?: Stats | null;
|
27
|
+
rootPath?: string | null;
|
24
28
|
};
|
25
29
|
export declare const defaultContext: Required<Context>;
|
26
30
|
export declare const fillContext: (input: Context) => Required<Context>;
|
27
|
-
export default function listSubpaths(
|
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 +1 @@
|
|
1
|
-
import{promises as a}from"node:fs";import
|
1
|
+
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},w=s=>({...P,...s}),v={depth:0,lstats:null,rootPath:null},g=s=>({...v,...s});async function O(...s){let[u,c]=s,t=w(c??{}),e=await p(...s);return t.returnRelative?e.map(i=>h.relative(u,i)):e}async function p(s,u={},c={}){let t=w(u),e=g(c);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 S=await a.readdir(s);return await Promise.all(S.map(async d=>{let o=h.join(s,d),k=h.relative(e.rootPath??s,o),r=await a.lstat(o);try{let l=r.isDirectory(),n=r.isSymbolicLink(),f=!l&&!n,x=h.basename(o).startsWith("."),C=l?"directory":n?"symlink":"file";if(l&&t.directories===!1)throw!0;if(n&&t.symlinks===!1||f&&t.files===!1||x&&t.hidden===!1)throw!1;let m=n?await a.realpath(o):o,y=t.returnRelative?k:o,R=t.exclude?.test(y)===!0,D=t.include?.test(y)===!0;if(R&&!D)throw!1;if(!await t.filter(y,{type:C,hidden:x,realPath:m}))throw!0;if(n)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(l){let b=await p(o,t,{...e,depth:e.depth+1,lstats:r});i.push(o,...b)}else i.push(o)}catch(l){if(typeof l!="boolean")throw new Error("This try/catch block should only throw booleans");if(!l)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{O as default,v as defaultContext,P as defaultOptions,g as fillContext,w as fillOptions};
|
@@ -1 +0,0 @@
|
|
1
|
-
export default function listSubdirectoriesIndexes(root: string, extensions?: string[]): Promise<string[]>;
|
@@ -1 +0,0 @@
|
|
1
|
-
import{promises as t,existsSync as d}from"node:fs";import n from"node:path";async function l(r,i){if(!d(r))return[];if(!(await t.stat(r)).isDirectory())return[];let c=(await t.readdir(r)).map(e=>n.join(r,e));return(await Promise.all(c.map(async e=>{try{if(!d(e))return!1;if(!(await t.stat(e)).isDirectory())return;let s=(await t.readdir(e)).find(o=>{let a=n.extname(o).toLowerCase(),f=n.basename(o,a),m=i!==void 0?i.includes(a):!0;return!!(f==="index"&&m)});return s===void 0?!1:n.join(e,s)}catch{return}}))).filter(e=>e!==void 0)}export{l as default};
|