@design-edito/tools 0.3.1 → 0.3.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/css/bem/index.js +3 -3
- package/agnostic/html/hyper-json/cast/index.js +6 -6
- package/agnostic/html/hyper-json/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjparse/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjstringify/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +6 -6
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +6 -6
- package/agnostic/html/hyper-json/tree/index.js +6 -6
- package/agnostic/html/hyper-json/utils/index.js +6 -6
- package/agnostic/misc/cast/index.js +49 -10
- package/agnostic/misc/crawler/index.d.ts +52 -26
- package/agnostic/misc/crawler/index.js +14 -4
- package/agnostic/objects/deep-get-property/index.test.d.ts +1 -0
- package/agnostic/objects/enums/is-in-enum/index.test.d.ts +1 -0
- package/agnostic/objects/flatten-getters/index.d.ts +2 -2
- package/agnostic/objects/flatten-getters/index.js +8 -17
- package/agnostic/objects/flatten-getters/index.test.d.ts +1 -0
- package/agnostic/objects/is-object/index.test.d.ts +1 -0
- package/agnostic/objects/is-record/index.test.d.ts +1 -0
- package/agnostic/objects/record-format/index.d.ts +25 -26
- package/agnostic/objects/record-format/index.js +1 -5
- package/agnostic/objects/record-format/index.test.d.ts +1 -0
- package/agnostic/objects/record-map/index.d.ts +5 -5
- package/agnostic/objects/record-map/index.test.d.ts +1 -0
- package/agnostic/objects/validation/index.test.d.ts +1 -0
- package/agnostic/optim/memoize/index.test.d.ts +1 -0
- package/agnostic/optim/throttle-debounce/index.js +1 -1
- package/agnostic/optim/throttle-debounce/index.test.d.ts +1 -0
- package/agnostic/random/hex-char/index.test.d.ts +1 -0
- package/agnostic/random/random/index.test.d.ts +1 -0
- package/agnostic/random/uuid/index.test.d.ts +1 -0
- package/agnostic/regexps/index.d.ts +5 -2
- package/agnostic/regexps/index.js +15 -3
- package/agnostic/regexps/index.test.d.ts +1 -0
- package/agnostic/sanitization/file-name/index.test.d.ts +1 -0
- package/agnostic/sanitization/path/index.test.d.ts +1 -0
- package/agnostic/sanitization/user-input/index.d.ts +2 -2
- package/agnostic/sanitization/user-input/index.js +13 -8
- package/agnostic/sanitization/user-input/index.test.d.ts +1 -0
- package/agnostic/typescript/types.d.ts +4 -0
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +4 -4
- package/node/cloud-storage/operations/copy-dir/index.js +6 -6
- package/node/cloud-storage/operations/copy-file/index.js +3 -3
- package/node/cloud-storage/operations/download-file/index.js +3 -3
- package/node/cloud-storage/operations/exists-file/index.js +3 -3
- package/node/cloud-storage/operations/list-dir/index.js +3 -3
- package/node/cloud-storage/operations/move-dir/index.js +3 -3
- package/node/cloud-storage/operations/move-file/index.js +3 -3
- package/node/cloud-storage/operations/remove-dir/index.js +3 -3
- package/node/cloud-storage/operations/remove-file/index.js +3 -3
- package/node/cloud-storage/operations/stat-file/index.js +3 -3
- package/node/images/transform/index.js +26 -26
- package/package.json +1 -1
- package/chunks/chunk-YWSXCFYY.js +0 -61
- package/chunks/{chunk-7NIIWL3S.js → chunk-TAURL7GX.js} +16 -16
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
boolean
|
|
3
|
-
} from "../../../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../../../chunks/chunk-
|
|
18
|
+
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
boolean
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
element
|
|
3
|
-
} from "../../../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../../../chunks/chunk-
|
|
18
|
+
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
element
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
get
|
|
3
|
-
} from "../../../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../../../chunks/chunk-
|
|
18
|
+
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
get
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
global
|
|
3
|
-
} from "../../../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../../../chunks/chunk-
|
|
18
|
+
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
global
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
guess
|
|
3
|
-
} from "../../../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../../../chunks/chunk-
|
|
18
|
+
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
guess
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
nodelist
|
|
3
|
-
} from "../../../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../../../chunks/chunk-
|
|
18
|
+
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
nodelist
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
number
|
|
3
|
-
} from "../../../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../../../chunks/chunk-
|
|
18
|
+
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
number
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
record
|
|
3
|
-
} from "../../../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../../../chunks/chunk-
|
|
18
|
+
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
record
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
func,
|
|
3
3
|
ref
|
|
4
|
-
} from "../../../../../../chunks/chunk-
|
|
4
|
+
} from "../../../../../../chunks/chunk-TAURL7GX.js";
|
|
5
5
|
import "../../../../../../chunks/chunk-AKNR3U25.js";
|
|
6
|
-
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
7
|
-
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
8
6
|
import "../../../../../../chunks/chunk-ZKIQ753F.js";
|
|
9
7
|
import "../../../../../../chunks/chunk-USIYKRNX.js";
|
|
8
|
+
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
9
|
+
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
10
10
|
import "../../../../../../chunks/chunk-HEY7J6GI.js";
|
|
11
11
|
import "../../../../../../chunks/chunk-JVMFT3IT.js";
|
|
12
12
|
import "../../../../../../chunks/chunk-RW7VAKJW.js";
|
|
13
13
|
import "../../../../../../chunks/chunk-XA4HVHJ4.js";
|
|
14
14
|
import "../../../../../../chunks/chunk-XNF5MLCQ.js";
|
|
15
15
|
import "../../../../../../chunks/chunk-E6MSDKON.js";
|
|
16
|
-
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
17
|
-
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
18
16
|
import "../../../../../../chunks/chunk-YDIBNEGA.js";
|
|
19
17
|
import "../../../../../../chunks/chunk-EPUHVR7J.js";
|
|
20
18
|
import "../../../../../../chunks/chunk-6XL25OZX.js";
|
|
21
|
-
import "../../../../../../chunks/chunk-
|
|
19
|
+
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
20
|
+
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
22
21
|
import "../../../../../../chunks/chunk-FENXVJYO.js";
|
|
22
|
+
import "../../../../../../chunks/chunk-HQLRJ7XW.js";
|
|
23
23
|
import "../../../../../../chunks/chunk-XCBH6NLF.js";
|
|
24
24
|
export {
|
|
25
25
|
func,
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
string
|
|
3
|
-
} from "../../../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../../../chunks/chunk-
|
|
18
|
+
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
string
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
text
|
|
3
|
-
} from "../../../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../../../chunks/chunk-
|
|
18
|
+
import "../../../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
text
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tree
|
|
3
|
-
} from "../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../chunks/chunk-
|
|
18
|
+
import "../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
Tree
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Utils
|
|
3
|
-
} from "../../../../chunks/chunk-
|
|
3
|
+
} from "../../../../chunks/chunk-TAURL7GX.js";
|
|
4
4
|
import "../../../../chunks/chunk-AKNR3U25.js";
|
|
5
|
-
import "../../../../chunks/chunk-XEQ2PBT2.js";
|
|
6
|
-
import "../../../../chunks/chunk-DUCLFPGE.js";
|
|
7
5
|
import "../../../../chunks/chunk-ZKIQ753F.js";
|
|
8
6
|
import "../../../../chunks/chunk-USIYKRNX.js";
|
|
7
|
+
import "../../../../chunks/chunk-XEQ2PBT2.js";
|
|
8
|
+
import "../../../../chunks/chunk-DUCLFPGE.js";
|
|
9
9
|
import "../../../../chunks/chunk-HEY7J6GI.js";
|
|
10
10
|
import "../../../../chunks/chunk-JVMFT3IT.js";
|
|
11
11
|
import "../../../../chunks/chunk-RW7VAKJW.js";
|
|
12
12
|
import "../../../../chunks/chunk-XA4HVHJ4.js";
|
|
13
13
|
import "../../../../chunks/chunk-XNF5MLCQ.js";
|
|
14
14
|
import "../../../../chunks/chunk-E6MSDKON.js";
|
|
15
|
-
import "../../../../chunks/chunk-QEKI6WGQ.js";
|
|
16
|
-
import "../../../../chunks/chunk-ROWPCMQY.js";
|
|
17
15
|
import "../../../../chunks/chunk-YDIBNEGA.js";
|
|
18
16
|
import "../../../../chunks/chunk-EPUHVR7J.js";
|
|
19
17
|
import "../../../../chunks/chunk-6XL25OZX.js";
|
|
20
|
-
import "../../../../chunks/chunk-
|
|
18
|
+
import "../../../../chunks/chunk-QEKI6WGQ.js";
|
|
19
|
+
import "../../../../chunks/chunk-ROWPCMQY.js";
|
|
21
20
|
import "../../../../chunks/chunk-FENXVJYO.js";
|
|
21
|
+
import "../../../../chunks/chunk-HQLRJ7XW.js";
|
|
22
22
|
import "../../../../chunks/chunk-XCBH6NLF.js";
|
|
23
23
|
export {
|
|
24
24
|
Utils
|
|
@@ -1,16 +1,55 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
toError,
|
|
5
|
-
toNull,
|
|
6
|
-
toNumber,
|
|
7
|
-
toNumberArr,
|
|
8
|
-
toRecord,
|
|
9
|
-
toString
|
|
10
|
-
} from "../../../chunks/chunk-YWSXCFYY.js";
|
|
11
|
-
import "../../../chunks/chunk-QXAJXTXV.js";
|
|
2
|
+
isFalsy
|
|
3
|
+
} from "../../../chunks/chunk-QXAJXTXV.js";
|
|
12
4
|
import "../../../chunks/chunk-HC6ZOHCS.js";
|
|
13
5
|
import "../../../chunks/chunk-XCBH6NLF.js";
|
|
6
|
+
|
|
7
|
+
// src/agnostic/misc/cast/index.ts
|
|
8
|
+
function toBoolean(value) {
|
|
9
|
+
if (typeof value === "boolean") return value;
|
|
10
|
+
if (typeof value === "string") {
|
|
11
|
+
if (value.toLowerCase().trim() === "true") return true;
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return !isFalsy(value);
|
|
15
|
+
}
|
|
16
|
+
function toNumber(value) {
|
|
17
|
+
if (typeof value === "number") return value;
|
|
18
|
+
if (typeof value === "string") return parseFloat(value);
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
21
|
+
function toString(value) {
|
|
22
|
+
if (typeof value === "string") return value;
|
|
23
|
+
return String(value);
|
|
24
|
+
}
|
|
25
|
+
function toNull(_value) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
function toArray(value) {
|
|
29
|
+
if (Array.isArray(value)) return value;
|
|
30
|
+
if (typeof value === "object" && value !== null) return Object.entries(value);
|
|
31
|
+
return [value];
|
|
32
|
+
}
|
|
33
|
+
function toNumberArr(value) {
|
|
34
|
+
const arrValue = toArray(value);
|
|
35
|
+
return arrValue.map((val) => toNumber(val));
|
|
36
|
+
}
|
|
37
|
+
function toRecord(value) {
|
|
38
|
+
const record = {};
|
|
39
|
+
try {
|
|
40
|
+
Object.keys(value).forEach((key) => {
|
|
41
|
+
record[key] = value[key];
|
|
42
|
+
});
|
|
43
|
+
} catch (err) {
|
|
44
|
+
return record;
|
|
45
|
+
}
|
|
46
|
+
return record;
|
|
47
|
+
}
|
|
48
|
+
function toError(value) {
|
|
49
|
+
if (value instanceof Error) return value;
|
|
50
|
+
if (typeof value === "string") return new Error(value);
|
|
51
|
+
return new Error(toString(value));
|
|
52
|
+
}
|
|
14
53
|
export {
|
|
15
54
|
toArray,
|
|
16
55
|
toBoolean,
|
|
@@ -12,52 +12,78 @@ export type Fetcher<T> = (url: string) => Promise<T>;
|
|
|
12
12
|
* @template T - The type of content provided by the fetcher.
|
|
13
13
|
* @param {string} url - The URL of the content being processed.
|
|
14
14
|
* @param {T} content - The content fetched from the URL.
|
|
15
|
-
* @param {
|
|
15
|
+
* @param {object} hooks - Hooks for accessing crawler state and controlling the crawl.
|
|
16
|
+
* @param {(...urls: string[]) => void} hooks.push - Enqueue one or more URLs to be crawled.
|
|
17
|
+
* @param {() => void} hooks.flush - Clear the waitlist of pending URLs.
|
|
18
|
+
* @param {Set<string>} hooks.processed - Read-only snapshot of URLs already processed.
|
|
19
|
+
* @param {string[]} hooks.waitlist - Read-only snapshot of the current waitlist of URLs.
|
|
16
20
|
* @returns {any} The result of processing (ignored by the crawler).
|
|
17
21
|
*/
|
|
18
22
|
export type Processor<T> = (url: string, content: T, hooks: {
|
|
19
23
|
push: (...urls: string[]) => void;
|
|
20
24
|
flush: () => void;
|
|
25
|
+
processed: Set<string>;
|
|
26
|
+
waitlist: string[];
|
|
21
27
|
}) => any;
|
|
22
|
-
/**
|
|
23
|
-
* Optional logging function called during crawling.
|
|
24
|
-
*
|
|
25
|
-
* @param {number} ops - Number of processed URLs so far.
|
|
26
|
-
* @param {string} url - The URL currently being processed.
|
|
27
|
-
* @param {string[]} waitlist - The current waitlist of URLs.
|
|
28
|
-
* @param {Set<string>} processed - Set of URLs already processed.
|
|
29
|
-
*/
|
|
30
|
-
export type Logger = (ops: number, url: string, waitlist: string[], processed: Set<string>) => void;
|
|
31
28
|
/**
|
|
32
29
|
* Configuration options for the crawler.
|
|
33
30
|
*
|
|
34
31
|
* @template T - The type of content returned by the fetcher.
|
|
35
|
-
* @property {number} limit - Maximum number of URLs to process.
|
|
36
|
-
* @property {number | (() => number)} [delayMs] - Optional delay between processing URLs, in milliseconds, or a function returning the delay.
|
|
37
|
-
* @property {Fetcher<T>} fetcher - Function that fetches content for each URL.
|
|
38
|
-
* @property {Processor<T>} processor - Function that processes fetched content.
|
|
39
|
-
* @property {Logger} [logger] - Optional function for logging crawl progress.
|
|
40
32
|
*/
|
|
41
33
|
export type Options<T extends any> = {
|
|
34
|
+
/** Maximum number of URLs to process. */
|
|
42
35
|
limit: number;
|
|
36
|
+
/** Optional delay between processing URLs, in milliseconds, or a function returning the delay. */
|
|
43
37
|
delayMs?: number | (() => number);
|
|
38
|
+
/** Optional, allows fetching and processing a URL that has already been seen. */
|
|
39
|
+
allowDuplicates?: boolean;
|
|
40
|
+
/** Function that fetches content for each URL. */
|
|
44
41
|
fetcher: Fetcher<T>;
|
|
42
|
+
/** Function that processes fetched content. */
|
|
45
43
|
processor: Processor<T>;
|
|
46
|
-
logger?: Logger;
|
|
47
44
|
};
|
|
48
45
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* @template T - The type of content returned by the fetcher.
|
|
52
|
-
* @param {Options<T>} options - Crawler configuration options.
|
|
53
|
-
* @returns {{
|
|
54
|
-
* crawl: (startUrl: string) => Promise<void>,
|
|
55
|
-
* push: (...urls: string[]) => void,
|
|
56
|
-
* flush: () => void
|
|
57
|
-
* }} An object with methods to start crawling, enqueue URLs, and flush the waitlist.
|
|
46
|
+
* Crawler instance with methods to start crawling, enqueue URLs, and inspect crawler state.
|
|
58
47
|
*/
|
|
59
|
-
export
|
|
48
|
+
export type Crawler = {
|
|
49
|
+
/** Start crawling from the given URL. */
|
|
60
50
|
crawl: (startUrl: string) => Promise<void>;
|
|
51
|
+
/** Enqueue one or more URLs to be crawled. */
|
|
61
52
|
push: (...urls: string[]) => void;
|
|
53
|
+
/** Clear the waitlist of pending URLs. */
|
|
62
54
|
flush: () => void;
|
|
55
|
+
/** Set of URLs that have been processed (mutable - use with caution). */
|
|
56
|
+
processed: Set<string>;
|
|
57
|
+
/** Array of URLs waiting to be processed (mutable - use with caution). */
|
|
58
|
+
waitlist: string[];
|
|
63
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Creates a sequential crawler with optional delay.
|
|
62
|
+
*
|
|
63
|
+
* @template T - The type of content returned by the fetcher.
|
|
64
|
+
* @param {Options<T>} options - Crawler configuration options.
|
|
65
|
+
* @param {number} options.limit - Maximum number of URLs to process.
|
|
66
|
+
* @param {number | (() => number)} [options.delayMs] - Optional delay between processing URLs, in milliseconds, or a function returning the delay.
|
|
67
|
+
* @param {boolean} [options.allowDuplicates] - Optional, allows fetching and processing a URL that has already been seen.
|
|
68
|
+
* @param {Fetcher<T>} options.fetcher - Function that fetches content for each URL.
|
|
69
|
+
* @param {Processor<T>} options.processor - Function that processes fetched content.
|
|
70
|
+
* @returns {Crawler} An object with methods to start crawling, enqueue URLs, flush the waitlist, and access crawler state.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const crawler = create({
|
|
75
|
+
* limit: 100,
|
|
76
|
+
* delayMs: 1000,
|
|
77
|
+
* fetcher: async (url) => fetch(url).then(r => r.text()),
|
|
78
|
+
* processor: (url, content, { push, processed, waitlist }) => {
|
|
79
|
+
* console.log(`Processed ${url}`);
|
|
80
|
+
* console.log(`Remaining: ${waitlist.length}, Done: ${processed.size}`);
|
|
81
|
+
* // Optionally push more URLs
|
|
82
|
+
* }
|
|
83
|
+
* });
|
|
84
|
+
*
|
|
85
|
+
* await crawler.crawl('https://example.com');
|
|
86
|
+
* console.log('Total processed:', crawler.processed.size);
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare function create<T extends any>(options: Options<T>): Crawler;
|
|
@@ -17,10 +17,14 @@ function create(options) {
|
|
|
17
17
|
while (waitlist.length > 0 && ops < options.limit) {
|
|
18
18
|
ops++;
|
|
19
19
|
const currentUrl = waitlist[0];
|
|
20
|
-
if (
|
|
21
|
-
if (!processed.has(currentUrl)) {
|
|
20
|
+
if (!processed.has(currentUrl) || options.allowDuplicates === true) {
|
|
22
21
|
const content = await options.fetcher(currentUrl);
|
|
23
|
-
await options.processor(currentUrl, content, {
|
|
22
|
+
await options.processor(currentUrl, content, {
|
|
23
|
+
push,
|
|
24
|
+
flush,
|
|
25
|
+
processed: new Set(processed),
|
|
26
|
+
waitlist: [...waitlist]
|
|
27
|
+
});
|
|
24
28
|
}
|
|
25
29
|
waitlist.shift();
|
|
26
30
|
processed.add(currentUrl);
|
|
@@ -28,7 +32,13 @@ function create(options) {
|
|
|
28
32
|
if (delayMs !== 0) await wait(delayMs);
|
|
29
33
|
}
|
|
30
34
|
};
|
|
31
|
-
return {
|
|
35
|
+
return {
|
|
36
|
+
crawl,
|
|
37
|
+
push,
|
|
38
|
+
flush,
|
|
39
|
+
processed,
|
|
40
|
+
waitlist
|
|
41
|
+
};
|
|
32
42
|
}
|
|
33
43
|
export {
|
|
34
44
|
create
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|