@design-edito/tools 0.3.9 → 0.3.10
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/index.d.ts +1 -1
- package/agnostic/arrays/index.js +1 -1
- package/agnostic/arrays/is-array-of/index.d.ts +1 -1
- package/agnostic/arrays/is-array-of/index.js +2 -2
- package/agnostic/booleans/is-falsy/index.d.ts +1 -1
- package/agnostic/colors/channels/index.d.ts +1 -1
- package/agnostic/colors/contrast/index.d.ts +1 -1
- package/agnostic/colors/convert/index.d.ts +1 -1
- package/agnostic/colors/convert/index.js +14 -17
- package/agnostic/colors/cssColorsMap.d.ts +9 -0
- package/agnostic/colors/distance/index.d.ts +1 -1
- package/agnostic/colors/index.d.ts +3 -3
- package/agnostic/colors/index.js +3 -3
- package/agnostic/colors/invert/index.d.ts +1 -1
- package/agnostic/colors/luminance/index.d.ts +1 -1
- package/agnostic/colors/palette/index.js +2 -0
- package/agnostic/colors/tidy/index.js +2 -1
- package/agnostic/colors/typechecks/index.d.ts +1 -1
- package/agnostic/colors/typechecks/index.js +1 -3
- package/agnostic/colors/types.d.ts +0 -7
- package/agnostic/colors/types.js +0 -154
- package/agnostic/css/bem/index.d.ts +3 -3
- package/agnostic/css/bem/index.js +6 -5
- package/agnostic/css/clss/index.d.ts +2 -1
- package/agnostic/css/clss/index.js +2 -2
- package/agnostic/css/generate-nice-color/index.js +1 -0
- package/agnostic/css/index.d.ts +2 -2
- package/agnostic/css/index.js +2 -2
- package/agnostic/css/styles-set/index.d.ts +4 -4
- package/agnostic/css/styles-set/index.js +1 -1
- package/agnostic/errors/register/index.js +4 -2
- package/agnostic/html/get-node-ancestors/index.js +1 -1
- package/agnostic/html/get-position-inside-parent/index.js +1 -1
- package/agnostic/html/hyper-json/cast/index.d.ts +1 -1
- package/agnostic/html/hyper-json/method/index.d.ts +2 -2
- package/agnostic/html/hyper-json/serialize/index.d.ts +1 -1
- package/agnostic/html/hyper-json/serialize/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +5 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +5 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjparse/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/hjstringify/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.d.ts +16 -16
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +16 -16
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +7 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +7 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +9 -9
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +0 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/any/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/array/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/index.d.ts +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/null/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.d.ts +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +3 -1
- package/agnostic/html/hyper-json/transformer/index.d.ts +2 -2
- package/agnostic/html/hyper-json/transformer/index.js +6 -9
- package/agnostic/html/hyper-json/tree/index.d.ts +1 -1
- package/agnostic/html/hyper-json/tree/index.js +14 -10
- package/agnostic/html/hyper-json/types/index.d.ts +9 -13
- package/agnostic/html/hyper-json/utils/index.d.ts +7 -7
- package/agnostic/html/hyper-json/utils/index.js +1 -1
- package/agnostic/html/index.d.ts +1 -1
- package/agnostic/html/index.js +1 -1
- package/agnostic/html/placeholders/index.d.ts +1 -1
- package/agnostic/html/selector-to-element/index.js +1 -1
- package/agnostic/index.d.ts +6 -6
- package/agnostic/index.js +6 -6
- package/agnostic/misc/assert/index.d.ts +2 -2
- package/agnostic/misc/assert/index.js +4 -4
- package/agnostic/misc/cast/index.d.ts +1 -1
- package/agnostic/misc/connection/index.js +0 -1
- package/agnostic/misc/crawler/index.d.ts +2 -2
- package/agnostic/misc/crossenv/detect-runtime/index.js +4 -4
- package/agnostic/misc/crossenv/window/index.d.ts +1 -1
- package/agnostic/misc/crossenv/window/index.js +2 -2
- package/agnostic/misc/data-size/index.js +2 -2
- package/agnostic/misc/index.d.ts +5 -5
- package/agnostic/misc/index.js +5 -5
- package/agnostic/misc/is-constructor-function/index.d.ts +1 -1
- package/agnostic/misc/logs/index.d.ts +1 -1
- package/agnostic/misc/logs/index.js +1 -1
- package/agnostic/misc/logs/logger/index.d.ts +1 -1
- package/agnostic/misc/outcome/index.d.ts +7 -7
- package/agnostic/numbers/approximate-rational/index.js +4 -2
- package/agnostic/numbers/index.d.ts +3 -3
- package/agnostic/numbers/index.js +3 -3
- package/agnostic/objects/deep-get-property/index.js +2 -2
- package/agnostic/objects/flatten-getters/index.js +2 -1
- package/agnostic/objects/index.d.ts +4 -3
- package/agnostic/objects/index.js +4 -3
- package/agnostic/objects/record-format/index.js +1 -0
- package/agnostic/objects/sort-keys/index.d.ts +11 -0
- package/agnostic/objects/sort-keys/index.js +12 -0
- package/agnostic/objects/sort-keys/index.test.d.ts +1 -0
- package/agnostic/optim/memoize/index.js +1 -1
- package/agnostic/optim/throttle-debounce/index.d.ts +12 -10
- package/agnostic/optim/throttle-debounce/index.js +2 -2
- package/agnostic/optim/throttle-debounce/types.d.ts +1 -1
- package/agnostic/random/index.d.ts +1 -1
- package/agnostic/random/index.js +1 -1
- package/agnostic/random/random/index.js +1 -1
- package/agnostic/sanitization/html/index.js +7 -7
- package/agnostic/sanitization/index.d.ts +2 -2
- package/agnostic/sanitization/index.js +2 -2
- package/agnostic/sanitization/types.d.ts +2 -6
- package/agnostic/strings/char-codes/index.d.ts +5 -5
- package/agnostic/strings/char-codes/index.js +2 -2
- package/agnostic/strings/index.d.ts +2 -2
- package/agnostic/strings/index.js +2 -2
- package/agnostic/strings/matches/index.d.ts +2 -2
- package/agnostic/time/dates/format-date/index.js +23 -9
- package/agnostic/time/duration/index.d.ts +23 -2
- package/agnostic/time/duration/index.js +36 -4
- package/agnostic/time/index.d.ts +2 -2
- package/agnostic/time/index.js +2 -2
- package/agnostic/time/timeout/index.js +2 -2
- package/agnostic/time/wait/index.d.ts +2 -2
- package/agnostic/time/wait/index.js +1 -1
- package/components/EventListener/index.d.ts +2 -2
- package/components/EventListener/index.js +8 -8
- package/components/Input/index.d.ts +2 -2
- package/components/IntersectionObserver/index.d.ts +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/node/@aws-s3/storage/directory/copy-dir/index.d.ts +2 -2
- package/node/@aws-s3/storage/directory/copy-dir/index.js +3 -3
- package/node/@aws-s3/storage/directory/list/index.d.ts +2 -2
- package/node/@aws-s3/storage/directory/list/index.js +1 -1
- package/node/@aws-s3/storage/directory/move-dir/index.d.ts +3 -3
- package/node/@aws-s3/storage/directory/move-dir/index.js +3 -3
- package/node/@aws-s3/storage/directory/remove-dir/index.d.ts +2 -2
- package/node/@aws-s3/storage/directory/remove-dir/index.js +4 -4
- package/node/@aws-s3/storage/file/copy/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/download/index.d.ts +3 -3
- package/node/@aws-s3/storage/file/exists/index.d.ts +2 -2
- package/node/@aws-s3/storage/file/exists/index.js +1 -2
- package/node/@aws-s3/storage/file/index.d.ts +3 -3
- package/node/@aws-s3/storage/file/index.js +3 -3
- package/node/@aws-s3/storage/file/move/index.d.ts +2 -2
- package/node/@aws-s3/storage/file/remove/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/stat/index.d.ts +1 -1
- package/node/@aws-s3/storage/file/upload/index.d.ts +2 -2
- package/node/@aws-s3/storage/index.d.ts +1 -1
- package/node/@aws-s3/storage/index.js +1 -1
- package/node/@express/@multer/index.d.ts +1 -1
- package/node/@google-cloud/storage/bucket/get-metadata/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/copy-dir/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/index.js +1 -1
- package/node/@google-cloud/storage/directory/list/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/move-dir/index.d.ts +1 -1
- package/node/@google-cloud/storage/directory/remove-dir/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/copy/index.d.ts +2 -2
- package/node/@google-cloud/storage/file/download/index.d.ts +2 -2
- package/node/@google-cloud/storage/file/exists/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/generate-signed-url/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/get-metadata/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/get-permissions/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/index.d.ts +4 -4
- package/node/@google-cloud/storage/file/index.js +4 -4
- package/node/@google-cloud/storage/file/move/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/remove/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.d.ts +4 -4
- package/node/@google-cloud/storage/file/stat/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/stat/index.js +2 -2
- package/node/@google-cloud/storage/file/update-metadata/index.d.ts +1 -1
- package/node/@google-cloud/storage/file/upload/index.d.ts +2 -2
- package/node/@google-cloud/storage/index.d.ts +1 -1
- package/node/@google-cloud/storage/index.js +1 -1
- package/node/cloud-storage/operations/copy-dir/index.d.ts +8 -8
- package/node/cloud-storage/operations/copy-dir/index.js +4 -4
- package/node/cloud-storage/operations/copy-file/index.d.ts +8 -8
- package/node/cloud-storage/operations/copy-file/index.js +4 -4
- package/node/cloud-storage/operations/download-file/index.d.ts +9 -9
- package/node/cloud-storage/operations/download-file/index.js +4 -4
- package/node/cloud-storage/operations/exists-file/index.d.ts +6 -6
- package/node/cloud-storage/operations/exists-file/index.js +4 -4
- package/node/cloud-storage/operations/index.d.ts +2 -2
- package/node/cloud-storage/operations/index.js +2 -2
- package/node/cloud-storage/operations/list-dir/index.d.ts +6 -6
- package/node/cloud-storage/operations/list-dir/index.js +4 -4
- package/node/cloud-storage/operations/move-dir/index.d.ts +8 -8
- package/node/cloud-storage/operations/move-dir/index.js +4 -4
- package/node/cloud-storage/operations/move-file/index.d.ts +8 -8
- package/node/cloud-storage/operations/move-file/index.js +4 -4
- package/node/cloud-storage/operations/remove-dir/index.d.ts +8 -8
- package/node/cloud-storage/operations/remove-dir/index.js +4 -4
- package/node/cloud-storage/operations/remove-file/index.d.ts +8 -8
- package/node/cloud-storage/operations/remove-file/index.js +4 -4
- package/node/cloud-storage/operations/stat-file/index.d.ts +8 -8
- package/node/cloud-storage/operations/stat-file/index.js +4 -4
- package/node/cloud-storage/operations/upload-file/index.d.ts +9 -9
- package/node/cloud-storage/operations/upload-file/index.js +4 -4
- package/node/files/index.d.ts +1 -1
- package/node/files/index.js +1 -1
- package/node/files/read-write/index.js +1 -1
- package/node/files/subpaths/index.d.ts +3 -3
- package/node/files/subpaths/index.js +6 -6
- package/node/ftps/directory/copy-dir/index.d.ts +1 -1
- package/node/ftps/directory/copy-dir/index.js +1 -1
- package/node/ftps/directory/list/index.d.ts +1 -1
- package/node/ftps/directory/move-dir/index.d.ts +1 -1
- package/node/ftps/directory/move-dir/index.js +1 -3
- package/node/ftps/directory/remove-dir/index.d.ts +2 -2
- package/node/ftps/file/copy/index.d.ts +1 -1
- package/node/ftps/file/copy/index.js +1 -1
- package/node/ftps/file/download/index.d.ts +2 -2
- package/node/ftps/file/exists/index.d.ts +2 -2
- package/node/ftps/file/exists/index.js +1 -1
- package/node/ftps/file/index.d.ts +2 -2
- package/node/ftps/file/index.js +2 -2
- package/node/ftps/file/move/index.d.ts +3 -3
- package/node/ftps/file/move/index.js +1 -1
- package/node/ftps/file/remove/index.d.ts +1 -1
- package/node/ftps/file/stat/index.d.ts +1 -1
- package/node/ftps/file/stat/index.js +2 -2
- package/node/ftps/file/upload/index.d.ts +2 -2
- package/node/images/format/index.d.ts +1 -1
- package/node/images/format/index.js +9 -9
- package/node/images/index.d.ts +2 -2
- package/node/images/index.js +2 -2
- package/node/images/metadata/index.d.ts +1 -1
- package/node/images/metadata/index.js +1 -1
- package/node/images/transform/index.d.ts +2 -2
- package/node/images/transform/index.js +26 -21
- package/node/images/transform/operations/blur/index.d.ts +1 -1
- package/node/images/transform/operations/brighten/index.d.ts +1 -1
- package/node/images/transform/operations/extend/index.d.ts +1 -1
- package/node/images/transform/operations/extract/index.d.ts +1 -1
- package/node/images/transform/operations/flatten/index.d.ts +1 -1
- package/node/images/transform/operations/flatten/index.js +1 -1
- package/node/images/transform/operations/flip/index.d.ts +1 -1
- package/node/images/transform/operations/flop/index.d.ts +1 -1
- package/node/images/transform/operations/hue/index.d.ts +1 -1
- package/node/images/transform/operations/index.d.ts +5 -5
- package/node/images/transform/operations/index.js +5 -5
- package/node/images/transform/operations/level/index.d.ts +1 -1
- package/node/images/transform/operations/lighten/index.d.ts +1 -1
- package/node/images/transform/operations/normalize/index.d.ts +1 -1
- package/node/images/transform/operations/overlay/index.js +1 -1
- package/node/images/transform/operations/resize/index.d.ts +1 -1
- package/node/images/transform/operations/rotate/index.d.ts +1 -1
- package/node/images/transform/operations/saturate/index.d.ts +1 -1
- package/node/index.d.ts +3 -3
- package/node/index.js +3 -3
- package/node/process/prompt-continue/index.js +1 -1
- package/node/process/spawner/index.d.ts +1 -9
- package/node/process/spawner/index.js +10 -8
- package/node/sftp/directory/copy-dir/index.d.ts +2 -1
- package/node/sftp/directory/copy-dir/index.js +2 -2
- package/node/sftp/directory/index.d.ts +1 -1
- package/node/sftp/directory/index.js +1 -1
- package/node/sftp/directory/list/index.d.ts +1 -1
- package/node/sftp/directory/move-dir/index.d.ts +1 -1
- package/node/sftp/directory/move-dir/index.js +2 -4
- package/node/sftp/directory/remove-dir/index.d.ts +2 -2
- package/node/sftp/file/copy/index.d.ts +2 -1
- package/node/sftp/file/copy/index.js +2 -2
- package/node/sftp/file/download/index.d.ts +3 -3
- package/node/sftp/file/exists/index.d.ts +1 -1
- package/node/sftp/file/index.d.ts +3 -3
- package/node/sftp/file/index.js +3 -3
- package/node/sftp/file/move/index.d.ts +3 -3
- package/node/sftp/file/move/index.js +3 -5
- package/node/sftp/file/remove/index.d.ts +1 -1
- package/node/sftp/file/remove/index.js +1 -1
- package/node/sftp/file/stat/index.d.ts +1 -1
- package/node/sftp/file/stat/index.js +1 -1
- package/node/sftp/file/upload/index.d.ts +3 -2
- package/node/sftp/file/upload/index.js +1 -1
- package/package.json +1244 -10
|
@@ -9,7 +9,7 @@ function getNodeAncestors(node, traverseShadowRoots) {
|
|
|
9
9
|
const parentNode = currentNode.parentNode;
|
|
10
10
|
if (parentNode instanceof ShadowRoot) {
|
|
11
11
|
returned.push(parentNode);
|
|
12
|
-
currentNode = traverseShadowRoots ? parentNode.host : null;
|
|
12
|
+
currentNode = traverseShadowRoots === true ? parentNode.host : null;
|
|
13
13
|
continue;
|
|
14
14
|
}
|
|
15
15
|
currentNode = currentNode.parentElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/agnostic/html/get-position-inside-parent/index.ts
|
|
2
2
|
function getPositionInsideParent(node) {
|
|
3
|
-
if (
|
|
3
|
+
if (node.parentNode === null) return null;
|
|
4
4
|
const childNodes = Array.from(node.parentNode.childNodes);
|
|
5
5
|
return childNodes.indexOf(node);
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Transformer } from '../transformer/index.js';
|
|
2
|
-
import { Types } from '../types/index.js';
|
|
1
|
+
import { type Transformer } from '../transformer/index.js';
|
|
2
|
+
import { type Types } from '../types/index.js';
|
|
3
3
|
export declare class Method<Main extends Types.Tree.RestingValue = Types.Tree.RestingValue, Args extends Types.Tree.RestingArrayValue = Types.Tree.RestingArrayValue, Output extends Types.Tree.RestingValue = Types.Tree.RestingValue> {
|
|
4
4
|
transformer: Transformer<Main, Args, Output>;
|
|
5
5
|
static clone<Main extends Types.Tree.RestingValue, Args extends Types.Tree.RestingArrayValue, Output extends Types.Tree.RestingValue>(method: Method<Main, Args, Output>): Method<Main, Args, Output>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../types/index.js';
|
|
1
|
+
import { type Types } from '../types/index.js';
|
|
2
2
|
export declare namespace Serialize {
|
|
3
3
|
function serialize(value: Types.Tree.Value): Types.Tree.Serialized;
|
|
4
4
|
function deserialize(serialized: Types.Tree.Serialized): Types.Tree.Value;
|
|
@@ -46,7 +46,7 @@ var Serialize;
|
|
|
46
46
|
return frag.childNodes;
|
|
47
47
|
}
|
|
48
48
|
if (serialized.type === "array") {
|
|
49
|
-
|
|
49
|
+
const toRet = [];
|
|
50
50
|
for (const val of serialized.value) {
|
|
51
51
|
const deserialized = deserialize(val);
|
|
52
52
|
if (deserialized instanceof Transformer) continue;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const and: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, Types.Tree.RestingArrayValue, boolean>];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Main = string | Text | NodeListOf<Element | Text> | Element | Types.Tree.RestingArrayValue;
|
|
3
3
|
type Args = Array<string | Text | NodeListOf<Element | Text> | Element | Types.Tree.RestingArrayValue>;
|
|
4
4
|
type Output = string | Text | NodeListOf<Element | Text> | Element | Types.Tree.RestingArrayValue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Main = string | Text | Types.Tree.RestingArrayValue | NodeListOf<Element | Text>;
|
|
3
3
|
type Args = [number | string | Text];
|
|
4
4
|
export declare const at: [string, Types.SmartTags.SmartTag<Main, Args, Types.Tree.RestingValue>];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Main = Types.Tree.MethodValue | Types.Tree.MethodValue[];
|
|
3
3
|
export declare const call: [string, Types.SmartTags.SmartTag<Main, Types.Tree.RestingArrayValue, Types.Tree.RestingValue>];
|
|
4
4
|
export {};
|
|
@@ -22,7 +22,7 @@ var call = SmartTags.makeSmartTag({
|
|
|
22
22
|
},
|
|
23
23
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "array"),
|
|
24
24
|
func: (main, args) => {
|
|
25
|
-
const { makeFailure
|
|
25
|
+
const { makeFailure } = Outcome;
|
|
26
26
|
const { makeTransformationError } = Utils.SmartTags;
|
|
27
27
|
return makeFailure(makeTransformationError({
|
|
28
28
|
message: "This smart tag should not be used."
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const clone: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, [], Types.Tree.RestingValue>];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Args = Array<string | Text>;
|
|
3
3
|
export declare const deleteproperties: [string, Types.SmartTags.SmartTag<Types.Tree.RestingRecordValue, Args, Types.Tree.RestingRecordValue>];
|
|
4
4
|
export {};
|
|
@@ -34,8 +34,11 @@ function deepDeleteProperty(record, pathString) {
|
|
|
34
34
|
if (isLast) delete currentRecord[chunk];
|
|
35
35
|
else {
|
|
36
36
|
const found = currentRecord[chunk];
|
|
37
|
-
if (isRecord(found))
|
|
38
|
-
|
|
37
|
+
if (isRecord(found)) {
|
|
38
|
+
currentRecord = found;
|
|
39
|
+
} else {
|
|
40
|
+
throw "Not a record";
|
|
41
|
+
}
|
|
39
42
|
}
|
|
40
43
|
});
|
|
41
44
|
return cloned;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const equals: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, [Types.Tree.RestingValue, ...Types.Tree.RestingValue[]], boolean>];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Args = Array<string | Text>;
|
|
3
3
|
export declare const getproperties: [string, Types.SmartTags.SmartTag<Types.Tree.RestingRecordValue, Args, Types.Tree.RestingRecordValue>];
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Args = [string | Text];
|
|
3
3
|
export declare const getproperty: [string, Types.SmartTags.SmartTag<Types.Tree.RestingRecordValue, Args, Types.Tree.RestingValue>];
|
|
4
4
|
export declare function deepGetProperty(record: Types.Tree.RestingRecordValue, pathString: string): Types.Tree.RestingValue;
|
|
@@ -47,8 +47,11 @@ function deepGetProperty(record, pathString) {
|
|
|
47
47
|
returned = val;
|
|
48
48
|
} else {
|
|
49
49
|
const found = currentRecord[chunk];
|
|
50
|
-
if (isRecord(found))
|
|
51
|
-
|
|
50
|
+
if (isRecord(found)) {
|
|
51
|
+
currentRecord = found;
|
|
52
|
+
} else {
|
|
53
|
+
throw "NOT_A_RECORD";
|
|
54
|
+
}
|
|
52
55
|
}
|
|
53
56
|
});
|
|
54
57
|
return returned;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare function stringify(val: Types.Tree.RestingValue): string;
|
|
3
3
|
export declare function parse(val: string): Types.Tree.RestingValue;
|
|
4
4
|
export declare const hjstringify: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, [], string>];
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
export * as add from './add/index.js'
|
|
2
2
|
export * as addclass from './addclass/index.js'
|
|
3
3
|
export * as and from './and/index.js'
|
|
4
|
-
export * as at from './at/index.js'
|
|
5
4
|
export * as append from './append/index.js'
|
|
6
5
|
export * as call from './call/index.js'
|
|
7
|
-
export * as clone from './clone/index.js'
|
|
8
6
|
export * as deleteproperties from './deleteproperties/index.js'
|
|
9
|
-
export * as
|
|
7
|
+
export * as at from './at/index.js'
|
|
10
8
|
export * as getattribute from './getattribute/index.js'
|
|
11
9
|
export * as getproperties from './getproperties/index.js'
|
|
12
|
-
export * as
|
|
13
|
-
export * as
|
|
10
|
+
export * as clone from './clone/index.js'
|
|
11
|
+
export * as equals from './equals/index.js'
|
|
14
12
|
export * as hjparse from './hjparse/index.js'
|
|
15
|
-
export * as
|
|
13
|
+
export * as hjstringify from './hjstringify/index.js'
|
|
14
|
+
export * as getproperty from './getproperty/index.js'
|
|
16
15
|
export * as initialize from './initialize/index.js'
|
|
17
|
-
export * as join from './join/index.js'
|
|
18
16
|
export * as length from './length/index.js'
|
|
17
|
+
export * as if from './if/index.js'
|
|
18
|
+
export * as join from './join/index.js'
|
|
19
19
|
export * as negate from './negate/index.js'
|
|
20
20
|
export * as map from './map/index.js'
|
|
21
21
|
export * as notrailing from './notrailing/index.js'
|
|
22
|
-
export * as or from './or/index.js'
|
|
23
22
|
export * as pickrandom from './pickrandom/index.js'
|
|
23
|
+
export * as or from './or/index.js'
|
|
24
24
|
export * as print from './print/index.js'
|
|
25
25
|
export * as push from './push/index.js'
|
|
26
|
+
export * as recordtoarray from './recordtoarray/index.js'
|
|
26
27
|
export * as populate from './populate/index.js'
|
|
28
|
+
export * as removeattribute from './removeattribute/index.js'
|
|
27
29
|
export * as pusheach from './pusheach/index.js'
|
|
28
|
-
export * as recordtoarray from './recordtoarray/index.js'
|
|
29
30
|
export * as removeclass from './removeclass/index.js'
|
|
30
31
|
export * as renameproperty from './renameproperty/index.js'
|
|
31
32
|
export * as replace from './replace/index.js'
|
|
33
|
+
export * as setattribute from './setattribute/index.js'
|
|
32
34
|
export * as select from './select/index.js'
|
|
33
|
-
export * as set from './set/index.js'
|
|
34
35
|
export * as setproperty from './setproperty/index.js'
|
|
35
|
-
export * as
|
|
36
|
+
export * as sorton from './sorton/index.js'
|
|
37
|
+
export * as set from './set/index.js'
|
|
36
38
|
export * as split from './split/index.js'
|
|
37
39
|
export * as spread from './spread/index.js'
|
|
38
|
-
export * as toarray from './toarray/index.js'
|
|
39
40
|
export * as toboolean from './toboolean/index.js'
|
|
40
|
-
export * as sorton from './sorton/index.js'
|
|
41
41
|
export * as toelement from './toelement/index.js'
|
|
42
|
-
export * as removeattribute from './removeattribute/index.js'
|
|
43
42
|
export * as toggleclass from './toggleclass/index.js'
|
|
44
43
|
export * as tonodelist from './tonodelist/index.js'
|
|
44
|
+
export * as toarray from './toarray/index.js'
|
|
45
45
|
export * as tonull from './tonull/index.js'
|
|
46
46
|
export * as tonumber from './tonumber/index.js'
|
|
47
47
|
export * as torecord from './torecord/index.js'
|
|
48
48
|
export * as toref from './toref/index.js'
|
|
49
|
-
export * as totext from './totext/index.js'
|
|
50
49
|
export * as transformselected from './transformselected/index.js'
|
|
51
|
-
export * as trim from './trim/index.js'
|
|
52
50
|
export * as tostring from './tostring/index.js'
|
|
51
|
+
export * as trim from './trim/index.js'
|
|
52
|
+
export * as totext from './totext/index.js'
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
export * as add from './add/index.js'
|
|
2
2
|
export * as addclass from './addclass/index.js'
|
|
3
3
|
export * as and from './and/index.js'
|
|
4
|
-
export * as at from './at/index.js'
|
|
5
4
|
export * as append from './append/index.js'
|
|
6
5
|
export * as call from './call/index.js'
|
|
7
|
-
export * as clone from './clone/index.js'
|
|
8
6
|
export * as deleteproperties from './deleteproperties/index.js'
|
|
9
|
-
export * as
|
|
7
|
+
export * as at from './at/index.js'
|
|
10
8
|
export * as getattribute from './getattribute/index.js'
|
|
11
9
|
export * as getproperties from './getproperties/index.js'
|
|
12
|
-
export * as
|
|
13
|
-
export * as
|
|
10
|
+
export * as clone from './clone/index.js'
|
|
11
|
+
export * as equals from './equals/index.js'
|
|
14
12
|
export * as hjparse from './hjparse/index.js'
|
|
15
|
-
export * as
|
|
13
|
+
export * as hjstringify from './hjstringify/index.js'
|
|
14
|
+
export * as getproperty from './getproperty/index.js'
|
|
16
15
|
export * as initialize from './initialize/index.js'
|
|
17
|
-
export * as join from './join/index.js'
|
|
18
16
|
export * as length from './length/index.js'
|
|
17
|
+
export * as if from './if/index.js'
|
|
18
|
+
export * as join from './join/index.js'
|
|
19
19
|
export * as negate from './negate/index.js'
|
|
20
20
|
export * as map from './map/index.js'
|
|
21
21
|
export * as notrailing from './notrailing/index.js'
|
|
22
|
-
export * as or from './or/index.js'
|
|
23
22
|
export * as pickrandom from './pickrandom/index.js'
|
|
23
|
+
export * as or from './or/index.js'
|
|
24
24
|
export * as print from './print/index.js'
|
|
25
25
|
export * as push from './push/index.js'
|
|
26
|
+
export * as recordtoarray from './recordtoarray/index.js'
|
|
26
27
|
export * as populate from './populate/index.js'
|
|
28
|
+
export * as removeattribute from './removeattribute/index.js'
|
|
27
29
|
export * as pusheach from './pusheach/index.js'
|
|
28
|
-
export * as recordtoarray from './recordtoarray/index.js'
|
|
29
30
|
export * as removeclass from './removeclass/index.js'
|
|
30
31
|
export * as renameproperty from './renameproperty/index.js'
|
|
31
32
|
export * as replace from './replace/index.js'
|
|
33
|
+
export * as setattribute from './setattribute/index.js'
|
|
32
34
|
export * as select from './select/index.js'
|
|
33
|
-
export * as set from './set/index.js'
|
|
34
35
|
export * as setproperty from './setproperty/index.js'
|
|
35
|
-
export * as
|
|
36
|
+
export * as sorton from './sorton/index.js'
|
|
37
|
+
export * as set from './set/index.js'
|
|
36
38
|
export * as split from './split/index.js'
|
|
37
39
|
export * as spread from './spread/index.js'
|
|
38
|
-
export * as toarray from './toarray/index.js'
|
|
39
40
|
export * as toboolean from './toboolean/index.js'
|
|
40
|
-
export * as sorton from './sorton/index.js'
|
|
41
41
|
export * as toelement from './toelement/index.js'
|
|
42
|
-
export * as removeattribute from './removeattribute/index.js'
|
|
43
42
|
export * as toggleclass from './toggleclass/index.js'
|
|
44
43
|
export * as tonodelist from './tonodelist/index.js'
|
|
44
|
+
export * as toarray from './toarray/index.js'
|
|
45
45
|
export * as tonull from './tonull/index.js'
|
|
46
46
|
export * as tonumber from './tonumber/index.js'
|
|
47
47
|
export * as torecord from './torecord/index.js'
|
|
48
48
|
export * as toref from './toref/index.js'
|
|
49
|
-
export * as totext from './totext/index.js'
|
|
50
49
|
export * as transformselected from './transformselected/index.js'
|
|
51
|
-
export * as trim from './trim/index.js'
|
|
52
50
|
export * as tostring from './tostring/index.js'
|
|
51
|
+
export * as trim from './trim/index.js'
|
|
52
|
+
export * as totext from './totext/index.js'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Args = [string | Text];
|
|
3
3
|
export declare const initialize: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, Args, Types.Tree.RestingValue>];
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Main = Types.Tree.RestingArrayValue | NodeListOf<Element | Text>;
|
|
3
3
|
type Args = Array<string | Text>;
|
|
4
4
|
export declare const join: [string, Types.SmartTags.SmartTag<Main, Args, string>];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Main = string | Text | NodeListOf<Element | Text> | Element | Types.Tree.RestingArrayValue | Types.Tree.RestingRecordValue;
|
|
3
3
|
export declare const length: [string, Types.SmartTags.SmartTag<Main, [], number>];
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
2
|
-
type Args =
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
|
+
type Args = Types.Tree.MethodValue[];
|
|
3
3
|
export declare const map: [string, Types.SmartTags.SmartTag<Types.Tree.RestingArrayValue, Args, Types.Tree.RestingArrayValue>];
|
|
4
4
|
export {};
|
|
@@ -10,7 +10,7 @@ var map = SmartTags.makeSmartTag({
|
|
|
10
10
|
argsValueCheck: (a) => Utils.Tree.TypeChecks.typeCheckMany(a, "method"),
|
|
11
11
|
func: (main, args) => {
|
|
12
12
|
const { makeTransformationError } = Utils.SmartTags;
|
|
13
|
-
|
|
13
|
+
const mapped = [];
|
|
14
14
|
for (const val of main) {
|
|
15
15
|
let reduced = val;
|
|
16
16
|
for (const arg of args) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const or: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, Types.Tree.RestingArrayValue, boolean>];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const pickrandom: [string, Types.SmartTags.SmartTag<Types.Tree.RestingArrayValue, [], Types.Tree.RestingValue>];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const print: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, Types.Tree.RestingArrayValue, Types.Tree.RestingValue>];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const push: [string, Types.SmartTags.SmartTag<Types.Tree.RestingArrayValue, Types.Tree.RestingArrayValue, Types.Tree.RestingArrayValue>];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
2
|
-
type Args =
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
|
+
type Args = Types.Tree.RestingArrayValue[];
|
|
3
3
|
export declare const pusheach: [string, Types.SmartTags.SmartTag<Types.Tree.RestingArrayValue, Args, Types.Tree.RestingArrayValue>];
|
|
4
4
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const recordtoarray: [string, Types.SmartTags.SmartTag<Types.Tree.RestingRecordValue, [], Types.Tree.RestingArrayValue>];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type Main = Element |
|
|
1
|
+
type Main = Element | Element[] | NodeListOf<Element | Text>;
|
|
2
2
|
type Args = [string | Text];
|
|
3
|
-
type Output = Element |
|
|
3
|
+
type Output = Element | Element[] | NodeListOf<Element | Text>;
|
|
4
4
|
export declare const removeattribute: [string, import("../../../types/index.js").Types.SmartTags.SmartTag<Main, Args, Output>];
|
|
5
5
|
export {};
|
|
@@ -14,11 +14,11 @@ var removeattribute = SmartTags.makeSmartTag({
|
|
|
14
14
|
return typeCheck(m, "element", "nodelist");
|
|
15
15
|
},
|
|
16
16
|
argsValueCheck: (a) => {
|
|
17
|
-
const { makeFailure, makeSuccess: makeSuccess2 } = Outcome;
|
|
17
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = Outcome;
|
|
18
18
|
const { typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
|
19
19
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
20
|
-
if (a.length === 0) return
|
|
21
|
-
if (a.length > 1) return
|
|
20
|
+
if (a.length === 0) return makeFailure2(makeArgsValueError("string | Text", "undefined", 0));
|
|
21
|
+
if (a.length > 1) return makeFailure2(makeArgsValueError("undefined", getType(a[2]) ?? "undefined", 1));
|
|
22
22
|
const checked = typeCheckMany(a, "string", "text");
|
|
23
23
|
if (checked.success) return makeSuccess2(checked.payload);
|
|
24
24
|
return checked;
|
|
@@ -42,7 +42,10 @@ var removeattribute = SmartTags.makeSmartTag({
|
|
|
42
42
|
const mainArrCloned = mainArr.map((e) => Utils.clone(e));
|
|
43
43
|
mainArrCloned.forEach((e) => e.removeAttribute(name));
|
|
44
44
|
if (Array.isArray(main)) return Outcome.makeSuccess(mainArrCloned);
|
|
45
|
-
|
|
45
|
+
const { makeMainValueError } = Utils.SmartTags;
|
|
46
|
+
const returned = mainArrCloned[0];
|
|
47
|
+
if (returned === void 0) return Outcome.makeFailure(makeMainValueError("element", "undefined"));
|
|
48
|
+
return Outcome.makeSuccess(returned);
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Args = [string | Text] | [string | Text, Types.Tree.RestingValue];
|
|
3
3
|
export declare const set: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, Args, Types.Tree.RestingValue>];
|
|
4
4
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type Main = Element |
|
|
1
|
+
type Main = Element | Element[] | NodeListOf<Element | Text>;
|
|
2
2
|
type Args = [string | Text] | [string | Text, string | Text];
|
|
3
|
-
type Output = Element |
|
|
3
|
+
type Output = Element | Element[] | NodeListOf<Element | Text>;
|
|
4
4
|
export declare const setattribute: [string, import("../../../types/index.js").Types.SmartTags.SmartTag<Main, Args, Output>];
|
|
5
5
|
export {};
|
|
@@ -14,11 +14,11 @@ var setattribute = SmartTags.makeSmartTag({
|
|
|
14
14
|
return typeCheck(m, "element", "nodelist");
|
|
15
15
|
},
|
|
16
16
|
argsValueCheck: (a) => {
|
|
17
|
-
const { makeFailure, makeSuccess: makeSuccess2 } = Outcome;
|
|
17
|
+
const { makeFailure: makeFailure2, makeSuccess: makeSuccess2 } = Outcome;
|
|
18
18
|
const { typeCheckMany, getType } = Utils.Tree.TypeChecks;
|
|
19
19
|
const { makeArgsValueError } = Utils.SmartTags;
|
|
20
|
-
if (a.length === 0) return
|
|
21
|
-
if (a.length > 2) return
|
|
20
|
+
if (a.length === 0) return makeFailure2(makeArgsValueError("string | Text", "undefined", 0));
|
|
21
|
+
if (a.length > 2) return makeFailure2(makeArgsValueError("undefined", getType(a[2]) ?? "undefined", 2));
|
|
22
22
|
const checked = typeCheckMany(a, "string", "text");
|
|
23
23
|
if (checked.success) return makeSuccess2(checked.payload);
|
|
24
24
|
return checked;
|
|
@@ -42,7 +42,10 @@ var setattribute = SmartTags.makeSmartTag({
|
|
|
42
42
|
const mainArrCloned = mainArr.map((e) => Utils.clone(e));
|
|
43
43
|
mainArrCloned.forEach((e) => e.setAttribute(name, value));
|
|
44
44
|
if (Array.isArray(main)) return Outcome.makeSuccess(mainArrCloned);
|
|
45
|
-
|
|
45
|
+
const { makeMainValueError } = Utils.SmartTags;
|
|
46
|
+
const returned = mainArrCloned[0];
|
|
47
|
+
if (returned === void 0) return Outcome.makeFailure(makeMainValueError("element", "undefined"));
|
|
48
|
+
return Outcome.makeSuccess(returned);
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Main = string | number | boolean | null | Text | Element | NodeListOf<Text | Element> | Types.Tree.RestingArrayValue | Types.Tree.RestingRecordValue;
|
|
3
3
|
type Args = [string | Text, Types.Tree.RestingValue];
|
|
4
4
|
type Output = string | number | boolean | null | Text | Element | NodeListOf<Text | Element> | Types.Tree.RestingArrayValue | Types.Tree.RestingRecordValue;
|
|
@@ -53,15 +53,15 @@ var setproperty = SmartTags.makeSmartTag({
|
|
|
53
53
|
function deepSetProperty(input, pathString, value) {
|
|
54
54
|
const pathChunks = pathString.split(".");
|
|
55
55
|
let clone = Utils.clone(input);
|
|
56
|
-
let currentItemParent
|
|
57
|
-
let currentItemPathFromParent
|
|
56
|
+
let currentItemParent;
|
|
57
|
+
let currentItemPathFromParent;
|
|
58
58
|
let currentItem = clone;
|
|
59
59
|
const { Text, Element, NodeList, document } = Window.get();
|
|
60
60
|
pathChunks.forEach((chunk, pos) => {
|
|
61
61
|
const isLast = pos === pathChunks.length - 1;
|
|
62
62
|
const numChunk = parseInt(chunk);
|
|
63
63
|
if (isLast) {
|
|
64
|
-
if (typeof currentItem === "number" || typeof currentItem === "boolean" || currentItem === null || currentItem instanceof Method) throw
|
|
64
|
+
if (typeof currentItem === "number" || typeof currentItem === "boolean" || currentItem === null || currentItem instanceof Method) throw "DEAD_END: Cannot set properties on a string, number, boolean, null or Method item";
|
|
65
65
|
else if (typeof currentItem === "string") {
|
|
66
66
|
if (currentItemParent !== void 0 && currentItemPathFromParent === void 0) throw `INVALID_PROP: Could not access item's child at ${currentItemPathFromParent} found at pos ${pos - 1} in path ${pathChunks.join(".")}`;
|
|
67
67
|
if (Number.isNaN(numChunk) || numChunk < 0 || numChunk > currentItem.length) throw `INVALID_PROP: Could not access item's child at ${numChunk} found at pos ${pos} in path ${pathChunks.join(".")}`;
|
|
@@ -70,10 +70,10 @@ function deepSetProperty(input, pathString, value) {
|
|
|
70
70
|
clone = newString;
|
|
71
71
|
}
|
|
72
72
|
if (Array.isArray(currentItemParent)) {
|
|
73
|
-
if (typeof currentItemPathFromParent !== "number") throw
|
|
73
|
+
if (typeof currentItemPathFromParent !== "number") throw "IMPOSSIBLE_OPERATION: non-number path from an Array parent, this is a bug";
|
|
74
74
|
currentItemParent[currentItemPathFromParent] = newString;
|
|
75
75
|
} else if (isRecord(currentItemParent)) {
|
|
76
|
-
if (typeof currentItemPathFromParent !== "string") throw
|
|
76
|
+
if (typeof currentItemPathFromParent !== "string") throw "IMPOSSIBLE_OPERATION: non-string path from an Record parent, this is a bug";
|
|
77
77
|
currentItemParent[currentItemPathFromParent] = newString;
|
|
78
78
|
} else throw `IMPOSSIBLE_OPERATION: a string item should not be a child of anything else than Array or Record, cannot mutate. At ${currentItemPathFromParent} found at pos ${pos - 1} in path ${pathChunks.join(".")}`;
|
|
79
79
|
} else if (Array.isArray(currentItem)) {
|
|
@@ -83,7 +83,7 @@ function deepSetProperty(input, pathString, value) {
|
|
|
83
83
|
currentItem[numChunk] = Utils.clone(value);
|
|
84
84
|
}
|
|
85
85
|
} else if (currentItem instanceof Text) {
|
|
86
|
-
const currContent = currentItem.textContent;
|
|
86
|
+
const currContent = currentItem.textContent ?? "";
|
|
87
87
|
if (Number.isNaN(numChunk) || numChunk < 0 || numChunk > currContent.length) throw `INVALID_PROP: Could not access item's child at ${numChunk} found at pos ${pos} in path ${pathChunks.join(".")}`;
|
|
88
88
|
const newContent = [
|
|
89
89
|
...currContent.slice(0, numChunk),
|
|
@@ -126,17 +126,17 @@ function deepSetProperty(input, pathString, value) {
|
|
|
126
126
|
clone = newNodelist;
|
|
127
127
|
}
|
|
128
128
|
if (Array.isArray(currentItemParent)) {
|
|
129
|
-
if (typeof currentItemPathFromParent !== "number") throw
|
|
129
|
+
if (typeof currentItemPathFromParent !== "number") throw "IMPOSSIBLE_OPERATION: non-number path from an Array parent, this is a bug";
|
|
130
130
|
currentItemParent[currentItemPathFromParent] = newNodelist;
|
|
131
131
|
} else if (isRecord(currentItemParent)) {
|
|
132
|
-
if (typeof currentItemPathFromParent !== "string") throw
|
|
132
|
+
if (typeof currentItemPathFromParent !== "string") throw "IMPOSSIBLE_OPERATION: non-string path from an Record parent, this is a bug";
|
|
133
133
|
currentItemParent[currentItemPathFromParent] = newNodelist;
|
|
134
134
|
} else throw `IMPOSSIBLE_OPERATION: a Nodelist item should not be a child of anything else than Array or Record, cannot mutate. At ${currentItemPathFromParent} found at pos ${pos - 1} in path ${pathChunks.join(".")}`;
|
|
135
135
|
} else {
|
|
136
136
|
currentItem[chunk] = Utils.clone(value);
|
|
137
137
|
}
|
|
138
138
|
} else {
|
|
139
|
-
if (typeof currentItem === "string" || typeof currentItem === "number" || typeof currentItem === "boolean" || currentItem === null || currentItem instanceof Text || currentItem instanceof Method) throw
|
|
139
|
+
if (typeof currentItem === "string" || typeof currentItem === "number" || typeof currentItem === "boolean" || currentItem === null || currentItem instanceof Text || currentItem instanceof Method) throw "DEAD_END: Cannot go deeper when a string, number, boolean, null, Text or Method item is reached";
|
|
140
140
|
if (currentItem instanceof Element) {
|
|
141
141
|
const children = Array.from(currentItem.childNodes).filter((e) => e instanceof Text || e instanceof Element);
|
|
142
142
|
const found = children[numChunk];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
2
|
-
type Main =
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
|
+
type Main = Types.Tree.RestingRecordValue[];
|
|
3
3
|
type Args = [string | Text];
|
|
4
4
|
export declare const sorton: [string, Types.SmartTags.SmartTag<Main, Args, Main>];
|
|
5
5
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Args = [Types.Tree.RestingRecordValue];
|
|
3
3
|
export declare const spread: [string, Types.SmartTags.SmartTag<Types.Tree.RestingRecordValue, Args, Types.Tree.RestingRecordValue>];
|
|
4
4
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const toarray: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, [], Types.Tree.RestingArrayValue>];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const toboolean: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, [], boolean>];
|