@design-edito/tools 0.3.2 → 0.3.4
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.js +0 -2
- package/agnostic/arrays/find-duplicates/index.js +0 -2
- package/agnostic/arrays/is-array-of/index.js +2 -4
- package/agnostic/arrays/make/index.js +0 -2
- package/agnostic/arrays/random-pick/index.js +20 -5
- package/agnostic/arrays/shuffle/index.js +0 -2
- package/agnostic/booleans/is-falsy/index.js +10 -7
- package/agnostic/colors/channels/index.js +194 -12
- package/agnostic/colors/contrast/index.js +2 -13
- package/agnostic/colors/convert/index.js +553 -25
- package/agnostic/colors/distance/index.js +1 -10
- package/agnostic/colors/grayscale/index.js +6 -13
- package/agnostic/colors/invert/index.js +2 -14
- package/agnostic/colors/lerp/index.js +12 -19
- package/agnostic/colors/luminance/index.js +16 -10
- package/agnostic/colors/palette/index.js +1 -12
- package/agnostic/colors/rotate/index.js +36 -11
- package/agnostic/colors/tidy/index.js +55 -9
- package/agnostic/colors/typechecks/index.js +90 -14
- package/agnostic/colors/types.js +151 -4
- package/agnostic/css/bem/index.js +2 -9
- package/agnostic/css/generate-nice-color/index.js +0 -2
- package/agnostic/css/is-valid-css-class-name/index.js +5 -5
- package/agnostic/css/scale/index.js +2 -8
- package/agnostic/css/styles-set/index.js +1 -6
- package/agnostic/errors/register/index.js +0 -2
- package/agnostic/errors/unknown-to-string/index.js +7 -4
- package/agnostic/html/get-node-ancestors/index.js +18 -5
- package/agnostic/html/get-position-inside-parent/index.js +0 -2
- package/agnostic/html/hyper-json/cast/index.js +105 -22
- package/agnostic/html/hyper-json/index.js +16 -43
- package/agnostic/html/hyper-json/method/index.js +11 -4
- package/agnostic/html/hyper-json/serialize/index.js +67 -8
- package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +17 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +31 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +16 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +39 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +41 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +31 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +12 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +42 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +28 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +26 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +21 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +55 -23
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjparse/index.js +23 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjstringify/index.js +68 -24
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +21 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +34 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +18 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +19 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +33 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +12 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +35 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +16 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +19 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +68 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +24 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +12 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +32 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +12 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +48 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +31 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +40 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +48 -23
- package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +34 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +28 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +48 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +170 -23
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +78 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +20 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +22 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +13 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +13 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +18 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +31 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +13 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +12 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +13 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +13 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +14 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +13 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +13 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +78 -22
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +15 -22
- package/agnostic/html/hyper-json/smart-tags/index.js +28 -7
- package/agnostic/html/hyper-json/smart-tags/isolated/any/index.js +14 -8
- package/agnostic/html/hyper-json/smart-tags/isolated/array/index.js +11 -8
- package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +13 -22
- package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +24 -22
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +20 -22
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +15 -22
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +47 -22
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +22 -22
- package/agnostic/html/hyper-json/smart-tags/isolated/null/index.js +11 -8
- package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +19 -22
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +15 -22
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +38 -23
- package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +19 -22
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +19 -22
- package/agnostic/html/hyper-json/transformer/index.js +124 -6
- package/agnostic/html/hyper-json/tree/index.js +423 -22
- package/agnostic/html/hyper-json/types/index.js +16 -4
- package/agnostic/html/hyper-json/utils/index.js +426 -22
- package/agnostic/html/insert-node/index.js +14 -4
- package/agnostic/html/placeholders/index.js +0 -2
- package/agnostic/html/replace-in-element/index.js +1 -6
- package/agnostic/html/selector-to-element/index.js +2 -6
- package/agnostic/html/string-to-nodes/index.js +2 -6
- package/agnostic/misc/assert/index.js +8 -15
- package/agnostic/misc/cast/index.js +1 -6
- package/agnostic/misc/connection/index.js +2 -6
- package/agnostic/misc/crawler/index.d.ts +51 -27
- package/agnostic/misc/crawler/index.js +14 -8
- package/agnostic/misc/crossenv/detect-runtime/index.js +8 -10
- package/agnostic/misc/crossenv/types.js +11 -4
- package/agnostic/misc/crossenv/window/index.js +22 -7
- package/agnostic/misc/data-size/index.js +0 -2
- package/agnostic/misc/is-constructor-function/index.js +4 -4
- package/agnostic/misc/is-nullish/index.js +8 -6
- package/agnostic/misc/logs/logger/index.js +0 -2
- package/agnostic/misc/logs/make-text-block/index.js +11 -4
- package/agnostic/misc/logs/styles/index.js +18 -5
- package/agnostic/misc/lorem-ipsum/index.js +2 -8
- package/agnostic/misc/normalize-extension/index.js +0 -2
- package/agnostic/misc/outcome/index.js +10 -6
- package/agnostic/numbers/absolute-modulo/index.js +4 -4
- package/agnostic/numbers/approximate-rational/index.js +0 -2
- package/agnostic/numbers/clamp/index.js +6 -4
- package/agnostic/numbers/geometric-progressions/index.js +14 -4
- package/agnostic/numbers/interpolate/index.js +0 -2
- package/agnostic/numbers/round/index.js +13 -6
- package/agnostic/objects/deep-get-property/index.js +1 -5
- package/agnostic/objects/enums/is-in-enum/index.js +9 -4
- package/agnostic/objects/flatten-getters/index.js +0 -2
- package/agnostic/objects/is-object/index.js +7 -5
- package/agnostic/objects/is-record/index.js +5 -4
- package/agnostic/objects/record-format/index.js +0 -2
- package/agnostic/objects/record-map/index.js +10 -4
- package/agnostic/objects/validation/index.js +0 -2
- package/agnostic/optim/memoize/index.js +0 -2
- package/agnostic/optim/throttle-debounce/index.js +0 -2
- package/agnostic/random/hex-char/index.js +7 -5
- package/agnostic/random/random/index.js +12 -5
- package/agnostic/random/uuid/index.js +11 -7
- package/agnostic/regexps/index.js +0 -2
- package/agnostic/sanitization/file-name/index.js +6 -4
- package/agnostic/sanitization/html/index.js +3 -7
- package/agnostic/sanitization/path/index.js +1 -5
- package/agnostic/sanitization/user-input/index.js +0 -2
- package/agnostic/strings/char-codes/index.js +0 -2
- package/agnostic/strings/matches/index.js +14 -6
- package/agnostic/strings/normalize-indent/index.js +0 -2
- package/agnostic/strings/parse-table/index.js +6 -11
- package/agnostic/strings/replace-all/index.js +13 -4
- package/agnostic/strings/to-alphanum/index.js +0 -2
- package/agnostic/strings/trim/index.js +7 -5
- package/agnostic/time/dates/format-date/index.js +0 -2
- package/agnostic/time/duration/index.js +0 -2
- package/agnostic/time/timeout/index.js +0 -2
- package/agnostic/time/transitions/index.js +1 -5
- package/agnostic/time/wait/index.js +6 -4
- package/components/Comp/index.js +0 -2
- package/node/@aws-s3/storage/directory/copy-dir/index.js +53 -5
- package/node/@aws-s3/storage/directory/list/index.js +22 -5
- package/node/@aws-s3/storage/directory/move-dir/index.js +66 -5
- package/node/@aws-s3/storage/directory/remove-dir/index.js +49 -5
- package/node/@aws-s3/storage/file/copy/index.js +34 -5
- package/node/@aws-s3/storage/file/download/index.js +20 -5
- package/node/@aws-s3/storage/file/exists/index.js +25 -5
- package/node/@aws-s3/storage/file/move/index.js +45 -5
- package/node/@aws-s3/storage/file/remove/index.js +25 -5
- package/node/@aws-s3/storage/file/stat/index.js +27 -5
- package/node/@aws-s3/storage/file/upload/index.js +45 -5
- package/node/@express/@multer/index.js +5 -12
- package/node/@google-cloud/storage/bucket/get-metadata/index.js +4 -11
- package/node/@google-cloud/storage/directory/copy-dir/index.js +26 -6
- package/node/@google-cloud/storage/directory/list/index.js +18 -6
- package/node/@google-cloud/storage/directory/move-dir/index.js +26 -6
- package/node/@google-cloud/storage/directory/remove-dir/index.js +22 -6
- package/node/@google-cloud/storage/file/copy/index.js +24 -6
- package/node/@google-cloud/storage/file/download/index.js +17 -6
- package/node/@google-cloud/storage/file/exists/index.js +14 -6
- package/node/@google-cloud/storage/file/generate-signed-url/index.js +4 -11
- package/node/@google-cloud/storage/file/get-metadata/index.js +4 -11
- package/node/@google-cloud/storage/file/get-permissions/index.js +4 -11
- package/node/@google-cloud/storage/file/move/index.js +26 -6
- package/node/@google-cloud/storage/file/remove/index.js +19 -6
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +5 -16
- package/node/@google-cloud/storage/file/stat/index.js +21 -6
- package/node/@google-cloud/storage/file/update-metadata/index.js +4 -11
- package/node/@google-cloud/storage/file/upload/index.js +31 -6
- package/node/cloud-storage/clients/index.js +9 -7
- package/node/cloud-storage/operations/copy-dir/index.js +21 -26
- package/node/cloud-storage/operations/copy-file/index.js +12 -25
- package/node/cloud-storage/operations/download-file/index.js +12 -25
- package/node/cloud-storage/operations/exists-file/index.js +12 -25
- package/node/cloud-storage/operations/list-dir/index.js +12 -25
- package/node/cloud-storage/operations/move-dir/index.js +14 -27
- package/node/cloud-storage/operations/move-file/index.js +12 -25
- package/node/cloud-storage/operations/remove-dir/index.js +14 -27
- package/node/cloud-storage/operations/remove-file/index.js +12 -25
- package/node/cloud-storage/operations/stat-file/index.js +12 -25
- package/node/cloud-storage/operations/upload-file/index.js +12 -25
- package/node/encryption/@aes-256-gcm/buffer/index.js +7 -12
- package/node/encryption/@aes-256-gcm/uint8-array/index.js +36 -7
- package/node/encryption/key/index.js +0 -2
- package/node/files/is-in-directory/index.js +0 -2
- package/node/files/read-write/index.js +0 -2
- package/node/files/subpaths/index.js +3 -7
- package/node/ftps/directory/copy-dir/index.js +45 -6
- package/node/ftps/directory/list/index.js +12 -6
- package/node/ftps/directory/move-dir/index.js +25 -6
- package/node/ftps/directory/remove-dir/index.js +27 -6
- package/node/ftps/file/copy/index.js +30 -6
- package/node/ftps/file/download/index.js +15 -6
- package/node/ftps/file/exists/index.js +17 -6
- package/node/ftps/file/move/index.js +29 -6
- package/node/ftps/file/remove/index.js +25 -6
- package/node/ftps/file/stat/index.js +21 -6
- package/node/ftps/file/upload/index.js +30 -6
- package/node/images/create/index.js +1 -11
- package/node/images/format/index.js +87 -104
- package/node/images/metadata/index.js +1 -11
- package/node/images/transform/index.js +73 -130
- package/node/images/transform/operations/blur/index.js +12 -7
- package/node/images/transform/operations/brighten/index.js +12 -7
- package/node/images/transform/operations/extend/index.js +24 -14
- package/node/images/transform/operations/extract/index.js +17 -7
- package/node/images/transform/operations/flatten/index.js +19 -14
- package/node/images/transform/operations/flip/index.js +4 -4
- package/node/images/transform/operations/flop/index.js +4 -4
- package/node/images/transform/operations/hue/index.js +14 -7
- package/node/images/transform/operations/level/index.js +18 -7
- package/node/images/transform/operations/lighten/index.js +14 -7
- package/node/images/transform/operations/normalize/index.js +15 -7
- package/node/images/transform/operations/overlay/index.js +87 -14
- package/node/images/transform/operations/resize/index.js +45 -14
- package/node/images/transform/operations/rotate/index.js +19 -14
- package/node/images/transform/operations/saturate/index.js +16 -7
- package/node/images/types.js +27 -5
- package/node/images/utils/index.js +35 -13
- package/node/process/on-exit/index.js +0 -2
- package/node/process/prompt-continue/index.js +2 -1667
- package/node/process/spawner/index.js +8 -20
- package/node/sftp/directory/copy-dir/index.js +43 -6
- package/node/sftp/directory/list/index.js +12 -6
- package/node/sftp/directory/move-dir/index.js +22 -6
- package/node/sftp/directory/remove-dir/index.js +27 -6
- package/node/sftp/file/copy/index.js +28 -6
- package/node/sftp/file/download/index.js +15 -6
- package/node/sftp/file/exists/index.js +12 -6
- package/node/sftp/file/move/index.js +25 -6
- package/node/sftp/file/remove/index.js +18 -6
- package/node/sftp/file/stat/index.js +21 -6
- package/node/sftp/file/upload/index.js +22 -6
- package/package.json +1 -1
- package/chunks/chunk-2OGNVG5X.js +0 -56
- package/chunks/chunk-3MPXVP4L.js +0 -25
- package/chunks/chunk-4ARE376R.js +0 -36
- package/chunks/chunk-4CIS3R7T.js +0 -10
- package/chunks/chunk-4WE2WEXL.js +0 -12
- package/chunks/chunk-4WO4M2HE.js +0 -38
- package/chunks/chunk-5CFQCSKJ.js +0 -23
- package/chunks/chunk-5DJBOYRY.js +0 -29
- package/chunks/chunk-5H3IRSOB.js +0 -8
- package/chunks/chunk-5LCPENF6.js +0 -40
- package/chunks/chunk-5NTPCRFH.js +0 -32
- package/chunks/chunk-65BFQP3T.js +0 -25
- package/chunks/chunk-6652JQFX.js +0 -47
- package/chunks/chunk-6GINUDWK.js +0 -36
- package/chunks/chunk-6KOJFWH3.js +0 -47
- package/chunks/chunk-6XL25OZX.js +0 -12
- package/chunks/chunk-75BICI4L.js +0 -20
- package/chunks/chunk-7OWHDBUD.js +0 -31
- package/chunks/chunk-AFQ6FUT2.js +0 -36
- package/chunks/chunk-AKNR3U25.js +0 -20
- package/chunks/chunk-ASWI3EO6.js +0 -25
- package/chunks/chunk-ASXK7XCC.js +0 -18
- package/chunks/chunk-AYGAQQXD.js +0 -27
- package/chunks/chunk-B4BXEVMI.js +0 -22
- package/chunks/chunk-BOI2VKM7.js +0 -31
- package/chunks/chunk-CDIXAYVL.js +0 -40
- package/chunks/chunk-D3ERTRDW.js +0 -17
- package/chunks/chunk-D3J6JAJW.js +0 -31
- package/chunks/chunk-DNIOWD7K.js +0 -8
- package/chunks/chunk-DUCLFPGE.js +0 -78
- package/chunks/chunk-E6MSDKON.js +0 -13
- package/chunks/chunk-EPUHVR7J.js +0 -17
- package/chunks/chunk-EZVE2V6Z.js +0 -37
- package/chunks/chunk-FBWBGFRA.js +0 -35
- package/chunks/chunk-FENXVJYO.js +0 -11
- package/chunks/chunk-FML7BURX.js +0 -38
- package/chunks/chunk-FXISVWGE.js +0 -60
- package/chunks/chunk-GDSDQ3UB.js +0 -27
- package/chunks/chunk-GFYAOPTP.js +0 -60
- package/chunks/chunk-GICC2TWR.js +0 -22
- package/chunks/chunk-GOKDRSAD.js +0 -22
- package/chunks/chunk-H4PP6AHP.js +0 -15
- package/chunks/chunk-HC6ZOHCS.js +0 -14
- package/chunks/chunk-HEY7J6GI.js +0 -37
- package/chunks/chunk-HMPY32F7.js +0 -34
- package/chunks/chunk-HQLRJ7XW.js +0 -12
- package/chunks/chunk-HYPEWMYZ.js +0 -10
- package/chunks/chunk-IK2S6ZYP.js +0 -29
- package/chunks/chunk-ISJONMNA.js +0 -16
- package/chunks/chunk-IV6JXJNW.js +0 -25
- package/chunks/chunk-J45Y3CWM.js +0 -39
- package/chunks/chunk-JCXDI6AD.js +0 -56
- package/chunks/chunk-JDINERKY.js +0 -107
- package/chunks/chunk-JPNVNAO4.js +0 -36
- package/chunks/chunk-JVMFT3IT.js +0 -134
- package/chunks/chunk-K5UF634H.js +0 -25
- package/chunks/chunk-KEGTGEAM.js +0 -55
- package/chunks/chunk-KRYJVBO5.js +0 -155
- package/chunks/chunk-L3OCRR3V.js +0 -25
- package/chunks/chunk-LBK4TBXP.js +0 -31
- package/chunks/chunk-LFHDJTZJ.js +0 -12552
- package/chunks/chunk-MFL7PQWJ.js +0 -64
- package/chunks/chunk-MHNUCHPP.js +0 -26
- package/chunks/chunk-MSAAQTCE.js +0 -207
- package/chunks/chunk-MZYCKOLN.js +0 -103
- package/chunks/chunk-NONFIHGT.js +0 -33
- package/chunks/chunk-NR7STUY3.js +0 -28
- package/chunks/chunk-OCDUURXM.js +0 -28
- package/chunks/chunk-OGBUSUE6.js +0 -12
- package/chunks/chunk-OSAXBA7G.js +0 -10
- package/chunks/chunk-PA6C6P2W.js +0 -36
- package/chunks/chunk-PTJO2TGI.js +0 -23
- package/chunks/chunk-Q6Y27PHJ.js +0 -27
- package/chunks/chunk-QD6KZUTV.js +0 -41
- package/chunks/chunk-QEKI6WGQ.js +0 -27
- package/chunks/chunk-QFBVETGF.js +0 -34
- package/chunks/chunk-QHEWBOQI.js +0 -19
- package/chunks/chunk-QXAJXTXV.js +0 -19
- package/chunks/chunk-R3AWQXMY.js +0 -20
- package/chunks/chunk-RC7TRCNX.js +0 -53
- package/chunks/chunk-RNXRHCHQ.js +0 -633
- package/chunks/chunk-ROWPCMQY.js +0 -29
- package/chunks/chunk-RW7VAKJW.js +0 -15
- package/chunks/chunk-S2YRVCQ4.js +0 -32
- package/chunks/chunk-SJ54QLKA.js +0 -2684
- package/chunks/chunk-SNB7HA6G.js +0 -32
- package/chunks/chunk-T3F3S6XV.js +0 -35
- package/chunks/chunk-TKAWYSFV.js +0 -34
- package/chunks/chunk-TLWVLCIQ.js +0 -39
- package/chunks/chunk-TTJXJX4E.js +0 -48
- package/chunks/chunk-UR5BUIPU.js +0 -26
- package/chunks/chunk-USIYKRNX.js +0 -20
- package/chunks/chunk-UVYVJF5Q.js +0 -45
- package/chunks/chunk-VRVBSI2L.js +0 -28
- package/chunks/chunk-VYVVS4LW.js +0 -24
- package/chunks/chunk-W5A2TON3.js +0 -10
- package/chunks/chunk-W7VDFL7P.js +0 -77
- package/chunks/chunk-WNDMYNDU.js +0 -8
- package/chunks/chunk-XA4HVHJ4.js +0 -18
- package/chunks/chunk-XCBH6NLF.js +0 -42
- package/chunks/chunk-XEQ2PBT2.js +0 -20
- package/chunks/chunk-XIIJYVJZ.js +0 -15
- package/chunks/chunk-XKELYCHB.js +0 -32
- package/chunks/chunk-XNF5MLCQ.js +0 -14
- package/chunks/chunk-XVH447XG.js +0 -35
- package/chunks/chunk-YA2YCZUF.js +0 -8
- package/chunks/chunk-YDIBNEGA.js +0 -9
- package/chunks/chunk-Z352FGUT.js +0 -25
- package/chunks/chunk-ZE5QOQM6.js +0 -37
- package/chunks/chunk-ZKIQ753F.js +0 -23
|
@@ -1,25 +1,429 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
} from "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
// src/agnostic/html/hyper-json/utils/index.ts
|
|
2
|
+
import * as Window from "../../../misc/crossenv/window/index.js";
|
|
3
|
+
import { isRecord } from "../../../objects/is-record/index.js";
|
|
4
|
+
import { recordMap } from "../../../objects/record-map/index.js";
|
|
5
|
+
import * as Outcome from "../../../misc/outcome/index.js";
|
|
6
|
+
import { isInEnum } from "../../../objects/enums/is-in-enum/index.js";
|
|
7
|
+
import { Method } from "../method/index.js";
|
|
8
|
+
import { Transformer } from "../transformer/index.js";
|
|
9
|
+
import { Tree as TreeNamespace } from "../tree/index.js";
|
|
10
|
+
import { Types } from "../types/index.js";
|
|
11
|
+
var Utils;
|
|
12
|
+
((Utils2) => {
|
|
13
|
+
function clone(value) {
|
|
14
|
+
const { Element, Text, NodeList, document } = Window.get();
|
|
15
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null) return value;
|
|
16
|
+
if (value instanceof Text) return value.cloneNode(true);
|
|
17
|
+
if (value instanceof NodeList) {
|
|
18
|
+
const frag = document.createDocumentFragment();
|
|
19
|
+
const nodes = Array.from(value).map((e) => e.cloneNode(true));
|
|
20
|
+
frag.append(...nodes);
|
|
21
|
+
return frag.childNodes;
|
|
22
|
+
}
|
|
23
|
+
if (value instanceof Element) return value.cloneNode(true);
|
|
24
|
+
if (value instanceof Transformer) return Transformer.clone(value);
|
|
25
|
+
if (value instanceof Method) return Method.clone(value);
|
|
26
|
+
if (Array.isArray(value)) return [...value.map(clone)];
|
|
27
|
+
if (isRecord(value)) return recordMap(value, (prop) => clone(prop));
|
|
28
|
+
throw new Error(`Cannot clone value: ${value}`);
|
|
29
|
+
}
|
|
30
|
+
Utils2.clone = clone;
|
|
31
|
+
function coalesceValues(currentValue, subpath, subvalue) {
|
|
32
|
+
const { Element, Text, NodeList, document } = Window.get();
|
|
33
|
+
let actualSubvalue = subvalue;
|
|
34
|
+
if (actualSubvalue instanceof Transformer) {
|
|
35
|
+
const transformer = actualSubvalue;
|
|
36
|
+
const transformationResult = transformer.apply(currentValue);
|
|
37
|
+
if (!transformationResult.success) {
|
|
38
|
+
console.warn({ ...transformationResult.error });
|
|
39
|
+
return currentValue;
|
|
40
|
+
}
|
|
41
|
+
const evaluated = transformationResult.payload;
|
|
42
|
+
if (transformer.mode === "isolation") {
|
|
43
|
+
actualSubvalue = evaluated;
|
|
44
|
+
} else {
|
|
45
|
+
return evaluated;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (Array.isArray(currentValue)) return [...currentValue, actualSubvalue];
|
|
49
|
+
if (currentValue === null) return actualSubvalue;
|
|
50
|
+
if (typeof currentValue === "boolean") return actualSubvalue;
|
|
51
|
+
if (typeof currentValue === "number") return actualSubvalue;
|
|
52
|
+
if (currentValue instanceof Transformer) return actualSubvalue;
|
|
53
|
+
if (currentValue instanceof Method) return actualSubvalue;
|
|
54
|
+
if (typeof currentValue === "string") {
|
|
55
|
+
if (actualSubvalue === null || typeof actualSubvalue === "boolean" || typeof actualSubvalue === "number" || typeof actualSubvalue === "string") return `${currentValue}${actualSubvalue}`;
|
|
56
|
+
if (actualSubvalue instanceof Text) return `${currentValue}${actualSubvalue.textContent}`;
|
|
57
|
+
if (actualSubvalue instanceof Element) {
|
|
58
|
+
const frag = document.createDocumentFragment();
|
|
59
|
+
frag.append(currentValue, Utils2.clone(actualSubvalue));
|
|
60
|
+
return frag.childNodes;
|
|
61
|
+
}
|
|
62
|
+
if (actualSubvalue instanceof NodeList) {
|
|
63
|
+
const frag = document.createDocumentFragment();
|
|
64
|
+
frag.append(currentValue, ...Array.from(Utils2.clone(actualSubvalue)));
|
|
65
|
+
return frag.childNodes;
|
|
66
|
+
}
|
|
67
|
+
return actualSubvalue;
|
|
68
|
+
}
|
|
69
|
+
if (currentValue instanceof Text) {
|
|
70
|
+
if (actualSubvalue === null || typeof actualSubvalue === "boolean" || typeof actualSubvalue === "number" || typeof actualSubvalue === "string") return document.createTextNode(`${currentValue.textContent}${actualSubvalue}`);
|
|
71
|
+
if (actualSubvalue instanceof Text) return document.createTextNode(`${currentValue.textContent}${actualSubvalue.textContent}`);
|
|
72
|
+
if (actualSubvalue instanceof Element) {
|
|
73
|
+
const frag = document.createDocumentFragment();
|
|
74
|
+
frag.append(clone(currentValue), clone(actualSubvalue));
|
|
75
|
+
return frag.childNodes;
|
|
76
|
+
}
|
|
77
|
+
if (actualSubvalue instanceof NodeList) {
|
|
78
|
+
const frag = document.createDocumentFragment();
|
|
79
|
+
frag.append(clone(currentValue), ...Array.from(clone(actualSubvalue)));
|
|
80
|
+
return frag.childNodes;
|
|
81
|
+
}
|
|
82
|
+
return actualSubvalue;
|
|
83
|
+
}
|
|
84
|
+
if (currentValue instanceof Element) {
|
|
85
|
+
if (actualSubvalue === null || typeof actualSubvalue === "boolean" || typeof actualSubvalue === "number" || typeof actualSubvalue === "string") {
|
|
86
|
+
const frag = document.createDocumentFragment();
|
|
87
|
+
frag.append(clone(currentValue), `${actualSubvalue}`);
|
|
88
|
+
return frag.childNodes;
|
|
89
|
+
}
|
|
90
|
+
if (actualSubvalue instanceof Text || actualSubvalue instanceof Element) {
|
|
91
|
+
const frag = document.createDocumentFragment();
|
|
92
|
+
frag.append(clone(currentValue), clone(actualSubvalue));
|
|
93
|
+
return frag.childNodes;
|
|
94
|
+
}
|
|
95
|
+
if (actualSubvalue instanceof NodeList) {
|
|
96
|
+
const frag = document.createDocumentFragment();
|
|
97
|
+
frag.append(clone(currentValue), ...Array.from(clone(actualSubvalue)));
|
|
98
|
+
return frag.childNodes;
|
|
99
|
+
}
|
|
100
|
+
return actualSubvalue;
|
|
101
|
+
}
|
|
102
|
+
if (currentValue instanceof NodeList) {
|
|
103
|
+
if (actualSubvalue === null || typeof actualSubvalue === "boolean" || typeof actualSubvalue === "number" || typeof actualSubvalue === "string") {
|
|
104
|
+
const frag = document.createDocumentFragment();
|
|
105
|
+
frag.append(...Array.from(clone(currentValue)), `${actualSubvalue}`);
|
|
106
|
+
return frag.childNodes;
|
|
107
|
+
}
|
|
108
|
+
if (actualSubvalue instanceof Text || actualSubvalue instanceof Element) {
|
|
109
|
+
const frag = document.createDocumentFragment();
|
|
110
|
+
frag.append(...Array.from(clone(currentValue)), clone(actualSubvalue));
|
|
111
|
+
return frag.childNodes;
|
|
112
|
+
}
|
|
113
|
+
if (actualSubvalue instanceof NodeList) {
|
|
114
|
+
const frag = document.createDocumentFragment();
|
|
115
|
+
frag.append(...Array.from(clone(currentValue)), ...Array.from(clone(actualSubvalue)));
|
|
116
|
+
return frag.childNodes;
|
|
117
|
+
}
|
|
118
|
+
return actualSubvalue;
|
|
119
|
+
}
|
|
120
|
+
if (typeof subpath === "number") return { ...currentValue };
|
|
121
|
+
return {
|
|
122
|
+
...currentValue,
|
|
123
|
+
[subpath]: actualSubvalue
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
Utils2.coalesceValues = coalesceValues;
|
|
127
|
+
Utils2.toHyperJson = (value) => {
|
|
128
|
+
const { document, Element, Text, NodeList } = Window.get();
|
|
129
|
+
if (value instanceof Text) {
|
|
130
|
+
const elt2 = document.createElement("text");
|
|
131
|
+
elt2.innerHTML = value.textContent ?? "";
|
|
132
|
+
return elt2;
|
|
133
|
+
}
|
|
134
|
+
if (value instanceof Element) return value.cloneNode(true);
|
|
135
|
+
if (value instanceof NodeList) {
|
|
136
|
+
const elt2 = document.createElement("nodelist");
|
|
137
|
+
elt2.append(...Array.from(value).map((e) => e.cloneNode(true)));
|
|
138
|
+
return elt2;
|
|
139
|
+
}
|
|
140
|
+
if (value === null) return document.createElement("null");
|
|
141
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
142
|
+
const elt2 = document.createElement(typeof value);
|
|
143
|
+
elt2.innerHTML = `${value}`;
|
|
144
|
+
return elt2;
|
|
145
|
+
}
|
|
146
|
+
if (Array.isArray(value)) {
|
|
147
|
+
const elt2 = document.createElement("array");
|
|
148
|
+
elt2.append(...value.map((e) => (0, Utils2.toHyperJson)(e)));
|
|
149
|
+
return elt2;
|
|
150
|
+
}
|
|
151
|
+
if (value instanceof Transformer) return clone(value.sourceTree.node);
|
|
152
|
+
if (value instanceof Method) return clone(value.transformer.sourceTree.node);
|
|
153
|
+
const elt = document.createElement("record");
|
|
154
|
+
Object.entries(value).forEach(([key, val]) => {
|
|
155
|
+
const hjVal = (0, Utils2.toHyperJson)(val);
|
|
156
|
+
if (hjVal instanceof Text) return;
|
|
157
|
+
hjVal.setAttribute(TreeNamespace.Tree.keyAttribute, key);
|
|
158
|
+
elt.append(hjVal);
|
|
159
|
+
});
|
|
160
|
+
return elt;
|
|
161
|
+
};
|
|
162
|
+
let Transformations;
|
|
163
|
+
((Transformations2) => {
|
|
164
|
+
let TypeChecks;
|
|
165
|
+
((TypeChecks2) => {
|
|
166
|
+
function getType(value) {
|
|
167
|
+
if (singleTypeCheck(value, "null")) return "null";
|
|
168
|
+
if (singleTypeCheck(value, "boolean")) return "boolean";
|
|
169
|
+
if (singleTypeCheck(value, "number")) return "number";
|
|
170
|
+
if (singleTypeCheck(value, "string")) return "string";
|
|
171
|
+
if (singleTypeCheck(value, "element")) return "element";
|
|
172
|
+
if (singleTypeCheck(value, "text")) return "text";
|
|
173
|
+
if (singleTypeCheck(value, "nodelist")) return "nodelist";
|
|
174
|
+
if (singleTypeCheck(value, "method")) return "method";
|
|
175
|
+
if (singleTypeCheck(value, "array")) return "array";
|
|
176
|
+
if (singleTypeCheck(value, "record")) return "record";
|
|
177
|
+
return void 0;
|
|
178
|
+
}
|
|
179
|
+
TypeChecks2.getType = getType;
|
|
180
|
+
TypeChecks2.everyTypeName = [
|
|
181
|
+
"null",
|
|
182
|
+
"boolean",
|
|
183
|
+
"number",
|
|
184
|
+
"string",
|
|
185
|
+
"text",
|
|
186
|
+
"nodelist",
|
|
187
|
+
"element",
|
|
188
|
+
"method",
|
|
189
|
+
"array",
|
|
190
|
+
"record"
|
|
191
|
+
];
|
|
192
|
+
function singleTypeCheck(value, type) {
|
|
193
|
+
const { Element, Text, NodeList } = Window.get();
|
|
194
|
+
if (type === "null" && value === null) return true;
|
|
195
|
+
if (type === "boolean" && typeof value === "boolean") return true;
|
|
196
|
+
if (type === "number" && typeof value === "number") return true;
|
|
197
|
+
if (type === "string" && typeof value === "string") return true;
|
|
198
|
+
if (type === "element" && value instanceof Element) return true;
|
|
199
|
+
if (type === "text" && value instanceof Text) return true;
|
|
200
|
+
if (type === "nodelist" && value instanceof NodeList) {
|
|
201
|
+
const children = Array.from(value);
|
|
202
|
+
return children.every((child) => child instanceof Element || child instanceof Text);
|
|
203
|
+
}
|
|
204
|
+
if (type === "method" && value instanceof Method) return true;
|
|
205
|
+
if (type === "array" && Array.isArray(value)) {
|
|
206
|
+
const childrenOk = value.every((child) => typeCheck(child, ...TypeChecks2.everyTypeName).success);
|
|
207
|
+
return childrenOk;
|
|
208
|
+
}
|
|
209
|
+
if (type === "record" && isRecord(value)) {
|
|
210
|
+
const childrenOk = Object.values(value).every((child) => typeCheck(child, ...TypeChecks2.everyTypeName).success);
|
|
211
|
+
return childrenOk;
|
|
212
|
+
}
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
TypeChecks2.singleTypeCheck = singleTypeCheck;
|
|
216
|
+
function typeCheck(value, ...types) {
|
|
217
|
+
const matchesOneType = types.some((type) => singleTypeCheck(value, type));
|
|
218
|
+
if (matchesOneType) return Outcome.makeSuccess(value);
|
|
219
|
+
return Outcome.makeFailure({
|
|
220
|
+
expected: types.join(" | "),
|
|
221
|
+
found: getType(value) ?? "undefined"
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
TypeChecks2.typeCheck = typeCheck;
|
|
225
|
+
function typeCheckMany(values, ...types) {
|
|
226
|
+
for (const [pos, val] of Object.entries(values)) {
|
|
227
|
+
const checked = typeCheck(val, ...types);
|
|
228
|
+
if (checked.success) continue;
|
|
229
|
+
return Outcome.makeFailure({ position: parseInt(pos), ...checked.error });
|
|
230
|
+
}
|
|
231
|
+
return Outcome.makeSuccess(values);
|
|
232
|
+
}
|
|
233
|
+
TypeChecks2.typeCheckMany = typeCheckMany;
|
|
234
|
+
})(TypeChecks = Transformations2.TypeChecks || (Transformations2.TypeChecks = {}));
|
|
235
|
+
})(Transformations = Utils2.Transformations || (Utils2.Transformations = {}));
|
|
236
|
+
let Tree;
|
|
237
|
+
((Tree2) => {
|
|
238
|
+
function mergeNodes(nodes) {
|
|
239
|
+
const { document, Text, Element } = Window.get();
|
|
240
|
+
const clones = nodes.map((node) => node.cloneNode(true));
|
|
241
|
+
const allChildren = [];
|
|
242
|
+
clones.forEach((node) => {
|
|
243
|
+
const actionAttribute = node.getAttribute(TreeNamespace.Tree.actionAttribute)?.trim().toLowerCase();
|
|
244
|
+
const actionAttrIsValid = isInEnum(Types.Tree.Merge.Action, actionAttribute ?? "");
|
|
245
|
+
const nodeAction = actionAttrIsValid ? actionAttribute : Types.Tree.Merge.Action.APPEND;
|
|
246
|
+
const children = Array.from(node.childNodes).filter((child) => child instanceof Text || child instanceof Element).map((child) => {
|
|
247
|
+
if (child instanceof Text) return { node: child, key: void 0 };
|
|
248
|
+
const childKey = child.getAttribute(TreeNamespace.Tree.keyAttribute) ?? void 0;
|
|
249
|
+
return { node: child, key: childKey };
|
|
250
|
+
});
|
|
251
|
+
if (nodeAction === Types.Tree.Merge.Action.REPLACE) {
|
|
252
|
+
allChildren.splice(0, allChildren.length);
|
|
253
|
+
} else if (nodeAction === Types.Tree.Merge.Action.PREPEND) {
|
|
254
|
+
allChildren.unshift(...children);
|
|
255
|
+
} else {
|
|
256
|
+
allChildren.push(...children);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
const mergedChildren = [];
|
|
260
|
+
allChildren.forEach((childData) => {
|
|
261
|
+
if (childData.key === void 0) mergedChildren.push(childData);
|
|
262
|
+
else {
|
|
263
|
+
const childKey = childData.key;
|
|
264
|
+
const alreadyMerged = mergedChildren.find((dat) => dat.key === childKey);
|
|
265
|
+
if (alreadyMerged) return;
|
|
266
|
+
const toMerge = allChildren.filter((dat) => dat.key === childKey);
|
|
267
|
+
if (toMerge.length === 0) return;
|
|
268
|
+
const merged = mergeNodes(toMerge.map((dat) => dat.node));
|
|
269
|
+
mergedChildren.push({ node: merged, key: childKey });
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
const allAttributes = clones.reduce((attributes, node) => [
|
|
273
|
+
...Array.from(attributes),
|
|
274
|
+
...Array.from(node.attributes)
|
|
275
|
+
], []);
|
|
276
|
+
const outWrapper = clones[0]?.cloneNode() ?? document.createElement("div");
|
|
277
|
+
allAttributes.forEach((attr) => outWrapper.setAttribute(attr.name, attr.value));
|
|
278
|
+
outWrapper.append(...mergedChildren.map((e) => e.node));
|
|
279
|
+
return outWrapper;
|
|
280
|
+
}
|
|
281
|
+
Tree2.mergeNodes = mergeNodes;
|
|
282
|
+
function getInitialValueFromTypeName(name) {
|
|
283
|
+
const { document } = Window.get();
|
|
284
|
+
if (name === "null") return null;
|
|
285
|
+
if (name === "boolean") return false;
|
|
286
|
+
if (name === "number") return 0;
|
|
287
|
+
if (name === "string") return "";
|
|
288
|
+
if (name === "text") return document.createTextNode("");
|
|
289
|
+
if (name === "nodelist") return document.createDocumentFragment().childNodes;
|
|
290
|
+
if (name === "element") return document.createElement("div");
|
|
291
|
+
if (name === "array") return [];
|
|
292
|
+
if (name === "record") return {};
|
|
293
|
+
throw new Error(`Unknown value type name: ${name}`);
|
|
294
|
+
}
|
|
295
|
+
Tree2.getInitialValueFromTypeName = getInitialValueFromTypeName;
|
|
296
|
+
let TypeChecks;
|
|
297
|
+
((TypeChecks2) => {
|
|
298
|
+
function getType(value) {
|
|
299
|
+
if (singleTypeCheck(value, "null")) return "null";
|
|
300
|
+
if (singleTypeCheck(value, "boolean")) return "boolean";
|
|
301
|
+
if (singleTypeCheck(value, "number")) return "number";
|
|
302
|
+
if (singleTypeCheck(value, "string")) return "string";
|
|
303
|
+
if (singleTypeCheck(value, "element")) return "element";
|
|
304
|
+
if (singleTypeCheck(value, "text")) return "text";
|
|
305
|
+
if (singleTypeCheck(value, "nodelist")) return "nodelist";
|
|
306
|
+
if (singleTypeCheck(value, "transformer")) return "transformer";
|
|
307
|
+
if (singleTypeCheck(value, "method")) return "method";
|
|
308
|
+
if (singleTypeCheck(value, "array")) return "array";
|
|
309
|
+
if (singleTypeCheck(value, "record")) return "record";
|
|
310
|
+
return void 0;
|
|
311
|
+
}
|
|
312
|
+
TypeChecks2.getType = getType;
|
|
313
|
+
TypeChecks2.everyTypeName = [
|
|
314
|
+
"null",
|
|
315
|
+
"boolean",
|
|
316
|
+
"number",
|
|
317
|
+
"string",
|
|
318
|
+
"text",
|
|
319
|
+
"nodelist",
|
|
320
|
+
"element",
|
|
321
|
+
"transformer",
|
|
322
|
+
"method",
|
|
323
|
+
"array",
|
|
324
|
+
"record"
|
|
325
|
+
];
|
|
326
|
+
function singleTypeCheck(value, type) {
|
|
327
|
+
const { Element, Text, NodeList } = Window.get();
|
|
328
|
+
if (type === "null" && value === null) return true;
|
|
329
|
+
if (type === "boolean" && typeof value === "boolean") return true;
|
|
330
|
+
if (type === "number" && typeof value === "number") return true;
|
|
331
|
+
if (type === "string" && typeof value === "string") return true;
|
|
332
|
+
if (type === "element" && value instanceof Element) return true;
|
|
333
|
+
if (type === "text" && value instanceof Text) return true;
|
|
334
|
+
if (type === "nodelist" && value instanceof NodeList) {
|
|
335
|
+
const children = Array.from(value);
|
|
336
|
+
return children.every((child) => child instanceof Element || child instanceof Text);
|
|
337
|
+
}
|
|
338
|
+
if (type === "transformer" && value instanceof Transformer) return true;
|
|
339
|
+
if (type === "method" && value instanceof Method) return true;
|
|
340
|
+
if (type === "array" && Array.isArray(value)) {
|
|
341
|
+
const childrenOk = value.every((child) => typeCheck(child, ...TypeChecks2.everyTypeName).success);
|
|
342
|
+
return childrenOk;
|
|
343
|
+
}
|
|
344
|
+
if (type === "record" && isRecord(value)) {
|
|
345
|
+
const childrenOk = Object.values(value).every((child) => typeCheck(child, ...TypeChecks2.everyTypeName).success);
|
|
346
|
+
return childrenOk;
|
|
347
|
+
}
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
TypeChecks2.singleTypeCheck = singleTypeCheck;
|
|
351
|
+
function typeCheck(value, ...types) {
|
|
352
|
+
const matchesOneType = types.some((type) => singleTypeCheck(value, type));
|
|
353
|
+
if (matchesOneType) return Outcome.makeSuccess(value);
|
|
354
|
+
return Outcome.makeFailure({
|
|
355
|
+
expected: types.join(" | "),
|
|
356
|
+
found: getType(value) ?? "undefined"
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
TypeChecks2.typeCheck = typeCheck;
|
|
360
|
+
function typeCheckMany(values, ...types) {
|
|
361
|
+
for (const [pos, val] of Object.entries(values)) {
|
|
362
|
+
const checked = typeCheck(val, ...types);
|
|
363
|
+
if (checked.success) continue;
|
|
364
|
+
return Outcome.makeFailure({ position: parseInt(pos), ...checked.error });
|
|
365
|
+
}
|
|
366
|
+
return Outcome.makeSuccess(values);
|
|
367
|
+
}
|
|
368
|
+
TypeChecks2.typeCheckMany = typeCheckMany;
|
|
369
|
+
function typeCheckManyWithLength(values, minLength, maxLength, ...types) {
|
|
370
|
+
if (minLength !== void 0 && values.length < minLength) return Outcome.makeFailure({
|
|
371
|
+
position: values.length + 1,
|
|
372
|
+
expected: `min length: ${minLength}`,
|
|
373
|
+
found: `length: ${values.length}`
|
|
374
|
+
});
|
|
375
|
+
if (maxLength !== void 0 && values.length > maxLength) return Outcome.makeFailure({
|
|
376
|
+
position: maxLength + 1,
|
|
377
|
+
expected: `max length: ${maxLength}`,
|
|
378
|
+
found: `length: ${values.length}`
|
|
379
|
+
});
|
|
380
|
+
return typeCheckMany(values, ...types);
|
|
381
|
+
}
|
|
382
|
+
TypeChecks2.typeCheckManyWithLength = typeCheckManyWithLength;
|
|
383
|
+
TypeChecks2.isTreeMode = (name) => name === "isolation" || name === "coalescion";
|
|
384
|
+
TypeChecks2.isValueTypeName = (name) => {
|
|
385
|
+
const list = [
|
|
386
|
+
"null",
|
|
387
|
+
"boolean",
|
|
388
|
+
"number",
|
|
389
|
+
"string",
|
|
390
|
+
"text",
|
|
391
|
+
"nodelist",
|
|
392
|
+
"element",
|
|
393
|
+
"transformer",
|
|
394
|
+
"method",
|
|
395
|
+
"array",
|
|
396
|
+
"record"
|
|
397
|
+
];
|
|
398
|
+
return list.includes(name);
|
|
399
|
+
};
|
|
400
|
+
})(TypeChecks = Tree2.TypeChecks || (Tree2.TypeChecks = {}));
|
|
401
|
+
})(Tree = Utils2.Tree || (Utils2.Tree = {}));
|
|
402
|
+
let SmartTags;
|
|
403
|
+
((SmartTags2) => {
|
|
404
|
+
SmartTags2.expectEmptyArgs = (args) => {
|
|
405
|
+
if (args.length === 0) return Outcome.makeSuccess([]);
|
|
406
|
+
return Outcome.makeFailure({
|
|
407
|
+
expected: "length: 0",
|
|
408
|
+
found: `length: ${args.length}`
|
|
409
|
+
});
|
|
410
|
+
};
|
|
411
|
+
SmartTags2.makeMainValueError = (expected, found, details) => ({
|
|
412
|
+
expected,
|
|
413
|
+
found,
|
|
414
|
+
details
|
|
415
|
+
});
|
|
416
|
+
SmartTags2.makeArgsValueError = (expected, found, position, details) => ({
|
|
417
|
+
expected,
|
|
418
|
+
found,
|
|
419
|
+
position,
|
|
420
|
+
details
|
|
421
|
+
});
|
|
422
|
+
SmartTags2.makeTransformationError = (details) => ({
|
|
423
|
+
details
|
|
424
|
+
});
|
|
425
|
+
})(SmartTags = Utils2.SmartTags || (Utils2.SmartTags = {}));
|
|
426
|
+
})(Utils || (Utils = {}));
|
|
23
427
|
export {
|
|
24
428
|
Utils
|
|
25
429
|
};
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// src/agnostic/html/insert-node/index.ts
|
|
2
|
+
function insertNode(node, position, reference) {
|
|
3
|
+
if (position === "after") {
|
|
4
|
+
if (reference.nextSibling !== null) reference.parentNode?.insertBefore(node, reference.nextSibling);
|
|
5
|
+
else reference.parentNode?.appendChild(node);
|
|
6
|
+
} else if (position === "before") {
|
|
7
|
+
reference.parentNode?.insertBefore(node, reference);
|
|
8
|
+
} else if (position === "startof") {
|
|
9
|
+
if (reference.firstChild !== null) reference.insertBefore(node, reference.firstChild);
|
|
10
|
+
else reference.appendChild(node);
|
|
11
|
+
} else {
|
|
12
|
+
reference.appendChild(node);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
5
15
|
export {
|
|
6
16
|
insertNode
|
|
7
17
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "../../../chunks/chunk-XCBH6NLF.js";
|
|
2
|
-
|
|
3
1
|
// src/agnostic/html/placeholders/index.ts
|
|
4
2
|
var EightKiloByteOfLoremIpsumSentences = "Etiam consequat interdum elit eu interdum. Nunc eu nulla vel arcu mattis venenatis sit amet gravida sem. Mauris pretium aliquam augue vitae tempor. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nam mollis in ipsum nec efficitur. Nullam imperdiet et urna vitae suscipit. In hac habitasse platea dictumst. Nullam lacinia commodo enim non iaculis. Nam elementum tellus ac lectus aliquam porta. Mauris ut lorem nec magna porttitor efficitur sed sed odio. Ut in dapibus nulla, non eleifend elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Maecenas posuere leo neque, a luctus quam feugiat in. Phasellus lobortis egestas cursus. In sit amet massa et sem scelerisque facilisis quis fringilla felis. Praesent purus velit, vehicula id orci ac, placerat congue quam. Cras vulputate nisi eu justo accumsan malesuada. Vestibulum ex urna, volutpat non quam in, vulputate pellentesque est. Pellentesque interdum orci in quam finibus faucibus. In eget lectus augue. Vestibulum lobortis vulputate odio. Nam vitae felis in lorem dignissim venenatis. Curabitur bibendum, est quis tempor efficitur, magna orci facilisis erat, id rhoncus massa ante non tellus. Etiam id gravida elit. Mauris ut semper risus. Nulla sed interdum lorem. Nullam eu consectetur purus. Praesent ut enim diam. Nulla hendrerit dapibus eros, sit amet rhoncus eros consequat aliquam. Duis viverra erat vel commodo facilisis. Quisque hendrerit posuere sapien, id cursus ligula rhoncus vitae. Ut et turpis augue. Aliquam augue lorem, fringilla at magna eu, egestas sagittis ex. Vestibulum elementum diam facilisis elit ultrices, eget viverra massa venenatis. Nullam finibus ligula est. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nam condimentum, justo pulvinar posuere tincidunt, mi libero convallis sapien, id consectetur nunc tellus eget nisi. Fusce tincidunt sit amet enim vitae feugiat. Etiam in nulla vitae orci consequat vulputate. Vestibulum sodales urna sit amet velit elementum, vel fringilla eros iaculis. Vestibulum gravida tempus nulla, at vulputate nunc aliquam vitae. Phasellus ac augue et augue finibus congue ut nec nunc. Ut in dictum lectus, eget efficitur dui. Suspendisse bibendum congue arcu, sit amet maximus felis dictum sit amet. Morbi scelerisque feugiat risus, id pellentesque elit cursus nec. Vivamus at erat id magna sagittis cursus vitae eu magna. Integer pretium nec lorem at consectetur. Integer id justo vitae nunc gravida posuere eu vel magna. Donec ex nunc, condimentum id laoreet et, scelerisque nec enim. Sed venenatis, augue vel posuere ullamcorper, lorem velit auctor erat, a auctor mi odio id velit. Donec justo erat, tempor ut diam sed, scelerisque aliquam dolor. Donec erat dui, dictum a tortor sit amet, pellentesque blandit risus. Donec tincidunt ligula ex, vel tincidunt leo posuere sit amet. Curabitur lacinia blandit pellentesque. Donec fringilla aliquam purus ac porta. Fusce faucibus convallis leo, ut aliquet libero maximus nec. Morbi ac magna lorem. Quisque suscipit quis nisi interdum condimentum. Pellentesque imperdiet lorem diam, eu molestie ipsum scelerisque vel. Vivamus hendrerit, ipsum id sollicitudin pharetra, justo justo laoreet lorem, ac scelerisque turpis justo vitae augue. Nullam lacinia magna nec neque auctor scelerisque. Nunc sit amet lacus condimentum, interdum nisl eu, pharetra lorem. Morbi consectetur eros ac nisi facilisis, facilisis placerat magna aliquet. Donec bibendum leo ac est aliquam dictum. Quisque commodo magna risus, ut rhoncus ex feugiat nec. Sed vel tellus porta, feugiat sem quis, facilisis enim. Quisque accumsan imperdiet felis id laoreet. Etiam condimentum at ligula nec vehicula. Phasellus eget placerat quam. Cras efficitur mauris id ex tempus porttitor. Quisque pulvinar tellus id tempus ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In non erat justo. Nulla blandit placerat hendrerit. Sed blandit mattis magna eget sodales. Morbi eget accumsan sapien. Sed ornare interdum tortor iaculis volutpat. Maecenas vel tortor quis urna placerat mollis. Mauris ultrices, magna sit amet molestie sagittis, libero mi tincidunt diam, eu scelerisque nulla est vel dolor. Aenean congue congue eros bibendum elementum. Phasellus lobortis faucibus eros, et cursus lectus ultricies et. Vivamus augue metus, iaculis eget egestas in, tincidunt et lectus. Mauris varius arcu at cursus auctor. Curabitur eget nunc tellus. In eget tempor odio, vitae dictum massa. Proin in cursus est. Curabitur lobortis, velit eu accumsan sollicitudin, orci orci aliquam velit, ac iaculis massa justo sit amet massa. Duis a mauris iaculis, aliquam ipsum vel, vulputate mauris. Sed ex augue, cursus a dapibus sed, iaculis lacinia quam. Vivamus sit amet justo tellus. Nunc ac neque mattis, euismod velit id, feugiat massa. Etiam vitae auctor orci. Pellentesque sollicitudin est nibh, vitae scelerisque lacus sagittis eu. Morbi convallis metus eu enim gravida, non finibus enim accumsan. In quis pharetra justo, et tempor nibh. Duis non interdum diam. Vestibulum nec felis rhoncus, pharetra ipsum eu, rutrum magna. Integer dignissim odio eu mi finibus sollicitudin. Sed ut magna a nulla porttitor lobortis in id nibh. Pellentesque in lobortis ligula, vel malesuada neque. Aenean commodo arcu nunc, et posuere eros vulputate et. Mauris vestibulum euismod molestie. Vestibulum luctus sapien sollicitudin, cursus ante vel, varius massa. Mauris non magna pharetra, luctus felis sed, dapibus massa. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec posuere sapien diam, vitae porttitor nisi dictum sed. Maecenas sit amet eleifend odio. In luctus, neque eget eleifend ultricies, neque ante vestibulum leo, non ullamcorper enim orci vestibulum erat. Phasellus bibendum urna at aliquet elementum. Nulla facilisi. Sed porttitor lacus id hendrerit iaculis. Vivamus facilisis ex eget odio malesuada bibendum. Vestibulum fermentum at sem nec dignissim. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nunc faucibus augue id odio ornare, et maximus quam placerat. Nullam rutrum enim justo, id hendrerit felis faucibus sed. Aenean id nulla arcu. Nulla vitae eleifend ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Quisque ipsum risus, cursus at ligula convallis, interdum fringilla quam. Curabitur libero sapien, mollis in consectetur sit amet, accumsan vel justo. Nulla a eros sit amet nibh pharetra ultricies. Proin et dapibus mauris. Maecenas at lacinia felis. Vestibulum consectetur vestibulum ante. Interdum et malesuada fames ac ante ipsum primis in faucibus. In imperdiet ipsum ac facilisis interdum. Nullam vestibulum dictum vestibulum. Cras pharetra vehicula neque.".split(".").map((e) => e.trim());
|
|
5
3
|
var generateSentence = () => {
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getNodeAncestors
|
|
3
|
-
} from "../../../chunks/chunk-3MPXVP4L.js";
|
|
4
|
-
import "../../../chunks/chunk-ROWPCMQY.js";
|
|
5
|
-
import "../../../chunks/chunk-XCBH6NLF.js";
|
|
6
|
-
|
|
7
1
|
// src/agnostic/html/replace-in-element/index.ts
|
|
2
|
+
import { getNodeAncestors } from "../get-node-ancestors/index.js";
|
|
8
3
|
function replaceInElement(inputElement, replaceMap) {
|
|
9
4
|
const actualReplaceMap = new Map(Array.from(replaceMap).filter(([toReplace]) => {
|
|
10
5
|
const toReplaceAncestors = getNodeAncestors(toReplace);
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
get
|
|
3
|
-
} from "../../../chunks/chunk-ROWPCMQY.js";
|
|
4
|
-
import "../../../chunks/chunk-XCBH6NLF.js";
|
|
5
|
-
|
|
6
1
|
// src/agnostic/html/selector-to-element/index.ts
|
|
2
|
+
import * as Window from "../../misc/crossenv/window/index.js";
|
|
7
3
|
function selectorToElement(selector) {
|
|
8
4
|
const tagRegexp = /^[A-Za-z]+/;
|
|
9
5
|
const idRegexp = /#[A-Za-z]+[\w\-\:]*/;
|
|
@@ -17,7 +13,7 @@ function selectorToElement(selector) {
|
|
|
17
13
|
const id = matchedIds.length > 0 ? matchedIds[matchedIds.length - 1]?.replace(/^#/, "") : null;
|
|
18
14
|
const classes = matchedClasses.map((matchedClass) => matchedClass.replace(/^\./, ""));
|
|
19
15
|
const attributes = matchedAttrs.map((matchedAttr) => matchedAttr.replace(/^\[/, "").replace(/\]$/, "").split("="));
|
|
20
|
-
const element = get().document.createElement(tag);
|
|
16
|
+
const element = Window.get().document.createElement(tag);
|
|
21
17
|
if (id !== null) {
|
|
22
18
|
element.id = id;
|
|
23
19
|
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
get
|
|
3
|
-
} from "../../../chunks/chunk-ROWPCMQY.js";
|
|
4
|
-
import "../../../chunks/chunk-XCBH6NLF.js";
|
|
5
|
-
|
|
6
1
|
// src/agnostic/html/string-to-nodes/index.ts
|
|
2
|
+
import * as Window from "../../misc/crossenv/window/index.js";
|
|
7
3
|
function stringToNodes(inputStr) {
|
|
8
|
-
const window = get();
|
|
4
|
+
const window = Window.get();
|
|
9
5
|
const { document, Node } = window;
|
|
10
6
|
const wrapperDiv = document.createElement("div");
|
|
11
7
|
wrapperDiv.innerHTML = inputStr;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
unknownToString
|
|
3
|
-
} from "../../../chunks/chunk-FENXVJYO.js";
|
|
4
|
-
import {
|
|
5
|
-
makeFailure,
|
|
6
|
-
makeSuccess
|
|
7
|
-
} from "../../../chunks/chunk-QEKI6WGQ.js";
|
|
8
|
-
import "../../../chunks/chunk-XCBH6NLF.js";
|
|
9
|
-
|
|
10
1
|
// src/agnostic/misc/assert/index.ts
|
|
2
|
+
import { unknownToString } from "../../errors/unknown-to-string/index.js";
|
|
3
|
+
import * as Outcome from "../outcome/index.js";
|
|
11
4
|
function makeSuccess2(label) {
|
|
12
5
|
const formattedLabel = label.split("\n").join("\n ");
|
|
13
6
|
console.info(`\u2705 SUCCESS:
|
|
@@ -19,15 +12,15 @@ function makeFailure2(label) {
|
|
|
19
12
|
${formattedLabel}`);
|
|
20
13
|
}
|
|
21
14
|
async function assert(label, assertion) {
|
|
22
|
-
if (typeof assertion === "boolean") return assertion ? makeSuccess(label) : makeFailure(label);
|
|
15
|
+
if (typeof assertion === "boolean") return assertion ? Outcome.makeSuccess(label) : Outcome.makeFailure(label);
|
|
23
16
|
else if (typeof assertion === "function") {
|
|
24
17
|
try {
|
|
25
18
|
const result = await assertion();
|
|
26
|
-
if (result === false) return makeFailure(label);
|
|
27
|
-
else return makeSuccess(label);
|
|
19
|
+
if (result === false) return Outcome.makeFailure(label);
|
|
20
|
+
else return Outcome.makeSuccess(label);
|
|
28
21
|
} catch (err) {
|
|
29
22
|
const errStr = unknownToString(err);
|
|
30
|
-
return makeFailure(`${label} / ${errStr}`);
|
|
23
|
+
return Outcome.makeFailure(`${label} / ${errStr}`);
|
|
31
24
|
}
|
|
32
25
|
} else {
|
|
33
26
|
let assertions;
|
|
@@ -44,10 +37,10 @@ async function assert(label, assertion) {
|
|
|
44
37
|
return asserted;
|
|
45
38
|
}));
|
|
46
39
|
const allSuccess = allAsserted.every((asserted) => asserted.success);
|
|
47
|
-
if (allSuccess) return makeSuccess(allAsserted.map((e) => e.payload).join("\n"));
|
|
40
|
+
if (allSuccess) return Outcome.makeSuccess(allAsserted.map((e) => e.payload).join("\n"));
|
|
48
41
|
const failures = allAsserted.filter((asserted) => asserted.success === false);
|
|
49
42
|
const failuresStr = failures.map((failure) => failure.error).join("\n ");
|
|
50
|
-
return makeFailure(failuresStr);
|
|
43
|
+
return Outcome.makeFailure(failuresStr);
|
|
51
44
|
}
|
|
52
45
|
}
|
|
53
46
|
async function assertVerbose(label, assertion) {
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isFalsy
|
|
3
|
-
} from "../../../chunks/chunk-QXAJXTXV.js";
|
|
4
|
-
import "../../../chunks/chunk-HC6ZOHCS.js";
|
|
5
|
-
import "../../../chunks/chunk-XCBH6NLF.js";
|
|
6
|
-
|
|
7
1
|
// src/agnostic/misc/cast/index.ts
|
|
2
|
+
import { isFalsy } from "../../booleans/is-falsy/index.js";
|
|
8
3
|
function toBoolean(value) {
|
|
9
4
|
if (typeof value === "boolean") return value;
|
|
10
5
|
if (typeof value === "string") {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
get
|
|
3
|
-
} from "../../../chunks/chunk-ROWPCMQY.js";
|
|
4
|
-
import "../../../chunks/chunk-XCBH6NLF.js";
|
|
5
|
-
|
|
6
1
|
// src/agnostic/misc/connection/index.ts
|
|
2
|
+
import * as Window from "../crossenv/window/index.js";
|
|
7
3
|
function isType(unk) {
|
|
8
4
|
return unk === "bluetooth" || unk === "cellular" || unk === "ethernet" || unk === "none" || unk === "wifi" || unk === "wimax" || unk === "other" || unk === "unknown";
|
|
9
5
|
}
|
|
@@ -23,7 +19,7 @@ function isConnection(unk) {
|
|
|
23
19
|
return true;
|
|
24
20
|
}
|
|
25
21
|
function getConnection() {
|
|
26
|
-
const window = get();
|
|
22
|
+
const window = Window.get();
|
|
27
23
|
const navigator = window.navigator;
|
|
28
24
|
if (typeof navigator !== "object" || navigator === null) return void 0;
|
|
29
25
|
const connection = navigator.connection ?? navigator.mozConnection ?? navigator.webkitConnection;
|