@design-edito/tools 0.2.39 → 0.2.40
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/arrays/dedupe/index.d.ts +7 -0
- package/agnostic/arrays/dedupe/index.js +10 -0
- package/agnostic/arrays/find-duplicates/index.d.ts +14 -0
- package/agnostic/arrays/find-duplicates/index.js +24 -5
- package/agnostic/arrays/find-duplicates/index.test.d.ts +1 -0
- package/agnostic/arrays/is-array-of/index.d.ts +15 -4
- package/agnostic/arrays/is-array-of/index.js +23 -4
- package/agnostic/arrays/is-array-of/index.test.d.ts +1 -0
- package/agnostic/arrays/make/index.d.ts +8 -0
- package/agnostic/arrays/make/index.js +6 -4
- package/agnostic/arrays/make/index.test.d.ts +1 -0
- package/agnostic/arrays/random-pick/index.d.ts +20 -0
- package/agnostic/arrays/random-pick/index.js +2 -10
- package/agnostic/arrays/random-pick/index.test.d.ts +1 -0
- package/agnostic/arrays/shuffle/index.d.ts +8 -0
- package/agnostic/arrays/shuffle/index.js +11 -4
- package/agnostic/arrays/shuffle/index.test.d.ts +1 -0
- package/agnostic/booleans/is-falsy/index.d.ts +17 -0
- package/agnostic/booleans/is-falsy/index.js +1 -1
- package/agnostic/colors/channels/index.d.ts +34 -0
- package/agnostic/colors/channels/index.js +6 -6
- package/agnostic/colors/contrast/index.d.ts +8 -0
- package/agnostic/colors/contrast/index.js +27 -8
- package/agnostic/colors/convert/index.d.ts +144 -0
- package/agnostic/colors/convert/index.js +5 -5
- package/agnostic/colors/distance/index.d.ts +8 -0
- package/agnostic/colors/distance/index.js +50 -7
- package/agnostic/colors/grayscale/index.d.ts +9 -1
- package/agnostic/colors/grayscale/index.js +156 -7
- package/agnostic/colors/invert/index.d.ts +8 -0
- package/agnostic/colors/invert/index.js +45 -7
- package/agnostic/colors/lerp/index.d.ts +12 -1
- package/agnostic/colors/lerp/index.js +97 -7
- package/agnostic/colors/luminance/index.d.ts +7 -0
- package/agnostic/colors/luminance/index.js +6 -6
- package/agnostic/colors/palette/index.d.ts +10 -1
- package/agnostic/colors/palette/index.js +104 -9
- package/agnostic/colors/rotate/index.d.ts +10 -1
- package/agnostic/colors/rotate/index.js +7 -7
- package/agnostic/colors/tidy/index.d.ts +9 -1
- package/agnostic/colors/tidy/index.js +5 -5
- package/agnostic/colors/typechecks/index.d.ts +60 -0
- package/agnostic/colors/typechecks/index.js +3 -3
- package/agnostic/colors/types.d.ts +106 -0
- package/agnostic/colors/types.js +2 -2
- package/agnostic/css/bem/index.d.ts +29 -6
- package/agnostic/css/bem/index.js +155 -6
- package/agnostic/css/generate-nice-color/index.d.ts +8 -2
- package/agnostic/css/generate-nice-color/index.js +70 -5
- package/agnostic/css/is-valid-css-class-name/index.d.ts +11 -0
- package/agnostic/css/is-valid-css-class-name/index.js +1 -1
- package/agnostic/css/styles-set/index.js +167 -15
- package/agnostic/errors/register/index.d.ts +31 -33
- package/agnostic/errors/register/index.js +49 -5
- package/agnostic/errors/unknown-to-string/index.d.ts +6 -0
- package/agnostic/errors/unknown-to-string/index.js +1 -1
- package/agnostic/html/get-node-ancestors/index.d.ts +12 -0
- package/agnostic/html/get-node-ancestors/index.js +1 -1
- package/agnostic/html/get-position-inside-parent/index.d.ts +8 -0
- package/agnostic/html/get-position-inside-parent/index.js +8 -4
- package/agnostic/html/hyper-json/cast/index.js +12 -12
- package/agnostic/html/hyper-json/index.js +40 -16
- package/agnostic/html/hyper-json/method/index.js +1 -1
- package/agnostic/html/hyper-json/serialize/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjparse/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjstringify/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/any/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/array/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/isolated/null/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +12 -12
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +12 -12
- package/agnostic/html/hyper-json/transformer/index.d.ts +1 -1
- package/agnostic/html/hyper-json/transformer/index.js +3 -3
- package/agnostic/html/hyper-json/tree/index.js +12 -12
- package/agnostic/html/hyper-json/types/index.d.ts +1 -1
- package/agnostic/html/hyper-json/types/index.js +1 -1
- package/agnostic/html/hyper-json/utils/index.d.ts +1 -1
- package/agnostic/html/hyper-json/utils/index.js +12 -12
- package/agnostic/html/insert-node/index.d.ts +17 -0
- package/agnostic/html/insert-node/index.js +1 -1
- package/agnostic/html/placeholders/index.d.ts +7 -9
- package/agnostic/html/placeholders/index.js +37 -5
- package/agnostic/html/replace-in-element/index.d.ts +14 -0
- package/agnostic/html/replace-in-element/index.js +1 -1
- package/agnostic/html/selector-to-element/index.d.ts +16 -1
- package/agnostic/html/selector-to-element/index.js +29 -11
- package/agnostic/html/string-to-nodes/index.d.ts +14 -7
- package/agnostic/html/string-to-nodes/index.js +14 -12
- package/agnostic/misc/assert/index.d.ts +5 -7
- package/agnostic/misc/assert/index.js +61 -8
- package/agnostic/misc/cast/index.d.ts +81 -10
- package/agnostic/misc/cast/index.js +18 -4
- package/agnostic/misc/connection/index.d.ts +26 -0
- package/agnostic/misc/connection/index.js +39 -0
- package/agnostic/misc/crawler/index.d.ts +63 -16
- package/agnostic/misc/crawler/index.js +36 -5
- package/agnostic/misc/crossenv/detect-runtime/index.d.ts +12 -2
- package/agnostic/misc/crossenv/detect-runtime/index.js +14 -5
- package/agnostic/misc/crossenv/types.d.ts +39 -0
- package/agnostic/misc/crossenv/types.js +7 -0
- package/agnostic/misc/crossenv/window/index.d.ts +28 -7
- package/agnostic/misc/crossenv/window/index.js +10 -4
- package/agnostic/misc/crossenv/window/index.test.d.ts +1 -0
- package/agnostic/misc/data-size/index.d.ts +43 -21
- package/agnostic/misc/data-size/index.js +270 -34
- package/agnostic/misc/data-size/types.d.ts +37 -0
- package/agnostic/misc/elo/index.d.ts +28 -30
- package/agnostic/misc/elo/index.js +27 -30
- package/agnostic/misc/is-constructor-function/index.d.ts +11 -0
- package/agnostic/misc/is-constructor-function/index.js +1 -1
- package/agnostic/misc/is-nullish/index.d.ts +22 -0
- package/agnostic/misc/is-nullish/index.js +1 -1
- package/agnostic/misc/logs/logger/index.js +109 -4
- package/agnostic/misc/logs/make-text-block/index.js +1 -1
- package/agnostic/misc/logs/styles/index.js +1 -1
- package/agnostic/misc/lorem-ipsum/index.d.ts +3 -5
- package/agnostic/misc/lorem-ipsum/index.js +187 -23
- package/agnostic/misc/normalize-extension/index.d.ts +10 -0
- package/agnostic/misc/normalize-extension/index.js +1 -1
- package/agnostic/misc/outcome/index.d.ts +56 -15
- package/agnostic/misc/outcome/index.js +8 -4
- package/agnostic/numbers/absolute-modulo/index.d.ts +7 -0
- package/agnostic/numbers/absolute-modulo/index.js +1 -1
- package/agnostic/numbers/clamp/index.d.ts +8 -0
- package/agnostic/numbers/clamp/index.js +1 -1
- package/agnostic/numbers/interpolate/index.d.ts +20 -1
- package/agnostic/numbers/interpolate/index.js +12 -7
- package/agnostic/numbers/responsive-harmonics/index.d.ts +20 -0
- package/agnostic/numbers/responsive-harmonics/index.js +49 -5
- package/agnostic/numbers/round/index.d.ts +24 -3
- package/agnostic/numbers/round/index.js +2 -2
- package/agnostic/objects/deep-get-property/index.d.ts +8 -0
- package/agnostic/objects/deep-get-property/index.js +23 -4
- package/agnostic/objects/enums/is-in-enum/index.d.ts +10 -0
- package/agnostic/objects/enums/is-in-enum/index.js +1 -1
- package/agnostic/objects/flatten-getters/index.d.ts +6 -0
- package/agnostic/objects/flatten-getters/index.js +19 -4
- package/agnostic/objects/is-object/index.d.ts +12 -0
- package/agnostic/objects/is-object/index.js +1 -1
- package/agnostic/objects/is-record/index.d.ts +6 -0
- package/agnostic/objects/is-record/index.js +1 -1
- package/agnostic/objects/record-format/index.d.ts +27 -0
- package/agnostic/objects/record-format/index.js +15 -4
- package/agnostic/objects/record-map/index.d.ts +9 -0
- package/agnostic/objects/record-map/index.js +1 -1
- package/agnostic/objects/validation/index.d.ts +11 -3
- package/agnostic/objects/validation/index.js +9 -5
- package/agnostic/optim/memoize/index.d.ts +10 -1
- package/agnostic/optim/memoize/index.js +16 -4
- package/agnostic/optim/throttle-debounce/index.js +110 -5
- package/agnostic/optim/throttle-debounce/types.d.ts +1 -1
- package/agnostic/random/hex-char/index.d.ts +2 -0
- package/agnostic/random/hex-char/index.js +1 -1
- package/agnostic/random/random/index.d.ts +14 -0
- package/agnostic/random/random/index.js +1 -1
- package/agnostic/random/uuid/index.d.ts +18 -0
- package/agnostic/random/uuid/index.js +1 -1
- package/agnostic/regexps/index.d.ts +95 -24
- package/agnostic/regexps/index.js +86 -5
- package/agnostic/sanitization/file-name/index.d.ts +13 -0
- package/agnostic/sanitization/file-name/index.js +7 -0
- package/agnostic/sanitization/html/index.d.ts +61 -0
- package/agnostic/sanitization/html/index.js +121 -0
- package/agnostic/sanitization/path/index.d.ts +11 -0
- package/agnostic/sanitization/path/index.js +14 -0
- package/agnostic/sanitization/types.d.ts +37 -0
- package/agnostic/sanitization/types.js +0 -0
- package/agnostic/sanitization/user-input/index.d.ts +13 -0
- package/agnostic/sanitization/user-input/index.js +23 -0
- package/agnostic/strings/char-codes/index.d.ts +82 -17
- package/agnostic/strings/char-codes/index.js +68 -5
- package/agnostic/strings/matches/index.d.ts +24 -0
- package/agnostic/strings/matches/index.js +1 -1
- package/agnostic/strings/normalize-indent/index.d.ts +22 -0
- package/agnostic/strings/normalize-indent/index.js +16 -4
- package/agnostic/strings/parse-table/index.d.ts +123 -66
- package/agnostic/strings/parse-table/index.js +83 -4
- package/agnostic/strings/replace-all/index.d.ts +20 -0
- package/agnostic/strings/replace-all/index.js +2 -2
- package/agnostic/strings/to-alphanum/index.d.ts +18 -0
- package/agnostic/strings/to-alphanum/index.js +8 -4
- package/agnostic/strings/trim/index.d.ts +18 -0
- package/agnostic/strings/trim/index.js +1 -1
- package/agnostic/time/dates/format-date/index.d.ts +47 -0
- package/agnostic/time/dates/format-date/index.js +58 -4
- package/agnostic/time/duration/index.d.ts +38 -25
- package/agnostic/time/duration/index.js +110 -5
- package/agnostic/time/timeout/index.d.ts +8 -0
- package/agnostic/time/timeout/index.js +16 -4
- package/agnostic/time/transitions/index.d.ts +73 -40
- package/agnostic/time/transitions/index.js +158 -5
- package/agnostic/time/wait/index.d.ts +6 -0
- package/agnostic/time/wait/index.js +1 -1
- package/chunks/{chunk-CLLJV343.js → chunk-27SSMK5F.js} +8 -7
- package/chunks/{chunk-FNQAF6CQ.js → chunk-2QDYPY2O.js} +5 -5
- package/chunks/{chunk-ON6LC3HE.js → chunk-2WSVYQ5Q.js} +6 -13
- package/chunks/chunk-4WE2WEXL.js +12 -0
- package/chunks/{chunk-QWNWZBIO.js → chunk-53ILYMIY.js} +8 -7
- package/chunks/{chunk-FF5NURFO.js → chunk-54KPQCVI.js} +6 -13
- package/chunks/{chunk-SRXNICSE.js → chunk-5CFQCSKJ.js} +6 -5
- package/chunks/{chunk-FKDPPFHV.js → chunk-5NTPCRFH.js} +1 -11
- package/chunks/{chunk-IV75M3KE.js → chunk-5O52VUI6.js} +6 -13
- package/chunks/{chunk-4XSDRT23.js → chunk-5X76KDYN.js} +7 -14
- package/chunks/{chunk-RHKFMXM3.js → chunk-65BFQP3T.js} +6 -5
- package/chunks/{chunk-7J7CYOXU.js → chunk-66BURDRK.js} +8 -15
- package/chunks/{chunk-ZEZCYPLQ.js → chunk-6BGIDRU5.js} +7 -14
- package/chunks/{chunk-5ZJ3KJPK.js → chunk-6YVXSCRH.js} +7 -14
- package/chunks/{chunk-NMYVJJXV.js → chunk-7B2E2NGH.js} +7 -14
- package/chunks/{chunk-YXLHZ2KW.js → chunk-AKFDKOHE.js} +2 -2
- package/chunks/{chunk-QAVYONH6.js → chunk-AKNR3U25.js} +5 -5
- package/chunks/{chunk-CVDCTI7F.js → chunk-AOEOW5XW.js} +7 -14
- package/chunks/{chunk-QSU3CVGF.js → chunk-ASWI3EO6.js} +6 -5
- package/chunks/{chunk-QWZ4ZNFA.js → chunk-AV373PHY.js} +8 -15
- package/chunks/{chunk-VROZGPC5.js → chunk-AXMAF3J2.js} +7 -14
- package/chunks/{chunk-QTA7ZEVX.js → chunk-AYGAQQXD.js} +6 -5
- package/chunks/chunk-BHGRXDTS.js +28 -0
- package/chunks/{chunk-CNYSX2L2.js → chunk-BQABPH3I.js} +7 -14
- package/chunks/{chunk-WV5N7ESL.js → chunk-BQXTV2GG.js} +9 -16
- package/chunks/{chunk-37TRFYZT.js → chunk-BXFRBV67.js} +6 -13
- package/chunks/{chunk-3LCD73SB.js → chunk-C4VX4TTP.js} +1 -1
- package/chunks/{chunk-3CLGBOHN.js → chunk-DBNCEHTT.js} +6 -13
- package/chunks/{chunk-HRNDUTZE.js → chunk-DBZAJJUF.js} +8 -15
- package/chunks/{chunk-SXRWMH3U.js → chunk-DUCLFPGE.js} +5 -5
- package/chunks/{chunk-UK2F7CWI.js → chunk-EBQRPRRC.js} +6 -13
- package/chunks/{chunk-TGVYEQIA.js → chunk-EEPLTO3E.js} +7 -14
- package/chunks/{chunk-D5CCWCEI.js → chunk-ENOTZXFS.js} +1 -1
- package/chunks/{chunk-ZTDVUXPR.js → chunk-EPUHVR7J.js} +1 -0
- package/chunks/{chunk-NCYE5WML.js → chunk-FAAIUU6V.js} +4 -4
- package/chunks/{chunk-REZC75LB.js → chunk-FH74QWR6.js} +10 -18
- package/chunks/{chunk-FD5WR2A5.js → chunk-FM3HGCFL.js} +8 -15
- package/chunks/{chunk-W3RXHN5I.js → chunk-FSI422YG.js} +6 -13
- package/chunks/{chunk-UT2J62LH.js → chunk-HEY7J6GI.js} +1 -1
- package/chunks/chunk-HOFEVF7T.js +61 -0
- package/chunks/chunk-HYPEWMYZ.js +10 -0
- package/chunks/{chunk-V3L55I2S.js → chunk-IBQQCUYV.js} +6 -13
- package/chunks/{chunk-2HJPX7E3.js → chunk-IK2S6ZYP.js} +6 -5
- package/chunks/{chunk-V3GX7SIJ.js → chunk-ISJONMNA.js} +1 -13
- package/chunks/{chunk-ZJTWDCNZ.js → chunk-J5D4OQ5U.js} +6 -13
- package/chunks/{chunk-67V4BGOB.js → chunk-JDINERKY.js} +1 -1
- package/chunks/{chunk-ZSUG52DO.js → chunk-JFXEMK66.js} +6 -13
- package/chunks/{chunk-RWO53U4X.js → chunk-JN2UETL4.js} +7 -14
- package/chunks/chunk-JU23NBY2.js +22 -0
- package/chunks/{chunk-BKO7GLC2.js → chunk-JVMFT3IT.js} +7 -6
- package/chunks/{chunk-AQBJ6HNB.js → chunk-K5UF634H.js} +1 -5
- package/chunks/{chunk-7UGMWTP5.js → chunk-KRYJVBO5.js} +1 -10
- package/chunks/{chunk-DZ2T5DTY.js → chunk-LFHDJTZJ.js} +1 -1
- package/chunks/{chunk-3G6FOHII.js → chunk-MHNUCHPP.js} +6 -5
- package/chunks/{chunk-P5JJOC5K.js → chunk-MSJ7WDFX.js} +8 -7
- package/chunks/{chunk-5VHFXWFM.js → chunk-NEMHJSNM.js} +6 -13
- package/chunks/{chunk-BWYH445G.js → chunk-NIIAUOBO.js} +6 -13
- package/chunks/{chunk-HFZGH6V2.js → chunk-NR7STUY3.js} +6 -5
- package/chunks/{chunk-2JH4TCT2.js → chunk-O66PEU62.js} +6 -13
- package/chunks/{chunk-QH64MYGA.js → chunk-O7UCJNVF.js} +7 -14
- package/chunks/{chunk-WAHPAZQS.js → chunk-OF2W4ZRG.js} +6 -13
- package/chunks/{chunk-P26Y7YUA.js → chunk-PTJO2TGI.js} +6 -5
- package/chunks/{chunk-BE7OXZRK.js → chunk-PTN2V757.js} +7 -14
- package/chunks/chunk-QEKI6WGQ.js +27 -0
- package/chunks/{chunk-EOE2ODJR.js → chunk-QHEWBOQI.js} +3 -3
- package/chunks/{chunk-N2T672IG.js → chunk-RGQNRTBI.js} +6 -13
- package/chunks/chunk-ROWPCMQY.js +29 -0
- package/chunks/{chunk-KJAEVOIW.js → chunk-S2I77NEE.js} +8 -15
- package/chunks/{chunk-CWZFRUBS.js → chunk-S6ZFFGWH.js} +7 -14
- package/chunks/{chunk-6IYUA43Q.js → chunk-SBBIQ5UH.js} +7 -14
- package/chunks/{chunk-IYQV2LP4.js → chunk-SGGJJ46D.js} +321 -319
- package/chunks/{chunk-YVKM7N55.js → chunk-U225LGOV.js} +8 -7
- package/chunks/{chunk-HWEGQVBQ.js → chunk-ULYGDEW2.js} +6 -13
- package/chunks/{chunk-QAQZEKIF.js → chunk-USIYKRNX.js} +6 -6
- package/chunks/{chunk-FB3GNE2B.js → chunk-UZ4SWSOZ.js} +8 -15
- package/chunks/{chunk-4XBUJAQU.js → chunk-VU6JYR3W.js} +7 -14
- package/chunks/{chunk-FE4DECBU.js → chunk-VYDUHDXW.js} +7 -14
- package/chunks/{chunk-BSUQNHAM.js → chunk-W5VY535B.js} +7 -14
- package/chunks/{chunk-STPN5KZL.js → chunk-WF2JNQV4.js} +8 -7
- package/chunks/chunk-XCBH6NLF.js +42 -0
- package/chunks/chunk-XIIJYVJZ.js +15 -0
- package/chunks/{chunk-QDVDHFMZ.js → chunk-Y6FD4ASO.js} +7 -14
- package/chunks/{chunk-C6QTHDDM.js → chunk-YOP6WVCF.js} +7 -14
- package/chunks/chunk-ZKIQ753F.js +23 -0
- package/chunks/{chunk-QLDN574K.js → chunk-ZTPRFEPV.js} +7 -14
- package/components/Comp/index.js +7 -4
- package/node/@aws-s3/storage/directory/copy-dir/index.d.ts +4 -12
- package/node/@aws-s3/storage/directory/copy-dir/index.js +3 -3
- package/node/@aws-s3/storage/directory/list/index.d.ts +1 -1
- package/node/@aws-s3/storage/directory/list/index.js +3 -3
- package/node/@aws-s3/storage/directory/move-dir/index.d.ts +1 -1
- package/node/@aws-s3/storage/directory/move-dir/index.js +3 -3
- package/node/@aws-s3/storage/directory/remove-dir/index.d.ts +1 -1
- package/node/@aws-s3/storage/directory/remove-dir/index.js +3 -3
- package/node/@aws-s3/storage/file/copy/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/copy/index.js +3 -3
- package/node/@aws-s3/storage/file/download/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/download/index.js +3 -3
- package/node/@aws-s3/storage/file/exists/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/exists/index.js +3 -3
- package/node/@aws-s3/storage/file/move/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/move/index.js +3 -3
- package/node/@aws-s3/storage/file/remove/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/remove/index.js +3 -3
- package/node/@aws-s3/storage/file/stat/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/stat/index.js +3 -3
- package/node/@aws-s3/storage/file/upload/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/upload/index.js +3 -3
- package/node/@design-edito/index.d.ts +1 -2
- package/node/@design-edito/index.js +0 -8
- package/node/@express/@multer/index.d.ts +34 -1
- package/node/@express/@multer/index.js +43 -5
- package/node/@google-cloud/storage/bucket/get-metadata/index.d.ts +1 -1
- package/node/@google-cloud/storage/bucket/get-metadata/index.js +18 -5
- package/node/@google-cloud/storage/directory/copy-dir/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/copy-dir/index.js +3 -3
- package/node/@google-cloud/storage/directory/list/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/list/index.js +3 -3
- package/node/@google-cloud/storage/directory/move-dir/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/move-dir/index.js +3 -3
- package/node/@google-cloud/storage/directory/remove-dir/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/remove-dir/index.js +3 -3
- package/node/@google-cloud/storage/file/copy/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/copy/index.js +3 -3
- package/node/@google-cloud/storage/file/download/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/download/index.js +3 -3
- package/node/@google-cloud/storage/file/exists/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/exists/index.js +3 -3
- package/node/@google-cloud/storage/file/generate-signed-url/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/generate-signed-url/index.js +24 -5
- package/node/@google-cloud/storage/file/get-metadata/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/get-metadata/index.js +20 -5
- package/node/@google-cloud/storage/file/get-permissions/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/get-permissions/index.js +20 -5
- package/node/@google-cloud/storage/file/move/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/move/index.js +3 -3
- package/node/@google-cloud/storage/file/remove/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/remove/index.js +3 -3
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +25 -7
- package/node/@google-cloud/storage/file/stat/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/stat/index.js +3 -3
- package/node/@google-cloud/storage/file/update-metadata/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/update-metadata/index.js +20 -5
- package/node/@google-cloud/storage/file/upload/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/upload/index.js +3 -3
- package/node/cloud-storage/clients/index.d.ts +27 -0
- package/node/cloud-storage/clients/index.js +2 -2
- package/node/cloud-storage/operations/copy-dir/index.d.ts +46 -1
- package/node/cloud-storage/operations/copy-dir/index.js +30 -9
- package/node/cloud-storage/operations/copy-file/index.d.ts +46 -1
- package/node/cloud-storage/operations/copy-file/index.js +30 -9
- package/node/cloud-storage/operations/download-file/index.d.ts +50 -1
- package/node/cloud-storage/operations/download-file/index.js +30 -9
- package/node/cloud-storage/operations/exists-file/index.d.ts +44 -1
- package/node/cloud-storage/operations/exists-file/index.js +30 -9
- package/node/cloud-storage/operations/list-dir/index.d.ts +40 -1
- package/node/cloud-storage/operations/list-dir/index.js +30 -9
- package/node/cloud-storage/operations/move-dir/index.d.ts +46 -1
- package/node/cloud-storage/operations/move-dir/index.js +30 -9
- package/node/cloud-storage/operations/move-file/index.d.ts +46 -1
- package/node/cloud-storage/operations/move-file/index.js +30 -9
- package/node/cloud-storage/operations/remove-dir/index.d.ts +42 -1
- package/node/cloud-storage/operations/remove-dir/index.js +30 -9
- package/node/cloud-storage/operations/remove-file/index.d.ts +42 -1
- package/node/cloud-storage/operations/remove-file/index.js +30 -9
- package/node/cloud-storage/operations/stat-file/index.d.ts +40 -1
- package/node/cloud-storage/operations/stat-file/index.js +30 -9
- package/node/cloud-storage/operations/upload-file/index.d.ts +46 -1
- package/node/cloud-storage/operations/upload-file/index.js +30 -9
- package/node/encryption/@aes-256-gcm/buffer/index.d.ts +1 -1
- package/node/encryption/@aes-256-gcm/buffer/index.js +22 -6
- package/node/encryption/@aes-256-gcm/uint8-array/index.d.ts +1 -1
- package/node/encryption/@aes-256-gcm/uint8-array/index.js +3 -3
- package/node/encryption/key/index.js +12 -4
- package/node/files/is-in-directory/index.d.ts +7 -0
- package/node/files/is-in-directory/index.js +8 -4
- package/node/files/read-write/index.d.ts +48 -4
- package/node/files/read-write/index.js +15 -4
- package/node/files/subpaths/index.d.ts +62 -33
- package/node/files/subpaths/index.js +119 -5
- package/node/ftps/directory/copy-dir/index.d.ts +1 -1
- package/node/ftps/directory/copy-dir/index.js +3 -3
- package/node/ftps/directory/list/index.d.ts +1 -1
- package/node/ftps/directory/list/index.js +3 -3
- package/node/ftps/directory/move-dir/index.d.ts +1 -1
- package/node/ftps/directory/move-dir/index.js +3 -3
- package/node/ftps/directory/remove-dir/index.d.ts +1 -1
- package/node/ftps/directory/remove-dir/index.js +3 -3
- package/node/ftps/file/copy/index.d.ts +1 -1
- package/node/ftps/file/copy/index.js +3 -3
- package/node/ftps/file/download/index.d.ts +1 -1
- package/node/ftps/file/download/index.js +3 -3
- package/node/ftps/file/exists/index.d.ts +1 -1
- package/node/ftps/file/exists/index.js +3 -3
- package/node/ftps/file/move/index.d.ts +1 -1
- package/node/ftps/file/move/index.js +3 -3
- package/node/ftps/file/remove/index.d.ts +1 -1
- package/node/ftps/file/remove/index.js +3 -3
- package/node/ftps/file/stat/index.d.ts +1 -1
- package/node/ftps/file/stat/index.js +3 -3
- package/node/ftps/file/upload/index.d.ts +1 -1
- package/node/ftps/file/upload/index.js +3 -3
- package/node/images/create/index.d.ts +6 -0
- package/node/images/create/index.js +13 -18
- package/node/images/format/index.d.ts +36 -1
- package/node/images/format/index.js +241 -44
- package/node/images/metadata/index.d.ts +6 -0
- package/node/images/metadata/index.js +13 -18
- package/node/images/transform/index.d.ts +23 -1
- package/node/images/transform/index.js +199 -39
- package/node/images/transform/operations/blur/index.d.ts +1 -1
- package/node/images/transform/operations/blur/index.js +4 -4
- package/node/images/transform/operations/brighten/index.d.ts +1 -1
- package/node/images/transform/operations/brighten/index.js +4 -4
- package/node/images/transform/operations/extend/index.d.ts +1 -1
- package/node/images/transform/operations/extend/index.js +9 -19
- package/node/images/transform/operations/extract/index.d.ts +1 -1
- package/node/images/transform/operations/extract/index.js +4 -4
- package/node/images/transform/operations/flatten/index.d.ts +1 -1
- package/node/images/transform/operations/flatten/index.js +9 -19
- package/node/images/transform/operations/flip/index.js +1 -1
- package/node/images/transform/operations/flop/index.js +1 -1
- package/node/images/transform/operations/hue/index.d.ts +1 -1
- package/node/images/transform/operations/hue/index.js +4 -4
- package/node/images/transform/operations/level/index.d.ts +1 -1
- package/node/images/transform/operations/level/index.js +4 -4
- package/node/images/transform/operations/lighten/index.d.ts +1 -1
- package/node/images/transform/operations/lighten/index.js +4 -4
- package/node/images/transform/operations/normalize/index.d.ts +1 -1
- package/node/images/transform/operations/normalize/index.js +4 -4
- package/node/images/transform/operations/overlay/index.d.ts +1 -1
- package/node/images/transform/operations/overlay/index.js +9 -19
- package/node/images/transform/operations/resize/index.d.ts +1 -1
- package/node/images/transform/operations/resize/index.js +9 -19
- package/node/images/transform/operations/rotate/index.d.ts +1 -1
- package/node/images/transform/operations/rotate/index.js +9 -19
- package/node/images/transform/operations/saturate/index.d.ts +1 -1
- package/node/images/transform/operations/saturate/index.js +4 -4
- package/node/images/types.d.ts +136 -1
- package/node/images/types.js +2 -2
- package/node/images/utils/index.d.ts +20 -0
- package/node/images/utils/index.js +6 -16
- package/node/process/on-exit/index.d.ts +23 -0
- package/node/process/on-exit/index.js +25 -8
- package/node/process/prompt-continue/index.d.ts +18 -0
- package/node/process/prompt-continue/index.js +1680 -0
- package/node/process/spawner/index.d.ts +18 -0
- package/node/process/spawner/index.js +83 -0
- package/node/sftp/directory/copy-dir/index.d.ts +1 -1
- package/node/sftp/directory/copy-dir/index.js +3 -3
- package/node/sftp/directory/list/index.d.ts +1 -1
- package/node/sftp/directory/list/index.js +3 -3
- package/node/sftp/directory/move-dir/index.d.ts +1 -1
- package/node/sftp/directory/move-dir/index.js +3 -3
- package/node/sftp/directory/remove-dir/index.d.ts +1 -1
- package/node/sftp/directory/remove-dir/index.js +3 -3
- package/node/sftp/file/copy/index.d.ts +1 -1
- package/node/sftp/file/copy/index.js +3 -3
- package/node/sftp/file/download/index.d.ts +1 -1
- package/node/sftp/file/download/index.js +3 -3
- package/node/sftp/file/exists/index.d.ts +1 -1
- package/node/sftp/file/exists/index.js +3 -3
- package/node/sftp/file/move/index.d.ts +1 -1
- package/node/sftp/file/move/index.js +3 -3
- package/node/sftp/file/remove/index.d.ts +1 -1
- package/node/sftp/file/remove/index.js +3 -3
- package/node/sftp/file/stat/index.d.ts +1 -1
- package/node/sftp/file/stat/index.js +3 -3
- package/node/sftp/file/upload/index.d.ts +1 -1
- package/node/sftp/file/upload/index.js +3 -3
- package/package.json +11 -3
- package/agnostic/arrays/index.d.ts +0 -13
- package/agnostic/arrays/index.js +0 -21
- package/agnostic/booleans/index.d.ts +0 -8
- package/agnostic/booleans/index.js +0 -9
- package/agnostic/colors/index.d.ts +0 -14
- package/agnostic/colors/index.js +0 -107
- package/agnostic/css/bem/BEM.d.ts +0 -29
- package/agnostic/css/bem/getNamesArr.d.ts +0 -2
- package/agnostic/css/index.d.ts +0 -14
- package/agnostic/css/index.js +0 -25
- package/agnostic/errors/index.d.ts +0 -6
- package/agnostic/errors/index.js +0 -9
- package/agnostic/html/index.d.ts +0 -19
- package/agnostic/html/index.js +0 -39
- package/agnostic/html/sanitize/index.d.ts +0 -24
- package/agnostic/html/sanitize/index.js +0 -15
- package/agnostic/index.d.ts +0 -26
- package/agnostic/index.js +0 -144
- package/agnostic/misc/crossenv/index.d.ts +0 -8
- package/agnostic/misc/crossenv/index.js +0 -10
- package/agnostic/misc/crossenv/types/index.d.ts +0 -19
- package/agnostic/misc/crossenv/types/index.js +0 -7
- package/agnostic/misc/get-current-downlink/index.d.ts +0 -1
- package/agnostic/misc/get-current-downlink/index.js +0 -7
- package/agnostic/misc/index.d.ts +0 -25
- package/agnostic/misc/index.js +0 -65
- package/agnostic/misc/logs/index.d.ts +0 -17
- package/agnostic/misc/logs/index.js +0 -10
- package/agnostic/numbers/index.d.ts +0 -13
- package/agnostic/numbers/index.js +0 -12
- package/agnostic/objects/enums/index.d.ts +0 -4
- package/agnostic/objects/enums/index.js +0 -8
- package/agnostic/objects/index.d.ts +0 -19
- package/agnostic/objects/index.js +0 -19
- package/agnostic/optim/index.d.ts +0 -7
- package/agnostic/optim/index.js +0 -9
- package/agnostic/random/index.d.ts +0 -12
- package/agnostic/random/index.js +0 -10
- package/agnostic/sanitization/index.d.ts +0 -3
- package/agnostic/sanitization/index.js +0 -35
- package/agnostic/strings/index.d.ts +0 -19
- package/agnostic/strings/index.js +0 -15
- package/agnostic/time/dates/index.d.ts +0 -4
- package/agnostic/time/dates/index.js +0 -8
- package/agnostic/time/index.d.ts +0 -12
- package/agnostic/time/index.js +0 -30
- package/chunks/chunk-26T64AEI.js +0 -28
- package/chunks/chunk-34U4HX4V.js +0 -73
- package/chunks/chunk-3KZNRSDD.js +0 -112
- package/chunks/chunk-3USAHFOX.js +0 -31
- package/chunks/chunk-42K3MQQ5.js +0 -31
- package/chunks/chunk-45E3E4KW.js +0 -43
- package/chunks/chunk-4RPGLKRQ.js +0 -43
- package/chunks/chunk-536IRELM.js +0 -40
- package/chunks/chunk-5CTAKAIP.js +0 -28
- package/chunks/chunk-6KM4UT6T.js +0 -34
- package/chunks/chunk-6NYUQXJT.js +0 -109
- package/chunks/chunk-6RGDWX4A.js +0 -24
- package/chunks/chunk-6YQGM6N6.js +0 -19
- package/chunks/chunk-7AWTHZLY.js +0 -12
- package/chunks/chunk-7DBNMU6N.js +0 -14
- package/chunks/chunk-7YJ4BB73.js +0 -20
- package/chunks/chunk-A3CDUWGR.js +0 -73
- package/chunks/chunk-AL7ESVX4.js +0 -42
- package/chunks/chunk-ALAGBHFV.js +0 -42
- package/chunks/chunk-ANPXBD2G.js +0 -35
- package/chunks/chunk-AZD3VUWK.js +0 -84
- package/chunks/chunk-B43NYQDI.js +0 -16
- package/chunks/chunk-BDGFY3GP.js +0 -42
- package/chunks/chunk-BGSJ5XCH.js +0 -20
- package/chunks/chunk-BJAYUP7M.js +0 -13
- package/chunks/chunk-BLDUC7TT.js +0 -17
- package/chunks/chunk-COVPTTAD.js +0 -10
- package/chunks/chunk-DKITT7OT.js +0 -296
- package/chunks/chunk-EDVNAV3G.js +0 -72
- package/chunks/chunk-EGBJXHCW.js +0 -47
- package/chunks/chunk-EIIADR7E.js +0 -24
- package/chunks/chunk-ENMBK6H7.js +0 -162
- package/chunks/chunk-EUQFWLAH.js +0 -20
- package/chunks/chunk-F3WCF6DL.js +0 -122
- package/chunks/chunk-FEIKHYDQ.js +0 -20
- package/chunks/chunk-FHLCPVND.js +0 -23
- package/chunks/chunk-FPEW3A27.js +0 -14
- package/chunks/chunk-FR5H2OCV.js +0 -21
- package/chunks/chunk-FVFVKL54.js +0 -32
- package/chunks/chunk-FZOU4OAW.js +0 -13
- package/chunks/chunk-G4ZB72XY.js +0 -257
- package/chunks/chunk-G5RRNREY.js +0 -37
- package/chunks/chunk-GABKKGNI.js +0 -206
- package/chunks/chunk-GL42Q643.js +0 -42
- package/chunks/chunk-GTVOFJKO.js +0 -20
- package/chunks/chunk-HKTNK262.js +0 -23
- package/chunks/chunk-HWVEI3RH.js +0 -31
- package/chunks/chunk-IRTPQATN.js +0 -16
- package/chunks/chunk-JBSS64SA.js +0 -6
- package/chunks/chunk-JMU5PDBD.js +0 -20
- package/chunks/chunk-JQXNEJAP.js +0 -18
- package/chunks/chunk-JTJA7DGW.js +0 -36
- package/chunks/chunk-JWBDZPQG.js +0 -18
- package/chunks/chunk-JZ5MFJQB.js +0 -37
- package/chunks/chunk-KIONYWA7.js +0 -168
- package/chunks/chunk-KWQ4K4GN.js +0 -28
- package/chunks/chunk-KXIA3YGF.js +0 -54
- package/chunks/chunk-KXIEPXDI.js +0 -40
- package/chunks/chunk-L7PIZQFC.js +0 -51
- package/chunks/chunk-LEXQ6E6L.js +0 -31
- package/chunks/chunk-LV2VMOWR.js +0 -18
- package/chunks/chunk-MFIGSRSO.js +0 -103
- package/chunks/chunk-MJQF3YZO.js +0 -21
- package/chunks/chunk-MV473S2C.js +0 -28
- package/chunks/chunk-MVYH3CSJ.js +0 -42
- package/chunks/chunk-N4JGLSGA.js +0 -28
- package/chunks/chunk-NRITRUZW.js +0 -10
- package/chunks/chunk-OC4VIF3N.js +0 -42
- package/chunks/chunk-OJCVOSWP.js +0 -41
- package/chunks/chunk-OKCPVFQW.js +0 -56
- package/chunks/chunk-OKFZJ6DJ.js +0 -9
- package/chunks/chunk-PAIUCLVK.js +0 -35
- package/chunks/chunk-PU7NOIJB.js +0 -16
- package/chunks/chunk-PVRYR5KX.js +0 -21
- package/chunks/chunk-PWNX5TWJ.js +0 -60
- package/chunks/chunk-QCOO4PV5.js +0 -54
- package/chunks/chunk-QHAB6XYD.js +0 -30
- package/chunks/chunk-QHLQVR3E.js +0 -54
- package/chunks/chunk-QKE2IYT5.js +0 -42
- package/chunks/chunk-QVPS2BCJ.js +0 -29
- package/chunks/chunk-R4DZKWSR.js +0 -42
- package/chunks/chunk-RASMASS4.js +0 -111
- package/chunks/chunk-RLAZR3NL.js +0 -8
- package/chunks/chunk-RLJOYG64.js +0 -33
- package/chunks/chunk-S2NMAH7K.js +0 -19
- package/chunks/chunk-S32K7POB.js +0 -29
- package/chunks/chunk-SKBOSWM2.js +0 -35
- package/chunks/chunk-SKMCIFS3.js +0 -27
- package/chunks/chunk-SNJJII7A.js +0 -65
- package/chunks/chunk-STW5RKR7.js +0 -175
- package/chunks/chunk-TIER4TF4.js +0 -26
- package/chunks/chunk-UNXRB2AV.js +0 -16
- package/chunks/chunk-UXEKCYL7.js +0 -28
- package/chunks/chunk-VFJYLXCI.js +0 -23
- package/chunks/chunk-VJJIYJMY.js +0 -13
- package/chunks/chunk-VLC7LRED.js +0 -191
- package/chunks/chunk-VTPRO4NJ.js +0 -10
- package/chunks/chunk-VYW4IADX.js +0 -35
- package/chunks/chunk-VZDUZTW6.js +0 -113
- package/chunks/chunk-WAMSK4A3.js +0 -67
- package/chunks/chunk-WH6BPDAC.js +0 -17
- package/chunks/chunk-WOAYU6LB.js +0 -13
- package/chunks/chunk-WOYF3N4A.js +0 -31
- package/chunks/chunk-WSC3WODJ.js +0 -157
- package/chunks/chunk-WSFCRVEQ.js +0 -9
- package/chunks/chunk-X53BGT33.js +0 -42
- package/chunks/chunk-XB3EGDBI.js +0 -127
- package/chunks/chunk-XBA26Z7E.js +0 -42
- package/chunks/chunk-XPGAVZGK.js +0 -98
- package/chunks/chunk-XR2LNUGW.js +0 -42
- package/chunks/chunk-Y5GGIBPI.js +0 -31
- package/chunks/chunk-YKPA3MQL.js +0 -31
- package/chunks/chunk-YP64J65L.js +0 -17
- package/chunks/chunk-YPTFPS76.js +0 -91
- package/chunks/chunk-YQWZ3EP2.js +0 -60
- package/chunks/chunk-YS6WMSWC.js +0 -15
- package/chunks/chunk-YUP434IY.js +0 -43
- package/chunks/chunk-Z7ZDDBV5.js +0 -18
- package/chunks/chunk-ZBBU2P4D.js +0 -28
- package/chunks/chunk-ZLBSI4TR.js +0 -21
- package/chunks/chunk-ZMT6S52U.js +0 -40
- package/chunks/chunk-ZNA7SWFK.js +0 -29
- package/chunks/chunk-ZYTGT7AE.js +0 -20
- package/components/index.d.ts +0 -4
- package/components/index.js +0 -13
- package/node/@aws-s3/index.d.ts +0 -2
- package/node/@aws-s3/index.js +0 -23
- package/node/@aws-s3/storage/directory/index.d.ts +0 -5
- package/node/@aws-s3/storage/directory/index.js +0 -22
- package/node/@aws-s3/storage/file/index.d.ts +0 -8
- package/node/@aws-s3/storage/file/index.js +0 -34
- package/node/@aws-s3/storage/index.d.ts +0 -3
- package/node/@aws-s3/storage/index.js +0 -25
- package/node/@design-edito/thumbnails/index.js +0 -1
- package/node/@express/index.d.ts +0 -2
- package/node/@express/index.js +0 -10
- package/node/@google-cloud/index.d.ts +0 -2
- package/node/@google-cloud/index.js +0 -30
- package/node/@google-cloud/storage/bucket/index.d.ts +0 -5
- package/node/@google-cloud/storage/bucket/index.js +0 -22
- package/node/@google-cloud/storage/directory/index.d.ts +0 -5
- package/node/@google-cloud/storage/directory/index.js +0 -22
- package/node/@google-cloud/storage/file/index.d.ts +0 -13
- package/node/@google-cloud/storage/file/index.js +0 -54
- package/node/@google-cloud/storage/index.d.ts +0 -4
- package/node/@google-cloud/storage/index.js +0 -35
- package/node/cloud-storage/index.d.ts +0 -3
- package/node/cloud-storage/index.js +0 -69
- package/node/cloud-storage/operations/index.d.ts +0 -12
- package/node/cloud-storage/operations/index.js +0 -95
- package/node/encryption/@aes-256-gcm/index.d.ts +0 -3
- package/node/encryption/@aes-256-gcm/index.js +0 -14
- package/node/encryption/index.d.ts +0 -3
- package/node/encryption/index.js +0 -16
- package/node/files/index.d.ts +0 -7
- package/node/files/index.js +0 -15
- package/node/ftps/directory/index.d.ts +0 -5
- package/node/ftps/directory/index.js +0 -22
- package/node/ftps/file/index.d.ts +0 -8
- package/node/ftps/file/index.js +0 -34
- package/node/ftps/index.d.ts +0 -3
- package/node/ftps/index.js +0 -25
- package/node/images/index.d.ts +0 -6
- package/node/images/index.js +0 -59
- package/node/index.d.ts +0 -12
- package/node/index.js +0 -172
- package/node/process/index.d.ts +0 -6
- package/node/process/index.js +0 -16
- package/node/sftp/directory/index.d.ts +0 -5
- package/node/sftp/directory/index.js +0 -22
- package/node/sftp/file/index.d.ts +0 -8
- package/node/sftp/file/index.js +0 -34
- package/node/sftp/index.d.ts +0 -3
- package/node/sftp/index.js +0 -25
- package/shared/errors/index.d.ts +0 -138
- /package/{node/@design-edito/thumbnails/index.d.ts → agnostic/arrays/dedupe/index.test.d.ts} +0 -0
- /package/{shared/index.d.ts → agnostic/misc/data-size/types.js} +0 -0
|
@@ -1,30 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
array
|
|
3
|
+
} from "./chunk-USIYKRNX.js";
|
|
1
4
|
import {
|
|
2
5
|
nullFunc
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AKNR3U25.js";
|
|
4
7
|
import {
|
|
5
8
|
any
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
array
|
|
9
|
-
} from "./chunk-QAQZEKIF.js";
|
|
10
|
-
import {
|
|
11
|
-
Serialize
|
|
12
|
-
} from "./chunk-SXRWMH3U.js";
|
|
9
|
+
} from "./chunk-ZKIQ753F.js";
|
|
13
10
|
import {
|
|
14
11
|
Types
|
|
15
12
|
} from "./chunk-XEQ2PBT2.js";
|
|
16
13
|
import {
|
|
17
14
|
SmartTags
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HEY7J6GI.js";
|
|
16
|
+
import {
|
|
17
|
+
Serialize
|
|
18
|
+
} from "./chunk-DUCLFPGE.js";
|
|
19
19
|
import {
|
|
20
20
|
Transformer
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JVMFT3IT.js";
|
|
22
22
|
import {
|
|
23
23
|
Method
|
|
24
24
|
} from "./chunk-RW7VAKJW.js";
|
|
25
25
|
import {
|
|
26
26
|
insertNode
|
|
27
27
|
} from "./chunk-XA4HVHJ4.js";
|
|
28
|
+
import {
|
|
29
|
+
recordMap
|
|
30
|
+
} from "./chunk-XNF5MLCQ.js";
|
|
28
31
|
import {
|
|
29
32
|
isInEnum
|
|
30
33
|
} from "./chunk-E6MSDKON.js";
|
|
@@ -32,24 +35,23 @@ import {
|
|
|
32
35
|
isRecord
|
|
33
36
|
} from "./chunk-YDIBNEGA.js";
|
|
34
37
|
import {
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
trimEnd,
|
|
39
|
+
trimStart
|
|
40
|
+
} from "./chunk-6XL25OZX.js";
|
|
37
41
|
import {
|
|
38
42
|
replaceAll
|
|
39
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-EPUHVR7J.js";
|
|
40
44
|
import {
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
makeFailure,
|
|
46
|
+
makeSuccess,
|
|
47
|
+
outcome_exports
|
|
48
|
+
} from "./chunk-QEKI6WGQ.js";
|
|
43
49
|
import {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} from "./chunk-6XL25OZX.js";
|
|
50
|
+
get
|
|
51
|
+
} from "./chunk-ROWPCMQY.js";
|
|
47
52
|
import {
|
|
48
53
|
isNonNullObject
|
|
49
54
|
} from "./chunk-HQLRJ7XW.js";
|
|
50
|
-
import {
|
|
51
|
-
Window
|
|
52
|
-
} from "./chunk-RLJOYG64.js";
|
|
53
55
|
import {
|
|
54
56
|
unknownToString
|
|
55
57
|
} from "./chunk-FENXVJYO.js";
|
|
@@ -59,7 +61,7 @@ var Cast;
|
|
|
59
61
|
((Cast2) => {
|
|
60
62
|
Cast2.toNull = () => null;
|
|
61
63
|
Cast2.toBoolean = (input) => {
|
|
62
|
-
const { Text: Text2 } =
|
|
64
|
+
const { Text: Text2 } = get();
|
|
63
65
|
if (input === null) return false;
|
|
64
66
|
if (typeof input === "boolean") return input;
|
|
65
67
|
if (typeof input === "number") return input !== 0;
|
|
@@ -72,7 +74,7 @@ var Cast;
|
|
|
72
74
|
return true;
|
|
73
75
|
};
|
|
74
76
|
Cast2.toNumber = (input) => {
|
|
75
|
-
const { Text: Text2 } =
|
|
77
|
+
const { Text: Text2 } = get();
|
|
76
78
|
if (typeof input === "boolean") return input ? 1 : 0;
|
|
77
79
|
if (typeof input === "number") return input;
|
|
78
80
|
if (typeof input === "string") return parseFloat(`${input}`);
|
|
@@ -82,7 +84,7 @@ var Cast;
|
|
|
82
84
|
Cast2.toString = (input) => {
|
|
83
85
|
if (typeof input === "string") return input;
|
|
84
86
|
if (typeof input === "number" || typeof input === "boolean" || input === null) return `${input}`;
|
|
85
|
-
const { Element: Element2, Text: Text2, NodeList: NodeList2 } =
|
|
87
|
+
const { Element: Element2, Text: Text2, NodeList: NodeList2 } = get();
|
|
86
88
|
if (input instanceof Element2) return input.outerHTML;
|
|
87
89
|
if (input instanceof Text2) return input.textContent ?? "";
|
|
88
90
|
if (input instanceof NodeList2) return Array.from(input).map((e) => {
|
|
@@ -94,12 +96,12 @@ var Cast;
|
|
|
94
96
|
return `{${Object.entries(input).map(([key, val]) => `${key}:"${(0, Cast2.toString)(val)}"`).join(",")}}`;
|
|
95
97
|
};
|
|
96
98
|
Cast2.toText = (input) => {
|
|
97
|
-
const { Text: Text2, document } =
|
|
99
|
+
const { Text: Text2, document } = get();
|
|
98
100
|
if (input instanceof Text2) return input.cloneNode(true);
|
|
99
101
|
return document.createTextNode((0, Cast2.toString)(input));
|
|
100
102
|
};
|
|
101
103
|
Cast2.toElement = (input, tagName) => {
|
|
102
|
-
const { Element: Element2, Text: Text2, NodeList: NodeList2, document } =
|
|
104
|
+
const { Element: Element2, Text: Text2, NodeList: NodeList2, document } = get();
|
|
103
105
|
if (input instanceof Element2) return input.cloneNode(true);
|
|
104
106
|
const returned = document.createElement(tagName ?? "div");
|
|
105
107
|
if (input instanceof Text2) {
|
|
@@ -116,7 +118,7 @@ var Cast;
|
|
|
116
118
|
return returned;
|
|
117
119
|
};
|
|
118
120
|
Cast2.toNodeList = (input) => {
|
|
119
|
-
const { Element: Element2, Text: Text2, NodeList: NodeList2, document } =
|
|
121
|
+
const { Element: Element2, Text: Text2, NodeList: NodeList2, document } = get();
|
|
120
122
|
const parentDiv = document.createElement("div");
|
|
121
123
|
if (input instanceof NodeList2) {
|
|
122
124
|
parentDiv.append(...Array.from(input).map((i) => i.cloneNode(true)));
|
|
@@ -144,7 +146,7 @@ var Cast;
|
|
|
144
146
|
return parentDiv.childNodes;
|
|
145
147
|
};
|
|
146
148
|
Cast2.toArray = (input) => {
|
|
147
|
-
const { NodeList: NodeList2 } =
|
|
149
|
+
const { NodeList: NodeList2 } = get();
|
|
148
150
|
if (Array.isArray(input)) return [...input];
|
|
149
151
|
if (input instanceof NodeList2) return Array.from(input);
|
|
150
152
|
return [input];
|
|
@@ -165,31 +167,31 @@ var element = SmartTags.makeSmartTag({
|
|
|
165
167
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "null", "boolean", "number", "string", "text", "element", "nodelist"),
|
|
166
168
|
func: (main, args) => {
|
|
167
169
|
const tagName = Cast.toString(main).trim().toLowerCase();
|
|
168
|
-
const { document, NodeList: NodeList2 } =
|
|
170
|
+
const { document, NodeList: NodeList2 } = get();
|
|
169
171
|
const elt = document.createElement(tagName);
|
|
170
172
|
for (const argVal of args) {
|
|
171
173
|
if (argVal instanceof NodeList2) elt.append(...Array.from(argVal));
|
|
172
174
|
else if (argVal instanceof Element) elt.append(argVal);
|
|
173
175
|
else elt.append(Cast.toText(argVal));
|
|
174
176
|
}
|
|
175
|
-
return
|
|
177
|
+
return makeSuccess(elt);
|
|
176
178
|
}
|
|
177
179
|
});
|
|
178
180
|
|
|
179
181
|
// src/agnostic/html/hyper-json/smart-tags/isolated/get/index.ts
|
|
180
|
-
var
|
|
182
|
+
var get2 = SmartTags.makeSmartTag({
|
|
181
183
|
name: "get",
|
|
182
184
|
defaultMode: "isolation",
|
|
183
185
|
isolationInitType: "array",
|
|
184
186
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text"),
|
|
185
187
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
186
188
|
func: (main, _args, { sourceTree }) => {
|
|
187
|
-
const { makeSuccess, makeFailure } =
|
|
189
|
+
const { makeSuccess: makeSuccess2, makeFailure: makeFailure2 } = outcome_exports;
|
|
188
190
|
const { makeTransformationError } = Utils.SmartTags;
|
|
189
191
|
const strName = Cast.toString(main);
|
|
190
192
|
const found = sourceTree.getVariable(strName);
|
|
191
|
-
if (found === void 0) return
|
|
192
|
-
return
|
|
193
|
+
if (found === void 0) return makeFailure2(makeTransformationError(`No variable stored under the name '${strName}'`));
|
|
194
|
+
return makeSuccess2(found);
|
|
193
195
|
}
|
|
194
196
|
});
|
|
195
197
|
|
|
@@ -198,11 +200,11 @@ var global = SmartTags.makeSmartTag({
|
|
|
198
200
|
name: "global",
|
|
199
201
|
defaultMode: "isolation",
|
|
200
202
|
isolationInitType: "array",
|
|
201
|
-
mainValueCheck: (m) =>
|
|
203
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
202
204
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
203
205
|
func: (_m, _a, { sourceTree }) => {
|
|
204
206
|
const globalObject = sourceTree.options.globalObject ?? {};
|
|
205
|
-
return
|
|
207
|
+
return makeSuccess({ ...globalObject });
|
|
206
208
|
}
|
|
207
209
|
});
|
|
208
210
|
|
|
@@ -211,41 +213,41 @@ var guess = SmartTags.makeSmartTag({
|
|
|
211
213
|
name: "guess",
|
|
212
214
|
defaultMode: "isolation",
|
|
213
215
|
isolationInitType: "string",
|
|
214
|
-
mainValueCheck: (m) =>
|
|
215
|
-
argsValueCheck: (a) =>
|
|
216
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
217
|
+
argsValueCheck: (a) => makeSuccess(a),
|
|
216
218
|
func: (main, args) => {
|
|
217
219
|
const { typeCheck } = Utils.Tree.TypeChecks;
|
|
218
|
-
const { makeSuccess } =
|
|
220
|
+
const { makeSuccess: makeSuccess2 } = outcome_exports;
|
|
219
221
|
let coalesced = main;
|
|
220
222
|
for (const arg of args) coalesced = Utils.coalesceValues(coalesced, 0, arg);
|
|
221
|
-
const { Text: Text2, Element: Element2, document } =
|
|
222
|
-
if (typeof coalesced !== "string" && !(coalesced instanceof Text2)) return
|
|
223
|
+
const { Text: Text2, Element: Element2, document } = get();
|
|
224
|
+
if (typeof coalesced !== "string" && !(coalesced instanceof Text2)) return makeSuccess2(coalesced);
|
|
223
225
|
const strCoalesced = Cast.toString(coalesced);
|
|
224
|
-
if (strCoalesced.trim().toLowerCase() === "true") return
|
|
225
|
-
if (strCoalesced.trim().toLowerCase() === "false") return
|
|
226
|
-
if (strCoalesced.trim().toLowerCase().match(/^\s*-?\s*(\d+(\.\d*)?|\.\d+)\s*$/)) return
|
|
227
|
-
if (strCoalesced.trim().toLowerCase() === "null") return
|
|
226
|
+
if (strCoalesced.trim().toLowerCase() === "true") return makeSuccess2(true);
|
|
227
|
+
if (strCoalesced.trim().toLowerCase() === "false") return makeSuccess2(false);
|
|
228
|
+
if (strCoalesced.trim().toLowerCase().match(/^\s*-?\s*(\d+(\.\d*)?|\.\d+)\s*$/)) return makeSuccess2(parseFloat(strCoalesced));
|
|
229
|
+
if (strCoalesced.trim().toLowerCase() === "null") return makeSuccess2(null);
|
|
228
230
|
try {
|
|
229
231
|
const parsed = JSON.parse(strCoalesced);
|
|
230
232
|
const arrayChecked = typeCheck(parsed, "array");
|
|
231
233
|
const recordChecked = typeCheck(parsed, "record");
|
|
232
|
-
if (arrayChecked.success) return
|
|
233
|
-
if (recordChecked.success) return
|
|
234
|
+
if (arrayChecked.success) return makeSuccess2(arrayChecked.payload);
|
|
235
|
+
if (recordChecked.success) return makeSuccess2(recordChecked.payload);
|
|
234
236
|
} catch (err) {
|
|
235
237
|
}
|
|
236
238
|
const div = document.createElement("div");
|
|
237
239
|
div.innerHTML = strCoalesced;
|
|
238
240
|
const divChildren = div.childNodes;
|
|
239
|
-
if (divChildren.length === 0) return
|
|
241
|
+
if (divChildren.length === 0) return makeSuccess2(coalesced);
|
|
240
242
|
const validDivChildren = Cast.toNodeList(Array.from(divChildren).filter((e) => {
|
|
241
243
|
if (e instanceof Element2) return true;
|
|
242
244
|
if (e instanceof Text2) return true;
|
|
243
245
|
return false;
|
|
244
246
|
}));
|
|
245
|
-
if (validDivChildren.length > 1) return
|
|
247
|
+
if (validDivChildren.length > 1) return makeSuccess2(validDivChildren);
|
|
246
248
|
const validDivFirstchild = validDivChildren.item(0);
|
|
247
|
-
if (validDivChildren.length === 1 && validDivFirstchild instanceof Element2) return
|
|
248
|
-
return
|
|
249
|
+
if (validDivChildren.length === 1 && validDivFirstchild instanceof Element2) return makeSuccess2(validDivFirstchild);
|
|
250
|
+
return makeSuccess2(coalesced);
|
|
249
251
|
}
|
|
250
252
|
});
|
|
251
253
|
|
|
@@ -254,17 +256,17 @@ var nodelist = SmartTags.makeSmartTag({
|
|
|
254
256
|
name: "nodelist",
|
|
255
257
|
defaultMode: "isolation",
|
|
256
258
|
isolationInitType: "nodelist",
|
|
257
|
-
mainValueCheck: (m) =>
|
|
258
|
-
argsValueCheck: (a) =>
|
|
259
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
260
|
+
argsValueCheck: (a) => makeSuccess(a),
|
|
259
261
|
func: (main, args) => {
|
|
260
|
-
const { document } =
|
|
262
|
+
const { document } = get();
|
|
261
263
|
const returnedParent = document.createDocumentFragment();
|
|
262
264
|
returnedParent.append(
|
|
263
265
|
...Array.from(Cast.toNodeList(main)),
|
|
264
266
|
...Array.from(Cast.toNodeList(args))
|
|
265
267
|
);
|
|
266
268
|
const returned = returnedParent.childNodes;
|
|
267
|
-
return
|
|
269
|
+
return makeSuccess(returned);
|
|
268
270
|
}
|
|
269
271
|
});
|
|
270
272
|
|
|
@@ -280,7 +282,7 @@ var number = SmartTags.makeSmartTag({
|
|
|
280
282
|
const reduced = all.reduce((reduced2, curr) => {
|
|
281
283
|
return reduced2 + Cast.toNumber(curr);
|
|
282
284
|
}, 0);
|
|
283
|
-
return
|
|
285
|
+
return makeSuccess(reduced);
|
|
284
286
|
}
|
|
285
287
|
});
|
|
286
288
|
|
|
@@ -291,7 +293,7 @@ var record = SmartTags.makeSmartTag({
|
|
|
291
293
|
isolationInitType: "record",
|
|
292
294
|
mainValueCheck: (i) => Utils.Tree.TypeChecks.typeCheck(i, "record"),
|
|
293
295
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "record"),
|
|
294
|
-
func: (main, args) =>
|
|
296
|
+
func: (main, args) => makeSuccess(args.reduce((reduced, current) => ({
|
|
295
297
|
...reduced,
|
|
296
298
|
...current
|
|
297
299
|
}), main))
|
|
@@ -299,7 +301,7 @@ var record = SmartTags.makeSmartTag({
|
|
|
299
301
|
|
|
300
302
|
// src/agnostic/html/hyper-json/smart-tags/isolated/ref/index.ts
|
|
301
303
|
var func = (main, _args, { sourceTree }) => {
|
|
302
|
-
const { makeFailure, makeSuccess } =
|
|
304
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
303
305
|
const { makeTransformationError } = Utils.SmartTags;
|
|
304
306
|
const strMain = Cast.toString(main);
|
|
305
307
|
const resolveFrom = strMain.startsWith("/") ? sourceTree.root : sourceTree;
|
|
@@ -311,17 +313,17 @@ var func = (main, _args, { sourceTree }) => {
|
|
|
311
313
|
return parsed;
|
|
312
314
|
});
|
|
313
315
|
const resolved = resolveFrom.resolve(splitted);
|
|
314
|
-
if (resolved === void 0) return
|
|
315
|
-
if (resolved === sourceTree) return
|
|
316
|
-
if (resolved.parents.includes(sourceTree)) return
|
|
317
|
-
if (sourceTree.parents.includes(resolved)) return
|
|
316
|
+
if (resolved === void 0) return makeFailure2(makeTransformationError(`No value was found at path: ${strMain}`));
|
|
317
|
+
if (resolved === sourceTree) return makeFailure2(makeTransformationError("A ref node cannot reference itself."));
|
|
318
|
+
if (resolved.parents.includes(sourceTree)) return makeFailure2(makeTransformationError("A ref node cannot reference one of its parents."));
|
|
319
|
+
if (sourceTree.parents.includes(resolved)) return makeFailure2(makeTransformationError("A ref node cannot reference one of its children."));
|
|
318
320
|
const evaluated = resolved.evaluate();
|
|
319
321
|
const { getType } = Utils.Tree.TypeChecks;
|
|
320
322
|
if (getType(evaluated) === "transformer") {
|
|
321
323
|
const transformer = evaluated;
|
|
322
|
-
return
|
|
324
|
+
return makeSuccess2(transformer.toMethod());
|
|
323
325
|
}
|
|
324
|
-
return
|
|
326
|
+
return makeSuccess2(evaluated);
|
|
325
327
|
};
|
|
326
328
|
var ref = SmartTags.makeSmartTag({
|
|
327
329
|
name: "ref",
|
|
@@ -344,7 +346,7 @@ var string = SmartTags.makeSmartTag({
|
|
|
344
346
|
const reduced = all.reduce((reduced2, curr) => {
|
|
345
347
|
return `${reduced2}${Cast.toString(curr)}`;
|
|
346
348
|
}, "");
|
|
347
|
-
return
|
|
349
|
+
return makeSuccess(reduced);
|
|
348
350
|
}
|
|
349
351
|
});
|
|
350
352
|
|
|
@@ -360,7 +362,7 @@ var text = SmartTags.makeSmartTag({
|
|
|
360
362
|
const reduced = all.reduce((reduced2, curr) => {
|
|
361
363
|
return Cast.toText(`${reduced2}${Cast.toText(curr)}`);
|
|
362
364
|
}, Cast.toText(""));
|
|
363
|
-
return
|
|
365
|
+
return makeSuccess(reduced);
|
|
364
366
|
}
|
|
365
367
|
});
|
|
366
368
|
|
|
@@ -374,7 +376,7 @@ var add = SmartTags.makeSmartTag({
|
|
|
374
376
|
func: (main, args) => {
|
|
375
377
|
const numMain = Cast.toNumber(main);
|
|
376
378
|
const numArgs = args.map(Cast.toNumber);
|
|
377
|
-
return
|
|
379
|
+
return makeSuccess(numArgs.reduce((reduced, arg) => reduced + arg, numMain));
|
|
378
380
|
}
|
|
379
381
|
});
|
|
380
382
|
|
|
@@ -386,10 +388,10 @@ var addclass = SmartTags.makeSmartTag({
|
|
|
386
388
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "element", "nodelist"),
|
|
387
389
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
|
388
390
|
func: (main, args) => {
|
|
389
|
-
const { Element: Element2, document } =
|
|
391
|
+
const { Element: Element2, document } = get();
|
|
390
392
|
if (main instanceof Element2) {
|
|
391
393
|
main.classList.add(...args.map((arg) => Cast.toString(arg)));
|
|
392
|
-
return
|
|
394
|
+
return makeSuccess(main);
|
|
393
395
|
}
|
|
394
396
|
const children = Array.from(main).map((child) => {
|
|
395
397
|
if (child instanceof Element2) {
|
|
@@ -401,7 +403,7 @@ var addclass = SmartTags.makeSmartTag({
|
|
|
401
403
|
const frag = document.createDocumentFragment();
|
|
402
404
|
frag.append(...children);
|
|
403
405
|
const nodelist2 = frag.childNodes;
|
|
404
|
-
return
|
|
406
|
+
return makeSuccess(nodelist2);
|
|
405
407
|
}
|
|
406
408
|
});
|
|
407
409
|
|
|
@@ -410,12 +412,12 @@ var and = SmartTags.makeSmartTag({
|
|
|
410
412
|
name: "and",
|
|
411
413
|
defaultMode: "coalescion",
|
|
412
414
|
isolationInitType: "array",
|
|
413
|
-
mainValueCheck: (m) =>
|
|
414
|
-
argsValueCheck: (a) =>
|
|
415
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
416
|
+
argsValueCheck: (a) => makeSuccess(a),
|
|
415
417
|
func: (main, args) => {
|
|
416
418
|
const all = [main, ...args];
|
|
417
419
|
const returned = all.every(Cast.toBoolean);
|
|
418
|
-
return
|
|
420
|
+
return makeSuccess(returned);
|
|
419
421
|
}
|
|
420
422
|
});
|
|
421
423
|
|
|
@@ -427,12 +429,12 @@ var append = SmartTags.makeSmartTag({
|
|
|
427
429
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text", "nodelist", "element", "array"),
|
|
428
430
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text", "nodelist", "element", "array"),
|
|
429
431
|
func: (main, args) => {
|
|
430
|
-
const { makeSuccess } =
|
|
431
|
-
const { Text: Text2, Element: Element2, NodeList: NodeList2, document } =
|
|
432
|
-
if (Array.isArray(main)) return
|
|
432
|
+
const { makeSuccess: makeSuccess2 } = outcome_exports;
|
|
433
|
+
const { Text: Text2, Element: Element2, NodeList: NodeList2, document } = get();
|
|
434
|
+
if (Array.isArray(main)) return makeSuccess2([...main, ...args]);
|
|
433
435
|
if (main instanceof Element2) {
|
|
434
436
|
main.append(...Array.from(Cast.toNodeList(args)));
|
|
435
|
-
return
|
|
437
|
+
return makeSuccess2(main);
|
|
436
438
|
}
|
|
437
439
|
if (main instanceof NodeList2) {
|
|
438
440
|
const frag = document.createDocumentFragment();
|
|
@@ -440,15 +442,15 @@ var append = SmartTags.makeSmartTag({
|
|
|
440
442
|
...Array.from(main),
|
|
441
443
|
...Array.from(Cast.toNodeList(args))
|
|
442
444
|
);
|
|
443
|
-
return
|
|
445
|
+
return makeSuccess2(frag.childNodes);
|
|
444
446
|
}
|
|
445
447
|
if (main instanceof Text2) {
|
|
446
448
|
const reducedString = args.reduce((reduced, arg) => {
|
|
447
449
|
return `${reduced}${Cast.toString(arg)}`;
|
|
448
450
|
}, Cast.toString(main));
|
|
449
|
-
return
|
|
451
|
+
return makeSuccess2(Cast.toText(reducedString));
|
|
450
452
|
}
|
|
451
|
-
return
|
|
453
|
+
return makeSuccess2(args.reduce((reduced, arg) => {
|
|
452
454
|
return `${reduced}${Cast.toString(arg)}`;
|
|
453
455
|
}, main));
|
|
454
456
|
}
|
|
@@ -461,33 +463,33 @@ var at = SmartTags.makeSmartTag({
|
|
|
461
463
|
isolationInitType: "array",
|
|
462
464
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text", "array", "nodelist"),
|
|
463
465
|
argsValueCheck: (a) => {
|
|
464
|
-
const { makeFailure, makeSuccess } =
|
|
466
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
465
467
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
466
468
|
const { getType, typeCheckMany } = Utils.Tree.TypeChecks;
|
|
467
|
-
if (a.length === 0) return
|
|
468
|
-
if (a.length > 1) return
|
|
469
|
+
if (a.length === 0) return makeFailure2(makeArgsValueError("number | string | text", "undefined", 0));
|
|
470
|
+
if (a.length > 1) return makeFailure2(makeArgsValueError("undefined", getType(a[1]) ?? "undefined", 1));
|
|
469
471
|
const checked = typeCheckMany(a, "number", "string", "text");
|
|
470
|
-
if (checked.success) return
|
|
472
|
+
if (checked.success) return makeSuccess2(a);
|
|
471
473
|
return checked;
|
|
472
474
|
},
|
|
473
475
|
func: (main, args) => {
|
|
474
|
-
const { makeFailure, makeSuccess } =
|
|
476
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
475
477
|
const { makeTransformationError } = Utils.SmartTags;
|
|
476
478
|
const pos = args[0];
|
|
477
479
|
const numPos = Cast.toNumber(pos);
|
|
478
480
|
let found;
|
|
479
|
-
const { NodeList: NodeList2 } =
|
|
481
|
+
const { NodeList: NodeList2 } = get();
|
|
480
482
|
if (typeof main === "string" || Array.isArray(main) || main instanceof NodeList2) {
|
|
481
483
|
found = main[numPos];
|
|
482
484
|
} else {
|
|
483
485
|
const strMain = Cast.toString(main);
|
|
484
486
|
found = strMain[numPos];
|
|
485
487
|
}
|
|
486
|
-
if (found === void 0) return
|
|
488
|
+
if (found === void 0) return makeFailure2(makeTransformationError({
|
|
487
489
|
message: "Property does not exist"
|
|
488
490
|
// [WIP] maybe more details here ?
|
|
489
491
|
}));
|
|
490
|
-
return
|
|
492
|
+
return makeSuccess2(found);
|
|
491
493
|
}
|
|
492
494
|
});
|
|
493
495
|
|
|
@@ -497,24 +499,24 @@ var call = SmartTags.makeSmartTag({
|
|
|
497
499
|
defaultMode: "coalescion",
|
|
498
500
|
isolationInitType: "array",
|
|
499
501
|
mainValueCheck: (m) => {
|
|
500
|
-
const { makeFailure } =
|
|
502
|
+
const { makeFailure: makeFailure2 } = outcome_exports;
|
|
501
503
|
const { typeCheck, typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
|
502
504
|
const { makeMainValueError } = Utils.SmartTags;
|
|
503
505
|
const isMethodCheck = typeCheck(m, "method");
|
|
504
506
|
if (isMethodCheck.success) return isMethodCheck;
|
|
505
|
-
if (!Array.isArray(m)) return
|
|
507
|
+
if (!Array.isArray(m)) return makeFailure2({
|
|
506
508
|
expected: "method[]",
|
|
507
509
|
found: getType(m) ?? "undefined"
|
|
508
510
|
});
|
|
509
511
|
const isMethodsArrayCheck = typeCheckMany(m, "method");
|
|
510
512
|
if (isMethodsArrayCheck.success) return isMethodsArrayCheck;
|
|
511
|
-
return
|
|
513
|
+
return makeFailure2(makeMainValueError("method | method[]", getType(m) ?? "undefined"));
|
|
512
514
|
},
|
|
513
515
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "array"),
|
|
514
516
|
func: (main, args) => {
|
|
515
|
-
const { makeFailure, makeSuccess } =
|
|
517
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
516
518
|
const { makeTransformationError } = Utils.SmartTags;
|
|
517
|
-
return
|
|
519
|
+
return makeFailure2(makeTransformationError({
|
|
518
520
|
message: "This smart tag should not be used."
|
|
519
521
|
}));
|
|
520
522
|
}
|
|
@@ -525,9 +527,9 @@ var clone = SmartTags.makeSmartTag({
|
|
|
525
527
|
name: "clone",
|
|
526
528
|
defaultMode: "coalescion",
|
|
527
529
|
isolationInitType: "array",
|
|
528
|
-
mainValueCheck: (m) =>
|
|
530
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
529
531
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
530
|
-
func: (main) =>
|
|
532
|
+
func: (main) => makeSuccess(Utils.clone(main))
|
|
531
533
|
});
|
|
532
534
|
|
|
533
535
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.ts
|
|
@@ -538,7 +540,7 @@ var deleteproperties = SmartTags.makeSmartTag({
|
|
|
538
540
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
|
539
541
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
|
540
542
|
func: (main, args) => {
|
|
541
|
-
const { makeFailure, makeSuccess } =
|
|
543
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
542
544
|
const { makeTransformationError } = Utils.SmartTags;
|
|
543
545
|
let returned = Utils.clone(main);
|
|
544
546
|
for (const arg of args) {
|
|
@@ -546,10 +548,10 @@ var deleteproperties = SmartTags.makeSmartTag({
|
|
|
546
548
|
try {
|
|
547
549
|
returned = deepDeleteProperty(returned, strArg);
|
|
548
550
|
} catch (err) {
|
|
549
|
-
return
|
|
551
|
+
return makeFailure2(makeTransformationError(`Cannot access ${strArg} from input record`));
|
|
550
552
|
}
|
|
551
553
|
}
|
|
552
|
-
return
|
|
554
|
+
return makeSuccess2(returned);
|
|
553
555
|
}
|
|
554
556
|
});
|
|
555
557
|
function deepDeleteProperty(record2, pathString) {
|
|
@@ -573,22 +575,22 @@ var equals = SmartTags.makeSmartTag({
|
|
|
573
575
|
name: "equals",
|
|
574
576
|
defaultMode: "coalescion",
|
|
575
577
|
isolationInitType: "array",
|
|
576
|
-
mainValueCheck: (m) =>
|
|
578
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
577
579
|
argsValueCheck: (a) => {
|
|
578
580
|
const [first, ...others] = a;
|
|
579
|
-
if (first === void 0) return
|
|
581
|
+
if (first === void 0) return makeFailure(Utils.SmartTags.makeArgsValueError(
|
|
580
582
|
"value",
|
|
581
583
|
"undefined",
|
|
582
584
|
0
|
|
583
585
|
));
|
|
584
586
|
const returned = [first, ...others];
|
|
585
|
-
return
|
|
587
|
+
return makeSuccess(returned);
|
|
586
588
|
},
|
|
587
589
|
func: (main, args) => {
|
|
588
|
-
const { Text: Text2 } =
|
|
590
|
+
const { Text: Text2 } = get();
|
|
589
591
|
const normalizedMain = main instanceof Text2 ? Cast.toString(main) : main;
|
|
590
592
|
const normalizedArgs = args.map((a) => a instanceof Text2 ? Cast.toString(a) : a);
|
|
591
|
-
return
|
|
593
|
+
return makeSuccess(normalizedArgs.every((arg) => arg === normalizedMain));
|
|
592
594
|
}
|
|
593
595
|
});
|
|
594
596
|
|
|
@@ -599,19 +601,19 @@ var getattribute = SmartTags.makeSmartTag({
|
|
|
599
601
|
isolationInitType: "array",
|
|
600
602
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "element"),
|
|
601
603
|
argsValueCheck: (a) => {
|
|
602
|
-
const { makeFailure, makeSuccess } =
|
|
604
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
603
605
|
const { typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
|
604
606
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
605
|
-
if (a.length === 0) return
|
|
606
|
-
if (a.length > 1) return
|
|
607
|
+
if (a.length === 0) return makeFailure2(makeArgsValueError("string | Text", "undefined", 0));
|
|
608
|
+
if (a.length > 1) return makeFailure2(makeArgsValueError("undefined", getType(a[2]) ?? "undefined", 1));
|
|
607
609
|
const checked = typeCheckMany(a, "string", "text");
|
|
608
|
-
if (checked.success) return
|
|
610
|
+
if (checked.success) return makeSuccess2(checked.payload);
|
|
609
611
|
return checked;
|
|
610
612
|
},
|
|
611
613
|
func: (main, args) => {
|
|
612
614
|
const name = Cast.toString(args[0]);
|
|
613
615
|
const found = main.getAttribute(name);
|
|
614
|
-
return
|
|
616
|
+
return makeSuccess(found);
|
|
615
617
|
}
|
|
616
618
|
});
|
|
617
619
|
|
|
@@ -629,7 +631,7 @@ var getproperties = SmartTags.makeSmartTag({
|
|
|
629
631
|
if (val === void 0) return { ...reduced2 };
|
|
630
632
|
return { ...reduced2, [key]: val };
|
|
631
633
|
}, {});
|
|
632
|
-
return
|
|
634
|
+
return makeSuccess(reduced);
|
|
633
635
|
}
|
|
634
636
|
});
|
|
635
637
|
|
|
@@ -640,28 +642,28 @@ var getproperty = SmartTags.makeSmartTag({
|
|
|
640
642
|
isolationInitType: "array",
|
|
641
643
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
|
642
644
|
argsValueCheck: (a) => {
|
|
643
|
-
const { makeFailure, makeSuccess } =
|
|
645
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
644
646
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
645
647
|
const { getType, typeCheckMany } = Utils.Tree.TypeChecks;
|
|
646
|
-
if (a.length === 0) return
|
|
647
|
-
if (a.length !== 1) return
|
|
648
|
+
if (a.length === 0) return makeFailure2(makeArgsValueError("string | Text", "undefined", 0));
|
|
649
|
+
if (a.length !== 1) return makeFailure2(makeArgsValueError("undefined", getType(a.at(1)) ?? "undefined", 1));
|
|
648
650
|
const checked = typeCheckMany(a, "string", "text");
|
|
649
651
|
if (!checked.success) return checked;
|
|
650
|
-
return
|
|
652
|
+
return makeSuccess2(checked.payload);
|
|
651
653
|
},
|
|
652
654
|
func: (main, args) => {
|
|
653
655
|
const { getType } = Utils.Tree.TypeChecks;
|
|
654
656
|
const { makeTransformationError } = Utils.SmartTags;
|
|
655
|
-
const { makeFailure, makeSuccess } =
|
|
657
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
656
658
|
const [propName] = args;
|
|
657
659
|
const strPropName = Cast.toString(propName);
|
|
658
660
|
try {
|
|
659
661
|
const found = deepGetProperty(main, strPropName);
|
|
660
662
|
const foundType = getType(found);
|
|
661
|
-
if (foundType !== "transformer") return
|
|
662
|
-
return
|
|
663
|
+
if (foundType !== "transformer") return makeSuccess2(found);
|
|
664
|
+
return makeFailure2(makeTransformationError(`Forbidden access to key: '${strPropName}'`));
|
|
663
665
|
} catch (err) {
|
|
664
|
-
return
|
|
666
|
+
return makeFailure2(makeTransformationError(`Impossible to access ${strPropName}`));
|
|
665
667
|
}
|
|
666
668
|
}
|
|
667
669
|
});
|
|
@@ -689,7 +691,7 @@ var textItemSymbol = "%%-hyperjson-text-%%";
|
|
|
689
691
|
var nodelistItemSymbol = "%%-hyperjson-nodelist-%%";
|
|
690
692
|
var elementItemSymbol = "%%-hyperjson-element-%%";
|
|
691
693
|
function stringify(val) {
|
|
692
|
-
const { Text: Text2, Element: Element2, NodeList: NodeList2 } =
|
|
694
|
+
const { Text: Text2, Element: Element2, NodeList: NodeList2 } = get();
|
|
693
695
|
if (typeof val === "string" || typeof val === "number" || typeof val === "boolean" || val === null) return JSON.stringify(val);
|
|
694
696
|
if (val instanceof Text2) return JSON.stringify(`${textItemSymbol}${val.textContent}`);
|
|
695
697
|
if (val instanceof Element2) return JSON.stringify(`${elementItemSymbol}${val.outerHTML}`);
|
|
@@ -707,7 +709,7 @@ function stringify(val) {
|
|
|
707
709
|
);
|
|
708
710
|
}
|
|
709
711
|
function parse(val) {
|
|
710
|
-
const { document } =
|
|
712
|
+
const { document } = get();
|
|
711
713
|
const jsonParsed = JSON.parse(val);
|
|
712
714
|
if (typeof jsonParsed === "number" || typeof jsonParsed === "boolean" || jsonParsed === null) return jsonParsed;
|
|
713
715
|
if (Array.isArray(jsonParsed)) return jsonParsed.map((e) => typeof e === "string" ? parse(e) : e);
|
|
@@ -739,11 +741,11 @@ var hjstringify = SmartTags.makeSmartTag({
|
|
|
739
741
|
name: "hjstringify",
|
|
740
742
|
defaultMode: "coalescion",
|
|
741
743
|
isolationInitType: "array",
|
|
742
|
-
mainValueCheck: (m) =>
|
|
744
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
743
745
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
744
746
|
func: (main) => {
|
|
745
747
|
const stringified = stringify(main);
|
|
746
|
-
return
|
|
748
|
+
return makeSuccess(stringified);
|
|
747
749
|
}
|
|
748
750
|
});
|
|
749
751
|
|
|
@@ -757,9 +759,9 @@ var hjparse = SmartTags.makeSmartTag({
|
|
|
757
759
|
func: (main) => {
|
|
758
760
|
try {
|
|
759
761
|
const parsed = parse(`${main}`);
|
|
760
|
-
return
|
|
762
|
+
return makeSuccess(parsed);
|
|
761
763
|
} catch (err) {
|
|
762
|
-
return
|
|
764
|
+
return makeFailure({
|
|
763
765
|
details: unknownToString(err)
|
|
764
766
|
});
|
|
765
767
|
}
|
|
@@ -773,15 +775,15 @@ var ifFunc = SmartTags.makeSmartTag({
|
|
|
773
775
|
isolationInitType: "array",
|
|
774
776
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "boolean"),
|
|
775
777
|
argsValueCheck: (a) => {
|
|
776
|
-
const { makeFailure, makeSuccess } =
|
|
778
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
777
779
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
778
|
-
if (a.length > 2) return
|
|
779
|
-
if (a.length < 2) return
|
|
780
|
-
return
|
|
780
|
+
if (a.length > 2) return makeFailure2(makeArgsValueError("value", "undefined", a.length));
|
|
781
|
+
if (a.length < 2) return makeFailure2(makeArgsValueError("undefined", "value", 2));
|
|
782
|
+
return makeSuccess2(a);
|
|
781
783
|
},
|
|
782
784
|
func: (main, args) => {
|
|
783
785
|
const [then, otherwise] = args;
|
|
784
|
-
return
|
|
786
|
+
return makeSuccess(main ? then : otherwise);
|
|
785
787
|
}
|
|
786
788
|
});
|
|
787
789
|
|
|
@@ -790,29 +792,29 @@ var initialize = SmartTags.makeSmartTag({
|
|
|
790
792
|
name: "initialize",
|
|
791
793
|
defaultMode: "coalescion",
|
|
792
794
|
isolationInitType: "array",
|
|
793
|
-
mainValueCheck: (m) =>
|
|
795
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
794
796
|
argsValueCheck: (a) => {
|
|
795
|
-
const { makeFailure, makeSuccess } =
|
|
797
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
796
798
|
const { getType, typeCheck } = Utils.Tree.TypeChecks;
|
|
797
799
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
798
800
|
const first = a[0];
|
|
799
|
-
if (first === void 0) return
|
|
800
|
-
if (a.length > 1) return
|
|
801
|
+
if (first === void 0) return makeFailure2(makeArgsValueError("string | text", "undefined", 0));
|
|
802
|
+
if (a.length > 1) return makeFailure2(makeArgsValueError("undefined", getType(a[1]) ?? "undefined", 1));
|
|
801
803
|
const firstChecked = typeCheck(first, "string", "text");
|
|
802
|
-
if (!firstChecked.success) return
|
|
803
|
-
return
|
|
804
|
+
if (!firstChecked.success) return makeFailure2(makeArgsValueError(firstChecked.error.expected, firstChecked.error.found, 0));
|
|
805
|
+
return makeSuccess2(a);
|
|
804
806
|
},
|
|
805
807
|
func: (_main, args) => {
|
|
806
|
-
const { makeFailure, makeSuccess } =
|
|
808
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
807
809
|
const { makeTransformationError } = Utils.SmartTags;
|
|
808
810
|
const { getInitialValueFromTypeName } = Utils.Tree;
|
|
809
811
|
const { isValueTypeName } = Utils.Tree.TypeChecks;
|
|
810
812
|
const firstArg = args[0];
|
|
811
813
|
const strFirstArg = Cast.toString(firstArg).trim().toLowerCase();
|
|
812
814
|
const isValueType = isValueTypeName(strFirstArg);
|
|
813
|
-
if (!isValueType || strFirstArg === "transformer" || strFirstArg === "method") return
|
|
815
|
+
if (!isValueType || strFirstArg === "transformer" || strFirstArg === "method") return makeFailure2(makeTransformationError(`${strFirstArg} is not a valid type`));
|
|
814
816
|
const initialized = getInitialValueFromTypeName(strFirstArg);
|
|
815
|
-
return
|
|
817
|
+
return makeSuccess2(initialized);
|
|
816
818
|
}
|
|
817
819
|
});
|
|
818
820
|
|
|
@@ -824,10 +826,10 @@ var join = SmartTags.makeSmartTag({
|
|
|
824
826
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "array", "nodelist"),
|
|
825
827
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
|
826
828
|
func: (main, args) => {
|
|
827
|
-
const { makeSuccess } =
|
|
829
|
+
const { makeSuccess: makeSuccess2 } = outcome_exports;
|
|
828
830
|
const joiner = Cast.toString(args);
|
|
829
|
-
if (Array.isArray(main)) return
|
|
830
|
-
return
|
|
831
|
+
if (Array.isArray(main)) return makeSuccess2(main.map(Cast.toString).join(joiner));
|
|
832
|
+
return makeSuccess2(Array.from(main).map(Cast.toString).join(joiner));
|
|
831
833
|
}
|
|
832
834
|
});
|
|
833
835
|
|
|
@@ -839,11 +841,11 @@ var length = SmartTags.makeSmartTag({
|
|
|
839
841
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "nodelist"),
|
|
840
842
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
841
843
|
func: (main) => {
|
|
842
|
-
const { makeSuccess } =
|
|
843
|
-
const { Text: Text2, NodeList: NodeList2, Element: Element2 } =
|
|
844
|
-
if (typeof main === "string" || main instanceof NodeList2 || main instanceof Text2 || Array.isArray(main)) return
|
|
845
|
-
if (main instanceof Element2) return
|
|
846
|
-
return
|
|
844
|
+
const { makeSuccess: makeSuccess2 } = outcome_exports;
|
|
845
|
+
const { Text: Text2, NodeList: NodeList2, Element: Element2 } = get();
|
|
846
|
+
if (typeof main === "string" || main instanceof NodeList2 || main instanceof Text2 || Array.isArray(main)) return makeSuccess2(main.length);
|
|
847
|
+
if (main instanceof Element2) return makeSuccess2(main.childNodes.length);
|
|
848
|
+
return makeSuccess2(Object.keys(main).length);
|
|
847
849
|
}
|
|
848
850
|
});
|
|
849
851
|
|
|
@@ -862,7 +864,7 @@ var map = SmartTags.makeSmartTag({
|
|
|
862
864
|
for (const arg of args) {
|
|
863
865
|
const { transformer } = arg;
|
|
864
866
|
const applied = transformer.apply(reduced);
|
|
865
|
-
if (!applied.success) return
|
|
867
|
+
if (!applied.success) return makeFailure(makeTransformationError({
|
|
866
868
|
message: "Subtransformation failure.",
|
|
867
869
|
onTransformed: reduced,
|
|
868
870
|
transformerAt: args.indexOf(arg),
|
|
@@ -874,7 +876,7 @@ var map = SmartTags.makeSmartTag({
|
|
|
874
876
|
}
|
|
875
877
|
mapped.push(reduced);
|
|
876
878
|
}
|
|
877
|
-
return
|
|
879
|
+
return makeSuccess(mapped);
|
|
878
880
|
}
|
|
879
881
|
});
|
|
880
882
|
|
|
@@ -885,7 +887,7 @@ var negate = SmartTags.makeSmartTag({
|
|
|
885
887
|
isolationInitType: "array",
|
|
886
888
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "boolean"),
|
|
887
889
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
888
|
-
func: (main) =>
|
|
890
|
+
func: (main) => makeSuccess(!main)
|
|
889
891
|
});
|
|
890
892
|
|
|
891
893
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.ts
|
|
@@ -895,19 +897,19 @@ var notrailing = SmartTags.makeSmartTag({
|
|
|
895
897
|
isolationInitType: "array",
|
|
896
898
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text"),
|
|
897
899
|
argsValueCheck: (a) => {
|
|
898
|
-
const { makeSuccess, makeFailure } =
|
|
900
|
+
const { makeSuccess: makeSuccess2, makeFailure: makeFailure2 } = outcome_exports;
|
|
899
901
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
900
902
|
const { getType, typeCheck } = Utils.Tree.TypeChecks;
|
|
901
|
-
if (a.length === 0) return
|
|
902
|
-
if (a.length > 1) return
|
|
903
|
+
if (a.length === 0) return makeSuccess2([]);
|
|
904
|
+
if (a.length > 1) return makeFailure2(makeArgsValueError("undefined", getType(a[1]) ?? "undefined", 1));
|
|
903
905
|
const [first] = a;
|
|
904
906
|
const firstChecked = typeCheck(first, "string", "text");
|
|
905
|
-
if (!firstChecked.success) return
|
|
907
|
+
if (!firstChecked.success) return makeFailure2(makeArgsValueError(
|
|
906
908
|
firstChecked.error.expected,
|
|
907
909
|
firstChecked.error.found,
|
|
908
910
|
0
|
|
909
911
|
));
|
|
910
|
-
return
|
|
912
|
+
return makeSuccess2([firstChecked.payload]);
|
|
911
913
|
},
|
|
912
914
|
func: (main, args) => {
|
|
913
915
|
const strMain = Cast.toString(main);
|
|
@@ -915,8 +917,8 @@ var notrailing = SmartTags.makeSmartTag({
|
|
|
915
917
|
const strFirstArg = Cast.toString(firstArg ?? "/");
|
|
916
918
|
let strOutput = strMain;
|
|
917
919
|
while (strOutput.endsWith(strFirstArg)) strOutput = strOutput.slice(0, -1);
|
|
918
|
-
if (typeof main === "string") return
|
|
919
|
-
return
|
|
920
|
+
if (typeof main === "string") return makeSuccess(strOutput);
|
|
921
|
+
return makeSuccess(Cast.toText(strOutput));
|
|
920
922
|
}
|
|
921
923
|
});
|
|
922
924
|
|
|
@@ -925,12 +927,12 @@ var or = SmartTags.makeSmartTag({
|
|
|
925
927
|
name: "or",
|
|
926
928
|
defaultMode: "coalescion",
|
|
927
929
|
isolationInitType: "array",
|
|
928
|
-
mainValueCheck: (m) =>
|
|
929
|
-
argsValueCheck: (a) =>
|
|
930
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
931
|
+
argsValueCheck: (a) => makeSuccess(a),
|
|
930
932
|
func: (main, args) => {
|
|
931
933
|
const all = [main, ...args];
|
|
932
934
|
const returned = all.some(Cast.toBoolean);
|
|
933
|
-
return
|
|
935
|
+
return makeSuccess(returned);
|
|
934
936
|
}
|
|
935
937
|
});
|
|
936
938
|
|
|
@@ -942,12 +944,12 @@ var pickrandom = SmartTags.makeSmartTag({
|
|
|
942
944
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "array"),
|
|
943
945
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
944
946
|
func: (main) => {
|
|
945
|
-
const { makeSuccess, makeFailure } =
|
|
947
|
+
const { makeSuccess: makeSuccess2, makeFailure: makeFailure2 } = outcome_exports;
|
|
946
948
|
const { makeTransformationError } = Utils.SmartTags;
|
|
947
949
|
const pos = Math.floor(Math.random() * main.length);
|
|
948
950
|
const found = main[pos];
|
|
949
|
-
if (found === void 0) return
|
|
950
|
-
return
|
|
951
|
+
if (found === void 0) return makeFailure2(makeTransformationError("Cannot pick inside empty array"));
|
|
952
|
+
return makeSuccess2(found);
|
|
951
953
|
}
|
|
952
954
|
});
|
|
953
955
|
|
|
@@ -958,18 +960,18 @@ var print = SmartTags.makeSmartTag({
|
|
|
958
960
|
isolationInitType: "array",
|
|
959
961
|
mainValueCheck: (m) => {
|
|
960
962
|
const { getType } = Utils.Tree.TypeChecks;
|
|
961
|
-
const { makeSuccess, makeFailure } =
|
|
963
|
+
const { makeSuccess: makeSuccess2, makeFailure: makeFailure2 } = outcome_exports;
|
|
962
964
|
const { makeMainValueError } = Utils.SmartTags;
|
|
963
|
-
return getType(m) === "transformer" ?
|
|
965
|
+
return getType(m) === "transformer" ? makeFailure2(makeMainValueError("Exclude<value, transformer>", "transformer")) : makeSuccess2(m);
|
|
964
966
|
},
|
|
965
|
-
argsValueCheck: (a) =>
|
|
967
|
+
argsValueCheck: (a) => makeSuccess(a),
|
|
966
968
|
func: (main, args, details) => {
|
|
967
969
|
console.group("print");
|
|
968
970
|
console.log("Main:", main);
|
|
969
971
|
console.log("Args:", ...args);
|
|
970
972
|
console.log("Tree:", details.sourceTree);
|
|
971
973
|
console.groupEnd();
|
|
972
|
-
return
|
|
974
|
+
return makeSuccess(main);
|
|
973
975
|
}
|
|
974
976
|
});
|
|
975
977
|
|
|
@@ -981,17 +983,17 @@ var populate = SmartTags.makeSmartTag({
|
|
|
981
983
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
|
982
984
|
argsValueCheck: (a) => {
|
|
983
985
|
const [first, ...others] = a;
|
|
984
|
-
const { makeFailure, makeSuccess } =
|
|
986
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
985
987
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
986
988
|
const { typeCheck, typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
|
987
989
|
const firstChecked = typeCheck(first, "string", "text", "nodelist", "element");
|
|
988
|
-
if (!firstChecked.success) return
|
|
990
|
+
if (!firstChecked.success) return makeFailure2(makeArgsValueError(
|
|
989
991
|
firstChecked.error.expected,
|
|
990
992
|
firstChecked.error.found,
|
|
991
993
|
0
|
|
992
994
|
));
|
|
993
995
|
const othersChecked = typeCheckMany(others, "array");
|
|
994
|
-
if (!othersChecked.success) return
|
|
996
|
+
if (!othersChecked.success) return makeFailure2(makeArgsValueError(
|
|
995
997
|
othersChecked.error.expected,
|
|
996
998
|
othersChecked.error.found,
|
|
997
999
|
othersChecked.error.position + 1
|
|
@@ -1001,16 +1003,16 @@ var populate = SmartTags.makeSmartTag({
|
|
|
1001
1003
|
const [first2, second] = arg;
|
|
1002
1004
|
const firstChecked2 = typeCheck(first2, "string", "text");
|
|
1003
1005
|
const secondChecked = typeCheck(second, "string", "text");
|
|
1004
|
-
if (!firstChecked2.success || !secondChecked.success) return
|
|
1006
|
+
if (!firstChecked2.success || !secondChecked.success) return makeFailure2(makeArgsValueError(
|
|
1005
1007
|
"[string | Text, string | Text]",
|
|
1006
1008
|
`[${getType(first2)}, ${getType(second)}]`,
|
|
1007
1009
|
argPosNum + 1
|
|
1008
1010
|
));
|
|
1009
1011
|
}
|
|
1010
|
-
return
|
|
1012
|
+
return makeSuccess2(a);
|
|
1011
1013
|
},
|
|
1012
1014
|
func: (main, args) => {
|
|
1013
|
-
const { makeSuccess, makeFailure } =
|
|
1015
|
+
const { makeSuccess: makeSuccess2, makeFailure: makeFailure2 } = outcome_exports;
|
|
1014
1016
|
const { makeTransformationError } = Utils.SmartTags;
|
|
1015
1017
|
const record2 = main;
|
|
1016
1018
|
const [template, ...actions] = args;
|
|
@@ -1021,17 +1023,17 @@ var populate = SmartTags.makeSmartTag({
|
|
|
1021
1023
|
const replaced = replaceAll(returnedStr, Cast.toString(toReplace), Cast.toString(value));
|
|
1022
1024
|
returnedStr = replaced;
|
|
1023
1025
|
} catch (err) {
|
|
1024
|
-
return
|
|
1026
|
+
return makeFailure2(makeTransformationError({
|
|
1025
1027
|
message: "Something went wrong",
|
|
1026
1028
|
subTransformerError: err
|
|
1027
1029
|
}));
|
|
1028
1030
|
}
|
|
1029
1031
|
}
|
|
1030
|
-
const { Text: Text2, NodeList: NodeList2 } =
|
|
1031
|
-
if (typeof template === "string") return
|
|
1032
|
-
if (template instanceof Text2) return
|
|
1033
|
-
if (template instanceof NodeList2) return
|
|
1034
|
-
return
|
|
1032
|
+
const { Text: Text2, NodeList: NodeList2 } = get();
|
|
1033
|
+
if (typeof template === "string") return makeSuccess2(returnedStr);
|
|
1034
|
+
if (template instanceof Text2) return makeSuccess2(Cast.toText(returnedStr));
|
|
1035
|
+
if (template instanceof NodeList2) return makeSuccess2(Cast.toNodeList(returnedStr));
|
|
1036
|
+
return makeSuccess2(Cast.toElement(returnedStr));
|
|
1035
1037
|
}
|
|
1036
1038
|
});
|
|
1037
1039
|
|
|
@@ -1041,8 +1043,8 @@ var push = SmartTags.makeSmartTag({
|
|
|
1041
1043
|
defaultMode: "coalescion",
|
|
1042
1044
|
isolationInitType: "array",
|
|
1043
1045
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "array"),
|
|
1044
|
-
argsValueCheck: (a) =>
|
|
1045
|
-
func: (main, args) =>
|
|
1046
|
+
argsValueCheck: (a) => makeSuccess(a),
|
|
1047
|
+
func: (main, args) => makeSuccess([...main, ...args])
|
|
1046
1048
|
});
|
|
1047
1049
|
|
|
1048
1050
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.ts
|
|
@@ -1052,26 +1054,26 @@ var pusheach = SmartTags.makeSmartTag({
|
|
|
1052
1054
|
isolationInitType: "array",
|
|
1053
1055
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "array"),
|
|
1054
1056
|
argsValueCheck: (a) => {
|
|
1055
|
-
const { makeSuccess, makeFailure } =
|
|
1057
|
+
const { makeSuccess: makeSuccess2, makeFailure: makeFailure2 } = outcome_exports;
|
|
1056
1058
|
const { typeCheck } = Utils.Tree.TypeChecks;
|
|
1057
1059
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
1058
1060
|
for (const [argPos, arg] of Object.entries(a)) {
|
|
1059
1061
|
const numPos = parseInt(argPos);
|
|
1060
1062
|
const checked = typeCheck(arg, "array");
|
|
1061
|
-
if (!checked.success) return
|
|
1063
|
+
if (!checked.success) return makeFailure2(makeArgsValueError(
|
|
1062
1064
|
checked.error.expected,
|
|
1063
1065
|
checked.error.found,
|
|
1064
1066
|
numPos
|
|
1065
1067
|
));
|
|
1066
1068
|
}
|
|
1067
|
-
return
|
|
1069
|
+
return makeSuccess2(a);
|
|
1068
1070
|
},
|
|
1069
1071
|
func: (main, args) => {
|
|
1070
1072
|
const returned = [...main];
|
|
1071
1073
|
for (const arg of args) {
|
|
1072
1074
|
returned.push(...arg);
|
|
1073
1075
|
}
|
|
1074
|
-
return
|
|
1076
|
+
return makeSuccess(returned);
|
|
1075
1077
|
}
|
|
1076
1078
|
});
|
|
1077
1079
|
|
|
@@ -1082,7 +1084,7 @@ var recordtoarray = SmartTags.makeSmartTag({
|
|
|
1082
1084
|
isolationInitType: "array",
|
|
1083
1085
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
|
1084
1086
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
1085
|
-
func: (main) =>
|
|
1087
|
+
func: (main) => makeSuccess(Object.values(main))
|
|
1086
1088
|
});
|
|
1087
1089
|
|
|
1088
1090
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.ts
|
|
@@ -1096,19 +1098,19 @@ var removeattribute = SmartTags.makeSmartTag({
|
|
|
1096
1098
|
return typeCheck(m, "element", "nodelist");
|
|
1097
1099
|
},
|
|
1098
1100
|
argsValueCheck: (a) => {
|
|
1099
|
-
const { makeFailure, makeSuccess } =
|
|
1101
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1100
1102
|
const { typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
|
1101
1103
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
1102
|
-
if (a.length === 0) return
|
|
1103
|
-
if (a.length > 1) return
|
|
1104
|
+
if (a.length === 0) return makeFailure2(makeArgsValueError("string | Text", "undefined", 0));
|
|
1105
|
+
if (a.length > 1) return makeFailure2(makeArgsValueError("undefined", getType(a[2]) ?? "undefined", 1));
|
|
1104
1106
|
const checked = typeCheckMany(a, "string", "text");
|
|
1105
|
-
if (checked.success) return
|
|
1107
|
+
if (checked.success) return makeSuccess2(checked.payload);
|
|
1106
1108
|
return checked;
|
|
1107
1109
|
},
|
|
1108
1110
|
func: (main, args) => {
|
|
1109
1111
|
const argsStr = args.map((e) => Cast.toString(e));
|
|
1110
1112
|
const [name] = argsStr;
|
|
1111
|
-
const { Element: Element2, NodeList: NodeList2, document } =
|
|
1113
|
+
const { Element: Element2, NodeList: NodeList2, document } = get();
|
|
1112
1114
|
if (main instanceof NodeList2) {
|
|
1113
1115
|
const children = Array.from(main).map((child) => {
|
|
1114
1116
|
const cloned = Utils.clone(child);
|
|
@@ -1118,13 +1120,13 @@ var removeattribute = SmartTags.makeSmartTag({
|
|
|
1118
1120
|
const frag = document.createDocumentFragment();
|
|
1119
1121
|
frag.append(...children);
|
|
1120
1122
|
const nodelist2 = frag.childNodes;
|
|
1121
|
-
return
|
|
1123
|
+
return makeSuccess(nodelist2);
|
|
1122
1124
|
} else {
|
|
1123
1125
|
const mainArr = Array.isArray(main) ? main : [main];
|
|
1124
1126
|
const mainArrCloned = mainArr.map((e) => Utils.clone(e));
|
|
1125
1127
|
mainArrCloned.forEach((e) => e.removeAttribute(name));
|
|
1126
|
-
if (Array.isArray(main)) return
|
|
1127
|
-
return
|
|
1128
|
+
if (Array.isArray(main)) return makeSuccess(mainArrCloned);
|
|
1129
|
+
return makeSuccess(mainArrCloned[0]);
|
|
1128
1130
|
}
|
|
1129
1131
|
}
|
|
1130
1132
|
});
|
|
@@ -1137,10 +1139,10 @@ var removeclass = SmartTags.makeSmartTag({
|
|
|
1137
1139
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "element", "nodelist"),
|
|
1138
1140
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
|
1139
1141
|
func: (main, args) => {
|
|
1140
|
-
const { Element: Element2, document } =
|
|
1142
|
+
const { Element: Element2, document } = get();
|
|
1141
1143
|
if (main instanceof Element2) {
|
|
1142
1144
|
main.classList.remove(...args.map((arg) => Cast.toString(arg)));
|
|
1143
|
-
return
|
|
1145
|
+
return makeSuccess(main);
|
|
1144
1146
|
}
|
|
1145
1147
|
const children = Array.from(main).map((child) => {
|
|
1146
1148
|
if (child instanceof Element2) {
|
|
@@ -1152,7 +1154,7 @@ var removeclass = SmartTags.makeSmartTag({
|
|
|
1152
1154
|
const frag = document.createDocumentFragment();
|
|
1153
1155
|
frag.append(...children);
|
|
1154
1156
|
const nodelist2 = frag.childNodes;
|
|
1155
|
-
return
|
|
1157
|
+
return makeSuccess(nodelist2);
|
|
1156
1158
|
}
|
|
1157
1159
|
});
|
|
1158
1160
|
|
|
@@ -1163,24 +1165,24 @@ var renameproperty = SmartTags.makeSmartTag({
|
|
|
1163
1165
|
isolationInitType: "array",
|
|
1164
1166
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
|
1165
1167
|
argsValueCheck: (a) => {
|
|
1166
|
-
const { makeFailure, makeSuccess } =
|
|
1168
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1167
1169
|
const { typeCheck, typeCheckMany } = Utils.Tree.TypeChecks;
|
|
1168
1170
|
const checked = typeCheckMany(a, "string", "text");
|
|
1169
1171
|
if (!checked.success) return checked;
|
|
1170
1172
|
const [first, second] = a;
|
|
1171
1173
|
const firstChecked = typeCheck(first, "string", "text");
|
|
1172
|
-
if (!firstChecked.success) return
|
|
1174
|
+
if (!firstChecked.success) return makeFailure2(Utils.SmartTags.makeArgsValueError(
|
|
1173
1175
|
firstChecked.error.expected,
|
|
1174
1176
|
firstChecked.error.found,
|
|
1175
1177
|
0
|
|
1176
1178
|
));
|
|
1177
1179
|
const secondChecked = typeCheck(second, "string", "text");
|
|
1178
|
-
if (!secondChecked.success) return
|
|
1180
|
+
if (!secondChecked.success) return makeFailure2(Utils.SmartTags.makeArgsValueError(
|
|
1179
1181
|
secondChecked.error.expected,
|
|
1180
1182
|
secondChecked.error.found,
|
|
1181
1183
|
0
|
|
1182
1184
|
));
|
|
1183
|
-
return
|
|
1185
|
+
return makeSuccess2([firstChecked.payload, secondChecked.payload]);
|
|
1184
1186
|
},
|
|
1185
1187
|
func: (main, args) => {
|
|
1186
1188
|
const [oldKey, newKey] = args.map(Cast.toString);
|
|
@@ -1189,7 +1191,7 @@ var renameproperty = SmartTags.makeSmartTag({
|
|
|
1189
1191
|
const targetKey = key === oldKey ? newKey : key;
|
|
1190
1192
|
returned[targetKey] = value;
|
|
1191
1193
|
});
|
|
1192
|
-
return
|
|
1194
|
+
return makeSuccess(returned);
|
|
1193
1195
|
}
|
|
1194
1196
|
});
|
|
1195
1197
|
|
|
@@ -1198,22 +1200,22 @@ var replace = SmartTags.makeSmartTag({
|
|
|
1198
1200
|
name: "replace",
|
|
1199
1201
|
defaultMode: "coalescion",
|
|
1200
1202
|
isolationInitType: "array",
|
|
1201
|
-
mainValueCheck: (m) =>
|
|
1203
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1202
1204
|
argsValueCheck: (a) => {
|
|
1203
|
-
const { makeFailure, makeSuccess } =
|
|
1205
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1204
1206
|
const { getType, typeCheckMany } = Utils.Tree.TypeChecks;
|
|
1205
1207
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
1206
1208
|
const expectedStr = "string | Text | NodeListOf<Element | Text> | Element";
|
|
1207
|
-
if (a.length === 0) return
|
|
1208
|
-
if (a.length === 1) return
|
|
1209
|
-
if (a.length > 2) return
|
|
1209
|
+
if (a.length === 0) return makeFailure2(makeArgsValueError(expectedStr, "undefined", 0));
|
|
1210
|
+
if (a.length === 1) return makeFailure2(makeArgsValueError(expectedStr, "undefined", 1));
|
|
1211
|
+
if (a.length > 2) return makeFailure2(makeArgsValueError("undefined", getType(a.at(2)) ?? "undefined", 3));
|
|
1210
1212
|
const checked = typeCheckMany(a, "string", "text", "nodelist", "element");
|
|
1211
1213
|
if (!checked.success) return checked;
|
|
1212
|
-
return
|
|
1214
|
+
return makeSuccess2(checked.payload);
|
|
1213
1215
|
},
|
|
1214
1216
|
func: (main, args) => {
|
|
1215
1217
|
const [toReplace, replacer] = args;
|
|
1216
|
-
return
|
|
1218
|
+
return makeSuccess(
|
|
1217
1219
|
replacerFunc(
|
|
1218
1220
|
main,
|
|
1219
1221
|
Cast.toString(toReplace),
|
|
@@ -1224,11 +1226,11 @@ var replace = SmartTags.makeSmartTag({
|
|
|
1224
1226
|
});
|
|
1225
1227
|
function replacerFunc(value, toReplace, replacer) {
|
|
1226
1228
|
if (typeof value === "number" || typeof value === "boolean" || value === null || value instanceof Method) return value;
|
|
1227
|
-
if (typeof value === "string") return replaceAll(
|
|
1228
|
-
const { Text: Text2, Element: Element2, NodeList: NodeList2 } =
|
|
1229
|
-
if (value instanceof Text2) return Cast.toText(
|
|
1230
|
-
if (value instanceof Element2) return Cast.toElement(
|
|
1231
|
-
if (value instanceof NodeList2) return Cast.toNodeList(
|
|
1229
|
+
if (typeof value === "string") return value.replaceAll(toReplace, replacer);
|
|
1230
|
+
const { Text: Text2, Element: Element2, NodeList: NodeList2 } = get();
|
|
1231
|
+
if (value instanceof Text2) return Cast.toText(Cast.toString(value).replaceAll(toReplace, replacer));
|
|
1232
|
+
if (value instanceof Element2) return Cast.toElement(Cast.toString(value).replaceAll(toReplace, replacer));
|
|
1233
|
+
if (value instanceof NodeList2) return Cast.toNodeList(Cast.toString(value).replaceAll(toReplace, replacer));
|
|
1232
1234
|
if (Array.isArray(value)) return value.map((val) => replacerFunc(val, toReplace, replacer));
|
|
1233
1235
|
return Object.entries(value).reduce((acc, [key, val]) => ({
|
|
1234
1236
|
...acc,
|
|
@@ -1244,7 +1246,7 @@ var select = SmartTags.makeSmartTag({
|
|
|
1244
1246
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "nodelist", "element"),
|
|
1245
1247
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
|
1246
1248
|
func: (main, args) => {
|
|
1247
|
-
const { document, Element: Element2 } =
|
|
1249
|
+
const { document, Element: Element2 } = get();
|
|
1248
1250
|
const selectedFragment = document.createDocumentFragment();
|
|
1249
1251
|
if (main instanceof Element2) {
|
|
1250
1252
|
for (const arg of args) {
|
|
@@ -1262,7 +1264,7 @@ var select = SmartTags.makeSmartTag({
|
|
|
1262
1264
|
}
|
|
1263
1265
|
}
|
|
1264
1266
|
const selected = selectedFragment.childNodes;
|
|
1265
|
-
return
|
|
1267
|
+
return makeSuccess(selected);
|
|
1266
1268
|
}
|
|
1267
1269
|
});
|
|
1268
1270
|
|
|
@@ -1271,23 +1273,23 @@ var set = SmartTags.makeSmartTag({
|
|
|
1271
1273
|
name: "set",
|
|
1272
1274
|
defaultMode: "coalescion",
|
|
1273
1275
|
isolationInitType: "array",
|
|
1274
|
-
mainValueCheck: (m) =>
|
|
1276
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1275
1277
|
argsValueCheck: (a) => {
|
|
1276
|
-
const { makeFailure, makeSuccess } =
|
|
1278
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1277
1279
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
1278
1280
|
const { getType, typeCheck } = Utils.Tree.TypeChecks;
|
|
1279
1281
|
const first = a[0];
|
|
1280
|
-
if (first === void 0) return
|
|
1281
|
-
if (a.length > 2) return
|
|
1282
|
+
if (first === void 0) return makeFailure2(makeArgsValueError("string | text", "undefined", 0));
|
|
1283
|
+
if (a.length > 2) return makeFailure2(makeArgsValueError("undefined", getType(a[2]) ?? "undefined", 2));
|
|
1282
1284
|
const firstChecked = typeCheck(first, "string", "text");
|
|
1283
1285
|
if (!firstChecked.success) return firstChecked;
|
|
1284
|
-
else return
|
|
1286
|
+
else return makeSuccess2(a);
|
|
1285
1287
|
},
|
|
1286
1288
|
func: (main, args, { sourceTree }) => {
|
|
1287
1289
|
const [first, second] = args;
|
|
1288
1290
|
const strFirst = Cast.toString(first);
|
|
1289
1291
|
sourceTree.setVariable(strFirst, second === void 0 ? main : second);
|
|
1290
|
-
return
|
|
1292
|
+
return makeSuccess(main);
|
|
1291
1293
|
}
|
|
1292
1294
|
});
|
|
1293
1295
|
|
|
@@ -1302,20 +1304,20 @@ var setattribute = SmartTags.makeSmartTag({
|
|
|
1302
1304
|
return typeCheck(m, "element", "nodelist");
|
|
1303
1305
|
},
|
|
1304
1306
|
argsValueCheck: (a) => {
|
|
1305
|
-
const { makeFailure, makeSuccess } =
|
|
1307
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1306
1308
|
const { typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
|
1307
1309
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
1308
|
-
if (a.length === 0) return
|
|
1309
|
-
if (a.length > 2) return
|
|
1310
|
+
if (a.length === 0) return makeFailure2(makeArgsValueError("string | Text", "undefined", 0));
|
|
1311
|
+
if (a.length > 2) return makeFailure2(makeArgsValueError("undefined", getType(a[2]) ?? "undefined", 2));
|
|
1310
1312
|
const checked = typeCheckMany(a, "string", "text");
|
|
1311
|
-
if (checked.success) return
|
|
1313
|
+
if (checked.success) return makeSuccess2(checked.payload);
|
|
1312
1314
|
return checked;
|
|
1313
1315
|
},
|
|
1314
1316
|
func: (main, args) => {
|
|
1315
1317
|
const argsStr = args.map((e) => Cast.toString(e));
|
|
1316
1318
|
const [name, value = ""] = argsStr;
|
|
1317
1319
|
if (main instanceof NodeList) {
|
|
1318
|
-
const { document } =
|
|
1320
|
+
const { document } = get();
|
|
1319
1321
|
const children = Array.from(main).map((child) => {
|
|
1320
1322
|
const cloned = Utils.clone(child);
|
|
1321
1323
|
if (cloned instanceof Element) cloned.setAttribute(name, value);
|
|
@@ -1324,13 +1326,13 @@ var setattribute = SmartTags.makeSmartTag({
|
|
|
1324
1326
|
const frag = document.createDocumentFragment();
|
|
1325
1327
|
frag.append(...children);
|
|
1326
1328
|
const nodelist2 = frag.childNodes;
|
|
1327
|
-
return
|
|
1329
|
+
return makeSuccess(nodelist2);
|
|
1328
1330
|
} else {
|
|
1329
1331
|
const mainArr = Array.isArray(main) ? main : [main];
|
|
1330
1332
|
const mainArrCloned = mainArr.map((e) => Utils.clone(e));
|
|
1331
1333
|
mainArrCloned.forEach((e) => e.setAttribute(name, value));
|
|
1332
|
-
if (Array.isArray(main)) return
|
|
1333
|
-
return
|
|
1334
|
+
if (Array.isArray(main)) return makeSuccess(mainArrCloned);
|
|
1335
|
+
return makeSuccess(mainArrCloned[0]);
|
|
1334
1336
|
}
|
|
1335
1337
|
}
|
|
1336
1338
|
});
|
|
@@ -1353,20 +1355,20 @@ var setproperty = SmartTags.makeSmartTag({
|
|
|
1353
1355
|
"array"
|
|
1354
1356
|
),
|
|
1355
1357
|
argsValueCheck: (a) => {
|
|
1356
|
-
const { makeFailure, makeSuccess } =
|
|
1358
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1357
1359
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
1358
1360
|
const { getType, typeCheck } = Utils.Tree.TypeChecks;
|
|
1359
|
-
if (a.length === 0) return
|
|
1360
|
-
if (a.length === 1) return
|
|
1361
|
-
if (a.length !== 2) return
|
|
1361
|
+
if (a.length === 0) return makeFailure2(makeArgsValueError("string | Text", "undefined", 0));
|
|
1362
|
+
if (a.length === 1) return makeFailure2(makeArgsValueError("value", "undefined", 1));
|
|
1363
|
+
if (a.length !== 2) return makeFailure2(makeArgsValueError("undefined", getType(a.at(2)) ?? "undefined", 2));
|
|
1362
1364
|
const [first, second] = a;
|
|
1363
1365
|
const firstChecked = typeCheck(first, "string", "text");
|
|
1364
|
-
if (!firstChecked.success) return
|
|
1365
|
-
return
|
|
1366
|
+
if (!firstChecked.success) return makeFailure2(makeArgsValueError(firstChecked.error.expected, firstChecked.error.found, 0));
|
|
1367
|
+
return makeSuccess2([firstChecked.payload, second]);
|
|
1366
1368
|
},
|
|
1367
1369
|
func: (main, args) => {
|
|
1368
1370
|
const [key, val] = args;
|
|
1369
|
-
const { makeSuccess, makeFailure } =
|
|
1371
|
+
const { makeSuccess: makeSuccess2, makeFailure: makeFailure2 } = outcome_exports;
|
|
1370
1372
|
const { makeTransformationError } = Utils.SmartTags;
|
|
1371
1373
|
try {
|
|
1372
1374
|
const withPropertySet = deepSetProperty(
|
|
@@ -1374,9 +1376,9 @@ var setproperty = SmartTags.makeSmartTag({
|
|
|
1374
1376
|
Cast.toString(key),
|
|
1375
1377
|
val
|
|
1376
1378
|
);
|
|
1377
|
-
return
|
|
1379
|
+
return makeSuccess2(withPropertySet);
|
|
1378
1380
|
} catch (err) {
|
|
1379
|
-
return
|
|
1381
|
+
return makeFailure2(makeTransformationError(`Impossible to access property :${key}`));
|
|
1380
1382
|
}
|
|
1381
1383
|
}
|
|
1382
1384
|
});
|
|
@@ -1386,7 +1388,7 @@ function deepSetProperty(input, pathString, value) {
|
|
|
1386
1388
|
let currentItemParent = void 0;
|
|
1387
1389
|
let currentItemPathFromParent = void 0;
|
|
1388
1390
|
let currentItem = clone2;
|
|
1389
|
-
const { Text: Text2, Element: Element2, NodeList: NodeList2, document } =
|
|
1391
|
+
const { Text: Text2, Element: Element2, NodeList: NodeList2, document } = get();
|
|
1390
1392
|
pathChunks.forEach((chunk, pos) => {
|
|
1391
1393
|
const isLast = pos === pathChunks.length - 1;
|
|
1392
1394
|
const numChunk = parseInt(chunk);
|
|
@@ -1507,26 +1509,26 @@ var sorton = SmartTags.makeSmartTag({
|
|
|
1507
1509
|
mainValueCheck: (m) => {
|
|
1508
1510
|
const { makeMainValueError } = Utils.SmartTags;
|
|
1509
1511
|
const { getType } = Utils.Tree.TypeChecks;
|
|
1510
|
-
const { makeFailure, makeSuccess } =
|
|
1511
|
-
if (!Array.isArray(m)) return
|
|
1512
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1513
|
+
if (!Array.isArray(m)) return makeFailure2(makeMainValueError("array<record>", getType(m) ?? "undefined"));
|
|
1512
1514
|
for (const [itemPos, itemVal] of Object.entries(m)) {
|
|
1513
1515
|
if (isRecord(itemVal)) continue;
|
|
1514
|
-
return
|
|
1516
|
+
return makeFailure2(makeMainValueError("record", getType(itemVal), `At position ${parseInt(itemPos)} in main value`));
|
|
1515
1517
|
}
|
|
1516
|
-
return
|
|
1518
|
+
return makeSuccess2(m);
|
|
1517
1519
|
},
|
|
1518
1520
|
argsValueCheck: (a) => {
|
|
1519
|
-
const { makeFailure, makeSuccess } =
|
|
1521
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1520
1522
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
1521
1523
|
const { getType, typeCheckMany } = Utils.Tree.TypeChecks;
|
|
1522
|
-
if (a.length === 0) return
|
|
1523
|
-
if (a.length > 1) return
|
|
1524
|
+
if (a.length === 0) return makeFailure2(makeArgsValueError("[string | text]", "[]", 0));
|
|
1525
|
+
if (a.length > 1) return makeFailure2(makeArgsValueError("undefined", getType(a[1]) ?? "undefined", 2));
|
|
1524
1526
|
const checked = typeCheckMany(a, "string", "text");
|
|
1525
|
-
if (checked.success) return
|
|
1527
|
+
if (checked.success) return makeSuccess2(checked.payload);
|
|
1526
1528
|
return checked;
|
|
1527
1529
|
},
|
|
1528
1530
|
func: (main, args) => {
|
|
1529
|
-
const { makeFailure, makeSuccess } =
|
|
1531
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1530
1532
|
const strPropName = Cast.toString(args[0]);
|
|
1531
1533
|
const { getType } = Utils.Tree.TypeChecks;
|
|
1532
1534
|
const { makeTransformationError } = Utils.SmartTags;
|
|
@@ -1536,15 +1538,15 @@ var sorton = SmartTags.makeSmartTag({
|
|
|
1536
1538
|
return { record: record2, prop, type };
|
|
1537
1539
|
});
|
|
1538
1540
|
const firstItem = map2[0];
|
|
1539
|
-
if (firstItem === void 0) return
|
|
1541
|
+
if (firstItem === void 0) return makeSuccess2([]);
|
|
1540
1542
|
const firstItemType = firstItem.type;
|
|
1541
|
-
if (firstItemType === void 0) return
|
|
1543
|
+
if (firstItemType === void 0) return makeFailure2(makeTransformationError({
|
|
1542
1544
|
message: "Invalid property type",
|
|
1543
1545
|
onItem: 0,
|
|
1544
1546
|
found: firstItemType
|
|
1545
1547
|
}));
|
|
1546
1548
|
for (const [daytumPos, daytumVal] of Object.entries(map2)) {
|
|
1547
|
-
if (daytumVal.type !== firstItemType) return
|
|
1549
|
+
if (daytumVal.type !== firstItemType) return makeFailure2(makeTransformationError({
|
|
1548
1550
|
message: "Invalid property type",
|
|
1549
1551
|
onItem: parseInt(daytumPos),
|
|
1550
1552
|
expected: firstItemType,
|
|
@@ -1552,7 +1554,7 @@ var sorton = SmartTags.makeSmartTag({
|
|
|
1552
1554
|
}));
|
|
1553
1555
|
}
|
|
1554
1556
|
const sorted = main.sort((a, b) => {
|
|
1555
|
-
const { Text: Text2, NodeList: NodeList2 } =
|
|
1557
|
+
const { Text: Text2, NodeList: NodeList2 } = get();
|
|
1556
1558
|
const aProp = a[strPropName];
|
|
1557
1559
|
const bProp = b[strPropName];
|
|
1558
1560
|
if (aProp === null) return 0;
|
|
@@ -1568,7 +1570,7 @@ var sorton = SmartTags.makeSmartTag({
|
|
|
1568
1570
|
if (aProp instanceof NodeList2) return aProp.length - Cast.toNodeList(bProp).length;
|
|
1569
1571
|
return 0;
|
|
1570
1572
|
});
|
|
1571
|
-
return
|
|
1573
|
+
return makeSuccess2(sorted);
|
|
1572
1574
|
}
|
|
1573
1575
|
});
|
|
1574
1576
|
|
|
@@ -1584,8 +1586,8 @@ var split = SmartTags.makeSmartTag({
|
|
|
1584
1586
|
for (const arg of args) {
|
|
1585
1587
|
strReturnedArr = strReturnedArr.map((e) => e.split(Cast.toString(arg))).flat();
|
|
1586
1588
|
}
|
|
1587
|
-
if (typeof main === "string") return
|
|
1588
|
-
return
|
|
1589
|
+
if (typeof main === "string") return makeSuccess(strReturnedArr);
|
|
1590
|
+
return makeSuccess(strReturnedArr.map(Cast.toText));
|
|
1589
1591
|
}
|
|
1590
1592
|
});
|
|
1591
1593
|
|
|
@@ -1596,17 +1598,17 @@ var spread = SmartTags.makeSmartTag({
|
|
|
1596
1598
|
isolationInitType: "array",
|
|
1597
1599
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "record"),
|
|
1598
1600
|
argsValueCheck: (a) => {
|
|
1599
|
-
const { makeFailure, makeSuccess } =
|
|
1601
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1600
1602
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
1601
1603
|
const { getType, typeCheck } = Utils.Tree.TypeChecks;
|
|
1602
|
-
if (a.length === 0) return
|
|
1603
|
-
if (a.length > 1) return
|
|
1604
|
+
if (a.length === 0) return makeFailure2(makeArgsValueError("record", "undefined", 0));
|
|
1605
|
+
if (a.length > 1) return makeFailure2(makeArgsValueError("undefined", getType(a.at(1)) ?? "undefined", 1));
|
|
1604
1606
|
const [first] = a;
|
|
1605
1607
|
const firstChecked = typeCheck(first, "record");
|
|
1606
|
-
if (!firstChecked.success) return
|
|
1607
|
-
return
|
|
1608
|
+
if (!firstChecked.success) return makeFailure2(makeArgsValueError(firstChecked.error.expected, firstChecked.error.found, 0));
|
|
1609
|
+
return makeSuccess2([firstChecked.payload]);
|
|
1608
1610
|
},
|
|
1609
|
-
func: (main, args) =>
|
|
1611
|
+
func: (main, args) => makeSuccess({ ...main, ...args[0] })
|
|
1610
1612
|
});
|
|
1611
1613
|
|
|
1612
1614
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.ts
|
|
@@ -1614,9 +1616,9 @@ var toarray = SmartTags.makeSmartTag({
|
|
|
1614
1616
|
name: "toarray",
|
|
1615
1617
|
defaultMode: "coalescion",
|
|
1616
1618
|
isolationInitType: "array",
|
|
1617
|
-
mainValueCheck: (m) =>
|
|
1619
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1618
1620
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
1619
|
-
func: (main) =>
|
|
1621
|
+
func: (main) => makeSuccess(Cast.toArray(main))
|
|
1620
1622
|
});
|
|
1621
1623
|
|
|
1622
1624
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.ts
|
|
@@ -1624,9 +1626,9 @@ var toboolean = SmartTags.makeSmartTag({
|
|
|
1624
1626
|
name: "toboolean",
|
|
1625
1627
|
defaultMode: "coalescion",
|
|
1626
1628
|
isolationInitType: "array",
|
|
1627
|
-
mainValueCheck: (m) =>
|
|
1629
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1628
1630
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
1629
|
-
func: (m) =>
|
|
1631
|
+
func: (m) => makeSuccess(Cast.toBoolean(m))
|
|
1630
1632
|
});
|
|
1631
1633
|
|
|
1632
1634
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.ts
|
|
@@ -1634,13 +1636,13 @@ var toelement = SmartTags.makeSmartTag({
|
|
|
1634
1636
|
name: "toelement",
|
|
1635
1637
|
defaultMode: "coalescion",
|
|
1636
1638
|
isolationInitType: "array",
|
|
1637
|
-
mainValueCheck: (m) =>
|
|
1639
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1638
1640
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckManyWithLength(a, 0, 1, "string", "text"),
|
|
1639
1641
|
func: (m, a) => {
|
|
1640
1642
|
const [rawTagName] = a;
|
|
1641
1643
|
const castedTagName = rawTagName !== void 0 ? Cast.toString(rawTagName) : void 0;
|
|
1642
1644
|
const tagName = castedTagName !== "" ? castedTagName : void 0;
|
|
1643
|
-
return
|
|
1645
|
+
return makeSuccess(Cast.toElement(m, tagName?.trim().toLowerCase()));
|
|
1644
1646
|
}
|
|
1645
1647
|
});
|
|
1646
1648
|
|
|
@@ -1652,10 +1654,10 @@ var toggleclass = SmartTags.makeSmartTag({
|
|
|
1652
1654
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "element", "nodelist"),
|
|
1653
1655
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "string", "text"),
|
|
1654
1656
|
func: (main, args) => {
|
|
1655
|
-
const { Element: Element2, document } =
|
|
1657
|
+
const { Element: Element2, document } = get();
|
|
1656
1658
|
if (main instanceof Element2) {
|
|
1657
1659
|
args.forEach((arg) => main.classList.toggle(Cast.toString(arg)));
|
|
1658
|
-
return
|
|
1660
|
+
return makeSuccess(main);
|
|
1659
1661
|
}
|
|
1660
1662
|
const children = Array.from(main).map((child) => {
|
|
1661
1663
|
if (child instanceof Element2) {
|
|
@@ -1667,7 +1669,7 @@ var toggleclass = SmartTags.makeSmartTag({
|
|
|
1667
1669
|
const frag = document.createDocumentFragment();
|
|
1668
1670
|
frag.append(...children);
|
|
1669
1671
|
const nodelist2 = frag.childNodes;
|
|
1670
|
-
return
|
|
1672
|
+
return makeSuccess(nodelist2);
|
|
1671
1673
|
}
|
|
1672
1674
|
});
|
|
1673
1675
|
|
|
@@ -1676,9 +1678,9 @@ var tonodelist = SmartTags.makeSmartTag({
|
|
|
1676
1678
|
name: "tonodelist",
|
|
1677
1679
|
defaultMode: "coalescion",
|
|
1678
1680
|
isolationInitType: "array",
|
|
1679
|
-
mainValueCheck: (m) =>
|
|
1681
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1680
1682
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
1681
|
-
func: (m) =>
|
|
1683
|
+
func: (m) => makeSuccess(Cast.toNodeList(m))
|
|
1682
1684
|
});
|
|
1683
1685
|
|
|
1684
1686
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.ts
|
|
@@ -1686,9 +1688,9 @@ var tonull = SmartTags.makeSmartTag({
|
|
|
1686
1688
|
name: "tonull",
|
|
1687
1689
|
defaultMode: "coalescion",
|
|
1688
1690
|
isolationInitType: "array",
|
|
1689
|
-
mainValueCheck: (m) =>
|
|
1691
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1690
1692
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
1691
|
-
func: () =>
|
|
1693
|
+
func: () => makeSuccess(null)
|
|
1692
1694
|
});
|
|
1693
1695
|
|
|
1694
1696
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.ts
|
|
@@ -1696,9 +1698,9 @@ var tonumber = SmartTags.makeSmartTag({
|
|
|
1696
1698
|
name: "tonumber",
|
|
1697
1699
|
defaultMode: "coalescion",
|
|
1698
1700
|
isolationInitType: "array",
|
|
1699
|
-
mainValueCheck: (m) =>
|
|
1701
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1700
1702
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
1701
|
-
func: (m) =>
|
|
1703
|
+
func: (m) => makeSuccess(Cast.toNumber(m))
|
|
1702
1704
|
});
|
|
1703
1705
|
|
|
1704
1706
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.ts
|
|
@@ -1706,9 +1708,9 @@ var torecord = SmartTags.makeSmartTag({
|
|
|
1706
1708
|
name: "torecord",
|
|
1707
1709
|
defaultMode: "coalescion",
|
|
1708
1710
|
isolationInitType: "array",
|
|
1709
|
-
mainValueCheck: (m) =>
|
|
1711
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1710
1712
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
1711
|
-
func: (main) =>
|
|
1713
|
+
func: (main) => makeSuccess(Cast.toRecord(main))
|
|
1712
1714
|
});
|
|
1713
1715
|
|
|
1714
1716
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.ts
|
|
@@ -1716,7 +1718,7 @@ var toref = SmartTags.makeSmartTag({
|
|
|
1716
1718
|
name: "toref",
|
|
1717
1719
|
defaultMode: "coalescion",
|
|
1718
1720
|
isolationInitType: "array",
|
|
1719
|
-
mainValueCheck: (m) =>
|
|
1721
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1720
1722
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
1721
1723
|
func: (main, args, details) => func(Cast.toString(main), args, details)
|
|
1722
1724
|
});
|
|
@@ -1726,9 +1728,9 @@ var tostring = SmartTags.makeSmartTag({
|
|
|
1726
1728
|
name: "tostring",
|
|
1727
1729
|
defaultMode: "coalescion",
|
|
1728
1730
|
isolationInitType: "array",
|
|
1729
|
-
mainValueCheck: (m) =>
|
|
1731
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1730
1732
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
1731
|
-
func: (m) =>
|
|
1733
|
+
func: (m) => makeSuccess(Cast.toString(m))
|
|
1732
1734
|
});
|
|
1733
1735
|
|
|
1734
1736
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.ts
|
|
@@ -1736,9 +1738,9 @@ var totext = SmartTags.makeSmartTag({
|
|
|
1736
1738
|
name: "totext",
|
|
1737
1739
|
defaultMode: "coalescion",
|
|
1738
1740
|
isolationInitType: "array",
|
|
1739
|
-
mainValueCheck: (m) =>
|
|
1741
|
+
mainValueCheck: (m) => makeSuccess(m),
|
|
1740
1742
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
1741
|
-
func: (m) =>
|
|
1743
|
+
func: (m) => makeSuccess(Cast.toText(m))
|
|
1742
1744
|
});
|
|
1743
1745
|
|
|
1744
1746
|
// src/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.ts
|
|
@@ -1748,21 +1750,21 @@ var transformselected = SmartTags.makeSmartTag({
|
|
|
1748
1750
|
isolationInitType: "array",
|
|
1749
1751
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "element", "nodelist"),
|
|
1750
1752
|
argsValueCheck: (a) => {
|
|
1751
|
-
const { makeFailure, makeSuccess } =
|
|
1753
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1752
1754
|
const { typeCheck, typeCheckMany } = Utils.Tree.TypeChecks;
|
|
1753
1755
|
const [first, ...others] = a;
|
|
1754
1756
|
const firstChecked = typeCheck(first, "string", "text");
|
|
1755
|
-
if (!firstChecked.success) return
|
|
1757
|
+
if (!firstChecked.success) return makeFailure2({ ...firstChecked.error, position: 0 });
|
|
1756
1758
|
const othersChecked = typeCheckMany(others, "method");
|
|
1757
|
-
if (!othersChecked.success) return
|
|
1759
|
+
if (!othersChecked.success) return makeFailure2({
|
|
1758
1760
|
...othersChecked.error,
|
|
1759
1761
|
position: othersChecked.error.position + 1
|
|
1760
1762
|
});
|
|
1761
1763
|
const returned = [firstChecked.payload, ...othersChecked.payload];
|
|
1762
|
-
return
|
|
1764
|
+
return makeSuccess2(returned);
|
|
1763
1765
|
},
|
|
1764
1766
|
func: (main, args) => {
|
|
1765
|
-
const { makeFailure, makeSuccess } =
|
|
1767
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = outcome_exports;
|
|
1766
1768
|
const { makeTransformationError } = Utils.SmartTags;
|
|
1767
1769
|
const { typeCheck } = Utils.Tree.TypeChecks;
|
|
1768
1770
|
const mainClone = Cast.toElement(main);
|
|
@@ -1773,7 +1775,7 @@ var transformselected = SmartTags.makeSmartTag({
|
|
|
1773
1775
|
for (const [selected, value] of Array.from(transformationMap)) {
|
|
1774
1776
|
const transformer = method.transformer;
|
|
1775
1777
|
const applied = transformer.apply(value);
|
|
1776
|
-
if (!applied.success) return
|
|
1778
|
+
if (!applied.success) return makeFailure2(makeTransformationError({
|
|
1777
1779
|
// [WIP] maybe a custom makeSubTransformationError ?
|
|
1778
1780
|
message: "Subtransformation failure.",
|
|
1779
1781
|
onSelected: selected,
|
|
@@ -1787,14 +1789,14 @@ var transformselected = SmartTags.makeSmartTag({
|
|
|
1787
1789
|
}
|
|
1788
1790
|
for (const [selected, transformed] of Array.from(transformationMap)) {
|
|
1789
1791
|
const transformedChecked = typeCheck(transformed, "element", "nodelist", "text", "string", "number", "boolean", "null");
|
|
1790
|
-
if (!transformedChecked.success) return
|
|
1792
|
+
if (!transformedChecked.success) return makeFailure2(makeTransformationError({
|
|
1791
1793
|
// [WIP] maybe a custom makeBadTransformationOutputError ?
|
|
1792
1794
|
message: "Bad transformation output",
|
|
1793
1795
|
onSelected: selected,
|
|
1794
1796
|
onTransformed: transformed,
|
|
1795
1797
|
details: { ...transformedChecked.error }
|
|
1796
1798
|
}));
|
|
1797
|
-
const { Element: Element2, NodeList: NodeList2, Text: Text2 } =
|
|
1799
|
+
const { Element: Element2, NodeList: NodeList2, Text: Text2 } = get();
|
|
1798
1800
|
const replacer = transformedChecked.payload;
|
|
1799
1801
|
if (replacer instanceof Element2 || replacer instanceof Text2) {
|
|
1800
1802
|
insertNode(replacer, "after", selected);
|
|
@@ -1808,9 +1810,9 @@ var transformselected = SmartTags.makeSmartTag({
|
|
|
1808
1810
|
}
|
|
1809
1811
|
transformedChecked.payload;
|
|
1810
1812
|
}
|
|
1811
|
-
if (main instanceof Element) return
|
|
1813
|
+
if (main instanceof Element) return makeSuccess2(mainClone);
|
|
1812
1814
|
const safeChildren = Array.from(mainClone.childNodes).filter((e) => e instanceof Element || e instanceof Text);
|
|
1813
|
-
return main instanceof Element ?
|
|
1815
|
+
return main instanceof Element ? makeSuccess2(mainClone) : makeSuccess2(Cast.toNodeList(safeChildren));
|
|
1814
1816
|
}
|
|
1815
1817
|
});
|
|
1816
1818
|
|
|
@@ -1822,7 +1824,7 @@ var trim = SmartTags.makeSmartTag({
|
|
|
1822
1824
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text"),
|
|
1823
1825
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
1824
1826
|
func: (main) => {
|
|
1825
|
-
return typeof main === "string" ?
|
|
1827
|
+
return typeof main === "string" ? makeSuccess(main.trim()) : makeSuccess(Cast.toText(`${main}`.trim()));
|
|
1826
1828
|
}
|
|
1827
1829
|
});
|
|
1828
1830
|
|
|
@@ -1867,7 +1869,7 @@ var Tree;
|
|
|
1867
1869
|
return new Tree2(merged, null, null, options);
|
|
1868
1870
|
}
|
|
1869
1871
|
constructor(node, parent, pathFromParent, options) {
|
|
1870
|
-
const { Element: Element2, Text: Text2, document } =
|
|
1872
|
+
const { Element: Element2, Text: Text2, document } = get();
|
|
1871
1873
|
this.resolve = this.resolve.bind(this);
|
|
1872
1874
|
this.setVariable = this.setVariable.bind(this);
|
|
1873
1875
|
this.getVariable = this.getVariable.bind(this);
|
|
@@ -1913,7 +1915,7 @@ var Tree;
|
|
|
1913
1915
|
array,
|
|
1914
1916
|
boolean,
|
|
1915
1917
|
element,
|
|
1916
|
-
|
|
1918
|
+
get2,
|
|
1917
1919
|
global,
|
|
1918
1920
|
guess,
|
|
1919
1921
|
nodelist,
|
|
@@ -2092,7 +2094,7 @@ var Tree;
|
|
|
2092
2094
|
}
|
|
2093
2095
|
performSafetyChecks() {
|
|
2094
2096
|
const { node, smartTagData, isMethod, mode, isRoot } = this;
|
|
2095
|
-
const { Text: Text2 } =
|
|
2097
|
+
const { Text: Text2 } = get();
|
|
2096
2098
|
if (node instanceof Text2 || smartTagData === null) {
|
|
2097
2099
|
if (isMethod) throw new Error(`A Text or HTMLElement node cannot be used as a method @ ${this.pathString}`);
|
|
2098
2100
|
if (mode === "coalescion") throw new Error(`A Text or HTMLElement node cannot be used in coalescion mode @ ${this.pathString}`);
|
|
@@ -2110,7 +2112,7 @@ var Tree;
|
|
|
2110
2112
|
performSafetyChecks
|
|
2111
2113
|
} = this;
|
|
2112
2114
|
performSafetyChecks();
|
|
2113
|
-
const { Text: Text2 } =
|
|
2115
|
+
const { Text: Text2 } = get();
|
|
2114
2116
|
if (node instanceof Text2) return node.cloneNode(true);
|
|
2115
2117
|
const initialInnerValue = Utils.Tree.getInitialValueFromTypeName(isolationInitType);
|
|
2116
2118
|
const innerValue = Array.from(subtrees).reduce((reduced, [subpath, subtree]) => {
|
|
@@ -2140,7 +2142,7 @@ var Tree;
|
|
|
2140
2142
|
}
|
|
2141
2143
|
enforceEvaluation() {
|
|
2142
2144
|
const { isPreserved, node, computeValue, isLiteral, attributes } = this;
|
|
2143
|
-
const { Element: Element2 } =
|
|
2145
|
+
const { Element: Element2 } = get();
|
|
2144
2146
|
if (isPreserved) return Utils.clone(node);
|
|
2145
2147
|
const evaluated = computeValue();
|
|
2146
2148
|
if (!isLiteral) return evaluated;
|
|
@@ -2182,7 +2184,7 @@ var Tree;
|
|
|
2182
2184
|
var Utils;
|
|
2183
2185
|
((Utils2) => {
|
|
2184
2186
|
function clone2(value) {
|
|
2185
|
-
const { Element: Element2, Text: Text2, NodeList: NodeList2, document } =
|
|
2187
|
+
const { Element: Element2, Text: Text2, NodeList: NodeList2, document } = get();
|
|
2186
2188
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null) return value;
|
|
2187
2189
|
if (value instanceof Text2) return value.cloneNode(true);
|
|
2188
2190
|
if (value instanceof NodeList2) {
|
|
@@ -2200,7 +2202,7 @@ var Utils;
|
|
|
2200
2202
|
}
|
|
2201
2203
|
Utils2.clone = clone2;
|
|
2202
2204
|
function coalesceValues(currentValue, subpath, subvalue) {
|
|
2203
|
-
const { Element: Element2, Text: Text2, NodeList: NodeList2, document } =
|
|
2205
|
+
const { Element: Element2, Text: Text2, NodeList: NodeList2, document } = get();
|
|
2204
2206
|
let actualSubvalue = subvalue;
|
|
2205
2207
|
if (actualSubvalue instanceof Transformer) {
|
|
2206
2208
|
const transformer = actualSubvalue;
|
|
@@ -2296,7 +2298,7 @@ var Utils;
|
|
|
2296
2298
|
}
|
|
2297
2299
|
Utils2.coalesceValues = coalesceValues;
|
|
2298
2300
|
Utils2.toHyperJson = (value) => {
|
|
2299
|
-
const { document, Element: Element2, Text: Text2, NodeList: NodeList2 } =
|
|
2301
|
+
const { document, Element: Element2, Text: Text2, NodeList: NodeList2 } = get();
|
|
2300
2302
|
if (value instanceof Text2) {
|
|
2301
2303
|
const elt2 = document.createElement("text");
|
|
2302
2304
|
elt2.innerHTML = value.textContent ?? "";
|
|
@@ -2361,7 +2363,7 @@ var Utils;
|
|
|
2361
2363
|
"record"
|
|
2362
2364
|
];
|
|
2363
2365
|
function singleTypeCheck(value, type) {
|
|
2364
|
-
const { Element: Element2, Text: Text2, NodeList: NodeList2 } =
|
|
2366
|
+
const { Element: Element2, Text: Text2, NodeList: NodeList2 } = get();
|
|
2365
2367
|
if (type === "null" && value === null) return true;
|
|
2366
2368
|
if (type === "boolean" && typeof value === "boolean") return true;
|
|
2367
2369
|
if (type === "number" && typeof value === "number") return true;
|
|
@@ -2386,8 +2388,8 @@ var Utils;
|
|
|
2386
2388
|
TypeChecks2.singleTypeCheck = singleTypeCheck;
|
|
2387
2389
|
function typeCheck(value, ...types) {
|
|
2388
2390
|
const matchesOneType = types.some((type) => singleTypeCheck(value, type));
|
|
2389
|
-
if (matchesOneType) return
|
|
2390
|
-
return
|
|
2391
|
+
if (matchesOneType) return makeSuccess(value);
|
|
2392
|
+
return makeFailure({
|
|
2391
2393
|
expected: types.join(" | "),
|
|
2392
2394
|
found: getType(value) ?? "undefined"
|
|
2393
2395
|
});
|
|
@@ -2397,9 +2399,9 @@ var Utils;
|
|
|
2397
2399
|
for (const [pos, val] of Object.entries(values)) {
|
|
2398
2400
|
const checked = typeCheck(val, ...types);
|
|
2399
2401
|
if (checked.success) continue;
|
|
2400
|
-
return
|
|
2402
|
+
return makeFailure({ position: parseInt(pos), ...checked.error });
|
|
2401
2403
|
}
|
|
2402
|
-
return
|
|
2404
|
+
return makeSuccess(values);
|
|
2403
2405
|
}
|
|
2404
2406
|
TypeChecks2.typeCheckMany = typeCheckMany;
|
|
2405
2407
|
})(TypeChecks = Transformations2.TypeChecks || (Transformations2.TypeChecks = {}));
|
|
@@ -2407,7 +2409,7 @@ var Utils;
|
|
|
2407
2409
|
let Tree2;
|
|
2408
2410
|
((Tree3) => {
|
|
2409
2411
|
function mergeNodes(nodes) {
|
|
2410
|
-
const { document, Text: Text2, Element: Element2 } =
|
|
2412
|
+
const { document, Text: Text2, Element: Element2 } = get();
|
|
2411
2413
|
const clones = nodes.map((node) => node.cloneNode(true));
|
|
2412
2414
|
const allChildren = [];
|
|
2413
2415
|
clones.forEach((node) => {
|
|
@@ -2451,7 +2453,7 @@ var Utils;
|
|
|
2451
2453
|
}
|
|
2452
2454
|
Tree3.mergeNodes = mergeNodes;
|
|
2453
2455
|
function getInitialValueFromTypeName(name) {
|
|
2454
|
-
const { document } =
|
|
2456
|
+
const { document } = get();
|
|
2455
2457
|
if (name === "null") return null;
|
|
2456
2458
|
if (name === "boolean") return false;
|
|
2457
2459
|
if (name === "number") return 0;
|
|
@@ -2495,7 +2497,7 @@ var Utils;
|
|
|
2495
2497
|
"record"
|
|
2496
2498
|
];
|
|
2497
2499
|
function singleTypeCheck(value, type) {
|
|
2498
|
-
const { Element: Element2, Text: Text2, NodeList: NodeList2 } =
|
|
2500
|
+
const { Element: Element2, Text: Text2, NodeList: NodeList2 } = get();
|
|
2499
2501
|
if (type === "null" && value === null) return true;
|
|
2500
2502
|
if (type === "boolean" && typeof value === "boolean") return true;
|
|
2501
2503
|
if (type === "number" && typeof value === "number") return true;
|
|
@@ -2521,8 +2523,8 @@ var Utils;
|
|
|
2521
2523
|
TypeChecks2.singleTypeCheck = singleTypeCheck;
|
|
2522
2524
|
function typeCheck(value, ...types) {
|
|
2523
2525
|
const matchesOneType = types.some((type) => singleTypeCheck(value, type));
|
|
2524
|
-
if (matchesOneType) return
|
|
2525
|
-
return
|
|
2526
|
+
if (matchesOneType) return makeSuccess(value);
|
|
2527
|
+
return makeFailure({
|
|
2526
2528
|
expected: types.join(" | "),
|
|
2527
2529
|
found: getType(value) ?? "undefined"
|
|
2528
2530
|
});
|
|
@@ -2532,18 +2534,18 @@ var Utils;
|
|
|
2532
2534
|
for (const [pos, val] of Object.entries(values)) {
|
|
2533
2535
|
const checked = typeCheck(val, ...types);
|
|
2534
2536
|
if (checked.success) continue;
|
|
2535
|
-
return
|
|
2537
|
+
return makeFailure({ position: parseInt(pos), ...checked.error });
|
|
2536
2538
|
}
|
|
2537
|
-
return
|
|
2539
|
+
return makeSuccess(values);
|
|
2538
2540
|
}
|
|
2539
2541
|
TypeChecks2.typeCheckMany = typeCheckMany;
|
|
2540
2542
|
function typeCheckManyWithLength(values, minLength, maxLength, ...types) {
|
|
2541
|
-
if (minLength !== void 0 && values.length < minLength) return
|
|
2543
|
+
if (minLength !== void 0 && values.length < minLength) return makeFailure({
|
|
2542
2544
|
position: values.length + 1,
|
|
2543
2545
|
expected: `min length: ${minLength}`,
|
|
2544
2546
|
found: `length: ${values.length}`
|
|
2545
2547
|
});
|
|
2546
|
-
if (maxLength !== void 0 && values.length > maxLength) return
|
|
2548
|
+
if (maxLength !== void 0 && values.length > maxLength) return makeFailure({
|
|
2547
2549
|
position: maxLength + 1,
|
|
2548
2550
|
expected: `max length: ${maxLength}`,
|
|
2549
2551
|
found: `length: ${values.length}`
|
|
@@ -2573,8 +2575,8 @@ var Utils;
|
|
|
2573
2575
|
let SmartTags2;
|
|
2574
2576
|
((SmartTags3) => {
|
|
2575
2577
|
SmartTags3.expectEmptyArgs = (args) => {
|
|
2576
|
-
if (args.length === 0) return
|
|
2577
|
-
return
|
|
2578
|
+
if (args.length === 0) return makeSuccess([]);
|
|
2579
|
+
return makeFailure({
|
|
2578
2580
|
expected: "length: 0",
|
|
2579
2581
|
found: `length: ${args.length}`
|
|
2580
2582
|
});
|
|
@@ -2603,13 +2605,13 @@ var boolean = SmartTags.makeSmartTag({
|
|
|
2603
2605
|
isolationInitType: "boolean",
|
|
2604
2606
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "null", "boolean", "number", "string", "text"),
|
|
2605
2607
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "null", "boolean", "number", "string", "text"),
|
|
2606
|
-
func: (main, args) =>
|
|
2608
|
+
func: (main, args) => makeSuccess([main, ...args].every((item) => Cast.toBoolean(item)))
|
|
2607
2609
|
});
|
|
2608
2610
|
|
|
2609
2611
|
export {
|
|
2610
2612
|
boolean,
|
|
2611
2613
|
element,
|
|
2612
|
-
get,
|
|
2614
|
+
get2 as get,
|
|
2613
2615
|
global,
|
|
2614
2616
|
guess,
|
|
2615
2617
|
nodelist,
|