@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
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const tonull: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, [], null>];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const tonumber: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, [], number>];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const torecord: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, [], Types.Tree.RestingRecordValue>];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const toref: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, [], 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 tostring: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, [], string>];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const totext: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, [], Text>];
|
|
@@ -69,7 +69,6 @@ var transformselected = SmartTags.makeSmartTag({
|
|
|
69
69
|
insertNode(Cast.toText(replacer), "after", selected);
|
|
70
70
|
selected.remove();
|
|
71
71
|
}
|
|
72
|
-
transformedChecked.payload;
|
|
73
72
|
}
|
|
74
73
|
if (main instanceof Element) return makeSuccess(mainClone);
|
|
75
74
|
const safeChildren = Array.from(mainClone.childNodes).filter((e) => e instanceof Element || e instanceof Text);
|
|
@@ -10,7 +10,7 @@ var trim = SmartTags.makeSmartTag({
|
|
|
10
10
|
mainValueCheck: (m) => Utils.Tree.TypeChecks.typeCheck(m, "string", "text"),
|
|
11
11
|
argsValueCheck: (a) => Utils.SmartTags.expectEmptyArgs(a),
|
|
12
12
|
func: (main) => {
|
|
13
|
-
return typeof main === "string" ? Outcome.makeSuccess(main.trim()) : Outcome.makeSuccess(Cast.toText(
|
|
13
|
+
return typeof main === "string" ? Outcome.makeSuccess(main.trim()) : Outcome.makeSuccess(Cast.toText((main.textContent ?? "").trim()));
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../types/index.js';
|
|
1
|
+
import { type Types } from '../types/index.js';
|
|
2
2
|
export declare namespace SmartTags {
|
|
3
3
|
function makeSmartTag<Main extends Types.Tree.RestingValue = Types.Tree.RestingValue, Args extends Types.Tree.RestingArrayValue = Types.Tree.RestingArrayValue, Output extends Types.Tree.RestingValue = Types.Tree.RestingValue>(descriptor: Types.SmartTags.Descriptor<Main, Args, Output>): [string, Types.SmartTags.SmartTag<Main, Args, Output>];
|
|
4
4
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const any: [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 array: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, Types.Tree.RestingArrayValue, 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 global: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, Types.Tree.RestingArrayValue, Types.Tree.RestingRecordValue>];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
export declare const guess: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, Types.Tree.RestingArrayValue, Types.Tree.RestingValue>];
|
|
@@ -20,7 +20,7 @@ var guess = SmartTags.makeSmartTag({
|
|
|
20
20
|
const strCoalesced = Cast.toString(coalesced);
|
|
21
21
|
if (strCoalesced.trim().toLowerCase() === "true") return makeSuccess2(true);
|
|
22
22
|
if (strCoalesced.trim().toLowerCase() === "false") return makeSuccess2(false);
|
|
23
|
-
if (strCoalesced.trim().toLowerCase().match(/^\s*-?\s*(\d+(\.\d*)?|\.\d+)\s*$/)) return makeSuccess2(parseFloat(strCoalesced));
|
|
23
|
+
if (strCoalesced.trim().toLowerCase().match(/^\s*-?\s*(\d+(\.\d*)?|\.\d+)\s*$/) !== null) return makeSuccess2(parseFloat(strCoalesced));
|
|
24
24
|
if (strCoalesced.trim().toLowerCase() === "null") return makeSuccess2(null);
|
|
25
25
|
try {
|
|
26
26
|
const parsed = JSON.parse(strCoalesced);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
export * as any from './any/index.js'
|
|
1
2
|
export * as array from './array/index.js'
|
|
2
3
|
export * as element from './element/index.js'
|
|
3
|
-
export * as boolean from './boolean/index.js'
|
|
4
4
|
export * as get from './get/index.js'
|
|
5
5
|
export * as global from './global/index.js'
|
|
6
6
|
export * as guess from './guess/index.js'
|
|
7
|
-
export * as
|
|
8
|
-
export * as any from './any/index.js'
|
|
9
|
-
export * as number from './number/index.js'
|
|
7
|
+
export * as boolean from './boolean/index.js'
|
|
10
8
|
export * as null from './null/index.js'
|
|
9
|
+
export * as nodelist from './nodelist/index.js'
|
|
11
10
|
export * as record from './record/index.js'
|
|
12
11
|
export * as ref from './ref/index.js'
|
|
12
|
+
export * as number from './number/index.js'
|
|
13
13
|
export * as text from './text/index.js'
|
|
14
14
|
export * as string from './string/index.js'
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
export * as any from './any/index.js'
|
|
1
2
|
export * as array from './array/index.js'
|
|
2
3
|
export * as element from './element/index.js'
|
|
3
|
-
export * as boolean from './boolean/index.js'
|
|
4
4
|
export * as get from './get/index.js'
|
|
5
5
|
export * as global from './global/index.js'
|
|
6
6
|
export * as guess from './guess/index.js'
|
|
7
|
-
export * as
|
|
8
|
-
export * as any from './any/index.js'
|
|
9
|
-
export * as number from './number/index.js'
|
|
7
|
+
export * as boolean from './boolean/index.js'
|
|
10
8
|
export * as null from './null/index.js'
|
|
9
|
+
export * as nodelist from './nodelist/index.js'
|
|
11
10
|
export * as record from './record/index.js'
|
|
12
11
|
export * as ref from './ref/index.js'
|
|
12
|
+
export * as number from './number/index.js'
|
|
13
13
|
export * as text from './text/index.js'
|
|
14
14
|
export * as string from './string/index.js'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '../../../types/index.js';
|
|
1
|
+
import { type Types } from '../../../types/index.js';
|
|
2
2
|
type Output = NodeListOf<Element | Text>;
|
|
3
3
|
export declare const nodelist: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, Types.Tree.RestingArrayValue, Output>];
|
|
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 nullFunc: [string, Types.SmartTags.SmartTag<Types.Tree.RestingValue, Types.Tree.RestingArrayValue, null>];
|
|
@@ -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 record: [string, Types.SmartTags.SmartTag<Types.Tree.RestingRecordValue, Args, Types.Tree.RestingRecordValue>];
|
|
4
4
|
export {};
|
|
@@ -12,7 +12,9 @@ var text = SmartTags.makeSmartTag({
|
|
|
12
12
|
func: (main, args) => {
|
|
13
13
|
const all = [main, ...args];
|
|
14
14
|
const reduced = all.reduce((reduced2, curr) => {
|
|
15
|
-
|
|
15
|
+
const red = reduced2.textContent ?? "";
|
|
16
|
+
const cur = Cast.toText(curr).textContent ?? "";
|
|
17
|
+
return Cast.toText(`${red}${cur}`);
|
|
16
18
|
}, Cast.toText(""));
|
|
17
19
|
return Outcome.makeSuccess(reduced);
|
|
18
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Outcome from '../../../misc/outcome/index.js';
|
|
2
2
|
import { Method } from '../method/index.js';
|
|
3
|
-
import { Tree as TreeNamespace } from '../tree/index.js';
|
|
4
|
-
import { Types } from '../types/index.js';
|
|
3
|
+
import { type Tree as TreeNamespace } from '../tree/index.js';
|
|
4
|
+
import { type Types } from '../types/index.js';
|
|
5
5
|
export declare class Transformer<Main extends Types.Tree.RestingValue = Types.Tree.RestingValue, Args extends Types.Tree.RestingArrayValue = Types.Tree.RestingArrayValue, Output extends Types.Tree.RestingValue = Types.Tree.RestingValue> {
|
|
6
6
|
name: string;
|
|
7
7
|
mode: Types.Tree.Mode;
|
|
@@ -32,7 +32,6 @@ var Transformer = class _Transformer {
|
|
|
32
32
|
let argsValue;
|
|
33
33
|
if (mode === "isolation") {
|
|
34
34
|
if (Array.isArray(innerValue)) {
|
|
35
|
-
innerValue;
|
|
36
35
|
mainValue = innerValue.at(0) ?? [];
|
|
37
36
|
argsValue = innerValue.slice(1);
|
|
38
37
|
} else {
|
|
@@ -84,14 +83,12 @@ var Transformer = class _Transformer {
|
|
|
84
83
|
};
|
|
85
84
|
}
|
|
86
85
|
apply(outerValue) {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
func
|
|
94
|
-
} = this;
|
|
86
|
+
const getMainAndArgsValue = this.getMainAndArgsValue.bind(this);
|
|
87
|
+
const makeMainValueError = this.makeMainValueError.bind(this);
|
|
88
|
+
const makeArgsValueError = this.makeArgsValueError.bind(this);
|
|
89
|
+
const makeTransformationError = this.makeTransformationError.bind(this);
|
|
90
|
+
const func = this.func.bind(this);
|
|
91
|
+
const { typeChecks } = this;
|
|
95
92
|
const { mainValue, argsValue } = getMainAndArgsValue(outerValue);
|
|
96
93
|
const mainChecked = typeChecks.mainValue(mainValue);
|
|
97
94
|
if (!mainChecked.success) return Outcome.makeFailure(makeMainValueError(
|
|
@@ -136,7 +136,12 @@ var Tree;
|
|
|
136
136
|
this.pathFromParent = null;
|
|
137
137
|
this.root = this;
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
const thisPath = [];
|
|
140
|
+
if (!this.isRoot) {
|
|
141
|
+
thisPath.push(...this.parent?.path ?? []);
|
|
142
|
+
if (this.pathFromParent !== null) thisPath.push(this.pathFromParent);
|
|
143
|
+
}
|
|
144
|
+
this.path = thisPath;
|
|
140
145
|
this.pathString = `/${this.path.join("/")}`;
|
|
141
146
|
this.attributes = node instanceof Element ? Array.from(node.attributes) : null;
|
|
142
147
|
if (node instanceof Element) {
|
|
@@ -265,7 +270,7 @@ var Tree;
|
|
|
265
270
|
if (child instanceof Element) return [...reduced, child];
|
|
266
271
|
const lastReducedItem = reduced[reduced.length - 1];
|
|
267
272
|
if (lastReducedItem instanceof Element) return [...reduced, child];
|
|
268
|
-
const lastReducedTrimmed = trimEnd(lastReducedItem
|
|
273
|
+
const lastReducedTrimmed = trimEnd(lastReducedItem?.textContent ?? "");
|
|
269
274
|
const childTrimmed = trimStart(child.textContent ?? "");
|
|
270
275
|
const merged = document.createTextNode(`${lastReducedTrimmed}${childTrimmed}`);
|
|
271
276
|
const returned = [...reduced];
|
|
@@ -344,14 +349,14 @@ var Tree;
|
|
|
344
349
|
if (isRoot && mode === "coalescion") throw new Error(`The root node cannot be used in coalescion mode @ ${this.pathString}`);
|
|
345
350
|
}
|
|
346
351
|
computeValue() {
|
|
352
|
+
const performSafetyChecks = this.performSafetyChecks.bind(this);
|
|
347
353
|
const {
|
|
348
354
|
isolationInitType,
|
|
349
355
|
subtrees,
|
|
350
356
|
node,
|
|
351
357
|
smartTagData,
|
|
352
358
|
isMethod,
|
|
353
|
-
mode
|
|
354
|
-
performSafetyChecks
|
|
359
|
+
mode
|
|
355
360
|
} = this;
|
|
356
361
|
performSafetyChecks();
|
|
357
362
|
const { Text } = Window.get();
|
|
@@ -383,7 +388,8 @@ var Tree;
|
|
|
383
388
|
return transformer;
|
|
384
389
|
}
|
|
385
390
|
enforceEvaluation() {
|
|
386
|
-
const { isPreserved, node,
|
|
391
|
+
const { isPreserved, node, isLiteral, attributes } = this;
|
|
392
|
+
const computeValue = this.computeValue.bind(this);
|
|
387
393
|
const { Element } = Window.get();
|
|
388
394
|
if (isPreserved) return Utils.clone(node);
|
|
389
395
|
const evaluated = computeValue();
|
|
@@ -404,11 +410,9 @@ var Tree;
|
|
|
404
410
|
}
|
|
405
411
|
evaluate() {
|
|
406
412
|
const start = Date.now();
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
enforceEvaluation
|
|
411
|
-
} = this;
|
|
413
|
+
const getCachedValue = this.getCachedValue.bind(this);
|
|
414
|
+
const setCachedValue = this.setCachedValue.bind(this);
|
|
415
|
+
const enforceEvaluation = this.enforceEvaluation.bind(this);
|
|
412
416
|
const cached = getCachedValue();
|
|
413
417
|
if (cached !== void 0) return cached;
|
|
414
418
|
const evaluated = enforceEvaluation();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as Outcome from '../../../misc/outcome/index.js';
|
|
2
|
-
import { Logger } from '../../../misc/logs/logger/index.js';
|
|
3
|
-
import { Tree as TreeNamespace } from '../tree/index.js';
|
|
4
|
-
import { Transformer } from '../transformer/index.js';
|
|
5
|
-
import { Method } from '../method/index.js';
|
|
1
|
+
import type * as Outcome from '../../../misc/outcome/index.js';
|
|
2
|
+
import { type Logger } from '../../../misc/logs/logger/index.js';
|
|
3
|
+
import { type Tree as TreeNamespace } from '../tree/index.js';
|
|
4
|
+
import { type Transformer } from '../transformer/index.js';
|
|
5
|
+
import { type Method } from '../method/index.js';
|
|
6
6
|
export declare namespace Types {
|
|
7
7
|
namespace Transformations {
|
|
8
8
|
type FunctionMainValueFailure = {
|
|
@@ -60,9 +60,7 @@ export declare namespace Types {
|
|
|
60
60
|
};
|
|
61
61
|
type Value = RestingValue | TransformerValue;
|
|
62
62
|
type RestingArrayValue = RestingValue[];
|
|
63
|
-
type RestingRecordValue =
|
|
64
|
-
[k: string]: RestingValue;
|
|
65
|
-
};
|
|
63
|
+
type RestingRecordValue = Record<string, RestingValue>;
|
|
66
64
|
type ValuesTypesNamesIndex = {
|
|
67
65
|
null: null;
|
|
68
66
|
boolean: boolean;
|
|
@@ -104,15 +102,13 @@ export declare namespace Types {
|
|
|
104
102
|
value: string;
|
|
105
103
|
} | {
|
|
106
104
|
type: 'nodelist';
|
|
107
|
-
value:
|
|
105
|
+
value: Serialized[];
|
|
108
106
|
} | {
|
|
109
107
|
type: 'array';
|
|
110
|
-
value:
|
|
108
|
+
value: Serialized[];
|
|
111
109
|
} | {
|
|
112
110
|
type: 'record';
|
|
113
|
-
value:
|
|
114
|
-
[k: string]: Serialized;
|
|
115
|
-
};
|
|
111
|
+
value: Record<string, Serialized>;
|
|
116
112
|
} | {
|
|
117
113
|
type: 'transformer';
|
|
118
114
|
value: Transformer;
|
|
@@ -6,14 +6,14 @@ export declare namespace Utils {
|
|
|
6
6
|
const toHyperJson: (value: Types.Tree.Value) => Element | Text;
|
|
7
7
|
namespace Transformations {
|
|
8
8
|
namespace TypeChecks {
|
|
9
|
-
function getType<T
|
|
9
|
+
function getType<T>(value: T): T extends Types.Tree.Value ? Types.Tree.ValueTypeName : Types.Tree.ValueTypeName | undefined;
|
|
10
10
|
const everyTypeName: Types.Tree.ValueTypeName[];
|
|
11
11
|
function singleTypeCheck<K extends Types.Tree.ValueTypeName>(value: unknown, type: K): value is Types.Tree.ValueTypeFromNames<[K]>;
|
|
12
|
-
function typeCheck<K extends
|
|
12
|
+
function typeCheck<K extends Types.Tree.ValueTypeName[]>(value: unknown, ...types: K): Outcome.Either<Types.Tree.ValueTypeFromNames<K>, {
|
|
13
13
|
expected: string;
|
|
14
14
|
found: string;
|
|
15
15
|
}>;
|
|
16
|
-
function typeCheckMany<K extends
|
|
16
|
+
function typeCheckMany<K extends Types.Tree.ValueTypeName[]>(values: unknown[], ...types: K): Outcome.Either<Array<Types.Tree.ValueTypeFromNames<K>>, {
|
|
17
17
|
position: number;
|
|
18
18
|
expected: string;
|
|
19
19
|
found: string;
|
|
@@ -24,19 +24,19 @@ export declare namespace Utils {
|
|
|
24
24
|
function mergeNodes(nodes: Element[]): Element;
|
|
25
25
|
function getInitialValueFromTypeName(name: Exclude<Types.Tree.ValueTypeName, 'transformer' | 'method'>): Types.Tree.RestingValue;
|
|
26
26
|
namespace TypeChecks {
|
|
27
|
-
function getType<T
|
|
27
|
+
function getType<T>(value: T): T extends Types.Tree.Value ? Types.Tree.ValueTypeName : Types.Tree.ValueTypeName | undefined;
|
|
28
28
|
const everyTypeName: Types.Tree.ValueTypeName[];
|
|
29
29
|
function singleTypeCheck<K extends Types.Tree.ValueTypeName>(value: unknown, type: K): value is Types.Tree.ValueTypeFromNames<[K]>;
|
|
30
|
-
function typeCheck<K extends
|
|
30
|
+
function typeCheck<K extends Types.Tree.ValueTypeName[]>(value: unknown, ...types: K): Outcome.Either<Types.Tree.ValueTypeFromNames<K>, {
|
|
31
31
|
expected: string;
|
|
32
32
|
found: string;
|
|
33
33
|
}>;
|
|
34
|
-
function typeCheckMany<K extends
|
|
34
|
+
function typeCheckMany<K extends Types.Tree.ValueTypeName[]>(values: unknown[], ...types: K): Outcome.Either<Array<Types.Tree.ValueTypeFromNames<K>>, {
|
|
35
35
|
position: number;
|
|
36
36
|
expected: string;
|
|
37
37
|
found: string;
|
|
38
38
|
}>;
|
|
39
|
-
function typeCheckManyWithLength<K extends
|
|
39
|
+
function typeCheckManyWithLength<K extends Types.Tree.ValueTypeName[]>(values: unknown[], minLength?: number, maxLength?: number, ...types: K): Outcome.Either<Array<Types.Tree.ValueTypeFromNames<K>>, {
|
|
40
40
|
position: number;
|
|
41
41
|
expected: string;
|
|
42
42
|
found: string;
|
|
@@ -262,7 +262,7 @@ var Utils;
|
|
|
262
262
|
else {
|
|
263
263
|
const childKey = childData.key;
|
|
264
264
|
const alreadyMerged = mergedChildren.find((dat) => dat.key === childKey);
|
|
265
|
-
if (alreadyMerged) return;
|
|
265
|
+
if (alreadyMerged !== void 0) return;
|
|
266
266
|
const toMerge = allChildren.filter((dat) => dat.key === childKey);
|
|
267
267
|
if (toMerge.length === 0) return;
|
|
268
268
|
const merged = mergeNodes(toMerge.map((dat) => dat.node));
|
package/agnostic/html/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * as getNodeAncestors from './get-node-ancestors/index.js'
|
|
2
|
+
export * as getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
2
3
|
export * as hyperJson from './hyper-json/index.js'
|
|
3
4
|
export * as insertNode from './insert-node/index.js'
|
|
4
5
|
export * as placeholders from './placeholders/index.js'
|
|
5
6
|
export * as replaceInElement from './replace-in-element/index.js'
|
|
6
7
|
export * as selectorToElement from './selector-to-element/index.js'
|
|
7
|
-
export * as getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
8
8
|
export * as stringToNodes from './string-to-nodes/index.js'
|
package/agnostic/html/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * as getNodeAncestors from './get-node-ancestors/index.js'
|
|
2
|
+
export * as getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
2
3
|
export * as hyperJson from './hyper-json/index.js'
|
|
3
4
|
export * as insertNode from './insert-node/index.js'
|
|
4
5
|
export * as placeholders from './placeholders/index.js'
|
|
5
6
|
export * as replaceInElement from './replace-in-element/index.js'
|
|
6
7
|
export * as selectorToElement from './selector-to-element/index.js'
|
|
7
|
-
export * as getPositionInsideParent from './get-position-inside-parent/index.js'
|
|
8
8
|
export * as stringToNodes from './string-to-nodes/index.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const EightKiloByteOfLoremIpsumSentences: string[];
|
|
2
2
|
export declare const generateSentence: () => string | undefined;
|
|
3
|
-
export declare const generateSentences: (amount?: number) =>
|
|
3
|
+
export declare const generateSentences: (amount?: number) => Array<string | undefined>;
|
|
4
4
|
export declare const generateTitle: () => string;
|
|
5
5
|
export declare const generateIntertitle: () => string;
|
|
6
6
|
export declare const generateParagraph: () => string;
|
|
@@ -10,7 +10,7 @@ function selectorToElement(selector) {
|
|
|
10
10
|
const matchedClasses = selector.match(classRegexp) ?? [];
|
|
11
11
|
const matchedAttrs = selector.match(attributeRegexp) ?? [];
|
|
12
12
|
const tag = matchedTags[matchedTags.length - 1] ?? "div";
|
|
13
|
-
const id = matchedIds.length > 0 ? matchedIds[matchedIds.length - 1]?.replace(/^#/, "") : null;
|
|
13
|
+
const id = matchedIds.length > 0 ? matchedIds[matchedIds.length - 1]?.replace(/^#/, "") ?? null : null;
|
|
14
14
|
const classes = matchedClasses.map((matchedClass) => matchedClass.replace(/^\./, ""));
|
|
15
15
|
const attributes = matchedAttrs.map((matchedAttr) => matchedAttr.replace(/^\[/, "").replace(/\]$/, "").split("="));
|
|
16
16
|
const element = Window.get().document.createElement(tag);
|
package/agnostic/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export * as arrays from './arrays/index.js'
|
|
2
|
-
export * as booleans from './booleans/index.js'
|
|
3
2
|
export * as colors from './colors/index.js'
|
|
3
|
+
export * as booleans from './booleans/index.js'
|
|
4
|
+
export * as css from './css/index.js'
|
|
4
5
|
export * as html from './html/index.js'
|
|
5
|
-
export * as errors from './errors/index.js'
|
|
6
6
|
export * as misc from './misc/index.js'
|
|
7
|
-
export * as
|
|
7
|
+
export * as errors from './errors/index.js'
|
|
8
8
|
export * as objects from './objects/index.js'
|
|
9
9
|
export * as optim from './optim/index.js'
|
|
10
10
|
export * as random from './random/index.js'
|
|
11
|
-
export * as regexps from './regexps/index.js'
|
|
12
11
|
export * as sanitization from './sanitization/index.js'
|
|
13
|
-
export * as
|
|
12
|
+
export * as strings from './strings/index.js'
|
|
14
13
|
export * as time from './time/index.js'
|
|
15
14
|
export * as typescript from './typescript/index.js'
|
|
16
|
-
export * as
|
|
15
|
+
export * as regexps from './regexps/index.js'
|
|
16
|
+
export * as numbers from './numbers/index.js'
|
package/agnostic/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export * as arrays from './arrays/index.js'
|
|
2
|
-
export * as booleans from './booleans/index.js'
|
|
3
2
|
export * as colors from './colors/index.js'
|
|
3
|
+
export * as booleans from './booleans/index.js'
|
|
4
|
+
export * as css from './css/index.js'
|
|
4
5
|
export * as html from './html/index.js'
|
|
5
|
-
export * as errors from './errors/index.js'
|
|
6
6
|
export * as misc from './misc/index.js'
|
|
7
|
-
export * as
|
|
7
|
+
export * as errors from './errors/index.js'
|
|
8
8
|
export * as objects from './objects/index.js'
|
|
9
9
|
export * as optim from './optim/index.js'
|
|
10
10
|
export * as random from './random/index.js'
|
|
11
|
-
export * as regexps from './regexps/index.js'
|
|
12
11
|
export * as sanitization from './sanitization/index.js'
|
|
13
|
-
export * as
|
|
12
|
+
export * as strings from './strings/index.js'
|
|
14
13
|
export * as time from './time/index.js'
|
|
15
14
|
export * as typescript from './typescript/index.js'
|
|
16
|
-
export * as
|
|
15
|
+
export * as regexps from './regexps/index.js'
|
|
16
|
+
export * as numbers from './numbers/index.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Outcome from '../outcome/index.js';
|
|
2
2
|
type Assertion = (() => boolean) | (() => Promise<boolean>) | boolean;
|
|
3
|
-
export declare function assert(label: string, assertion: Assertion |
|
|
4
|
-
export declare function assertVerbose(label: string, assertion: Assertion |
|
|
3
|
+
export declare function assert(label: string, assertion: Assertion | Assertion[] | Map<string, Assertion> | Record<string, Assertion>): Promise<Outcome.Either<string, string>>;
|
|
4
|
+
export declare function assertVerbose(label: string, assertion: Assertion | Assertion[] | Map<string, Assertion>): Promise<undefined | Outcome.Success<string>>;
|
|
5
5
|
export {};
|
|
@@ -16,7 +16,7 @@ async function assert(label, assertion) {
|
|
|
16
16
|
else if (typeof assertion === "function") {
|
|
17
17
|
try {
|
|
18
18
|
const result = await assertion();
|
|
19
|
-
if (result
|
|
19
|
+
if (!result) return Outcome.makeFailure(label);
|
|
20
20
|
else return Outcome.makeSuccess(label);
|
|
21
21
|
} catch (err) {
|
|
22
22
|
const errStr = unknownToString(err);
|
|
@@ -31,14 +31,14 @@ async function assert(label, assertion) {
|
|
|
31
31
|
} else {
|
|
32
32
|
assertions = Object.entries(assertion);
|
|
33
33
|
}
|
|
34
|
-
const allAsserted = await Promise.all(assertions.map(([innerLabel, innerAssertion]) => {
|
|
34
|
+
const allAsserted = await Promise.all(assertions.map(async ([innerLabel, innerAssertion]) => {
|
|
35
35
|
const fullLabel = `${label} / ${innerLabel}`;
|
|
36
36
|
const asserted = assert(fullLabel, innerAssertion);
|
|
37
|
-
return asserted;
|
|
37
|
+
return await asserted;
|
|
38
38
|
}));
|
|
39
39
|
const allSuccess = allAsserted.every((asserted) => asserted.success);
|
|
40
40
|
if (allSuccess) return Outcome.makeSuccess(allAsserted.map((e) => e.payload).join("\n"));
|
|
41
|
-
const failures = allAsserted.filter((asserted) => asserted.success
|
|
41
|
+
const failures = allAsserted.filter((asserted) => !asserted.success);
|
|
42
42
|
const failuresStr = failures.map((failure) => failure.error).join("\n ");
|
|
43
43
|
return Outcome.makeFailure(failuresStr);
|
|
44
44
|
}
|
|
@@ -47,7 +47,7 @@ export declare function toNull(_value: unknown): null;
|
|
|
47
47
|
* @param {unknown} value - The value to convert.
|
|
48
48
|
* @returns {Array<unknown>} The array representation of the input.
|
|
49
49
|
*/
|
|
50
|
-
export declare function toArray(value: unknown):
|
|
50
|
+
export declare function toArray(value: unknown): unknown[];
|
|
51
51
|
/**
|
|
52
52
|
* Converts a value to an array of numbers.
|
|
53
53
|
*
|
|
@@ -30,7 +30,7 @@ export type Processor<T> = (url: string, content: T, hooks: {
|
|
|
30
30
|
*
|
|
31
31
|
* @template T - The type of content returned by the fetcher.
|
|
32
32
|
*/
|
|
33
|
-
export type Options<T
|
|
33
|
+
export type Options<T> = {
|
|
34
34
|
/** Maximum number of URLs to process. */
|
|
35
35
|
limit: number;
|
|
36
36
|
/** Optional delay between processing URLs, in milliseconds, or a function returning the delay. */
|
|
@@ -86,4 +86,4 @@ export type Crawler = {
|
|
|
86
86
|
* console.log('Total processed:', crawler.processed.size);
|
|
87
87
|
* ```
|
|
88
88
|
*/
|
|
89
|
-
export declare function create<T
|
|
89
|
+
export declare function create<T>(options: Options<T>): Crawler;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// src/agnostic/misc/crossenv/detect-runtime/index.ts
|
|
2
2
|
import { RuntimeName } from "../types.js";
|
|
3
3
|
function detectRuntime() {
|
|
4
|
-
if (typeof process
|
|
5
|
-
if (typeof window
|
|
4
|
+
if (typeof process?.versions?.node !== "undefined") return RuntimeName.NODE;
|
|
5
|
+
if (typeof window?.document !== "undefined") return RuntimeName.BROWSER;
|
|
6
6
|
if (typeof Deno !== "undefined") return RuntimeName.DENO;
|
|
7
|
-
if (typeof process !== "undefined" && typeof navigator.userAgent === "string" &&
|
|
8
|
-
if (typeof process
|
|
7
|
+
if (typeof process !== "undefined" && typeof navigator.userAgent === "string" && navigator.userAgent.includes("ReactNative")) return RuntimeName.REACT_NATIVE;
|
|
8
|
+
if (typeof process?.versions !== "undefined" && typeof process.version.electron !== "undefined") return RuntimeName.ELECTRON;
|
|
9
9
|
if (typeof self !== "undefined" && typeof self.addEventListener === "function" && typeof Headers !== "undefined") return RuntimeName.CLOUDFLARE;
|
|
10
10
|
if (typeof AWS !== "undefined" && typeof AWS.Lambda !== "undefined") return RuntimeName.AWS_LAMBDA;
|
|
11
11
|
return null;
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
function exists() {
|
|
3
3
|
return typeof globalThis !== "undefined" && "window" in globalThis;
|
|
4
4
|
}
|
|
5
|
-
var _window = exists() ? globalThis
|
|
5
|
+
var _window = exists() ? globalThis.window ?? null : null;
|
|
6
6
|
function set(customWindow) {
|
|
7
7
|
_window = customWindow;
|
|
8
8
|
return customWindow;
|
|
9
9
|
}
|
|
10
10
|
function unset() {
|
|
11
11
|
if (exists()) {
|
|
12
|
-
_window = globalThis
|
|
12
|
+
_window = globalThis.window;
|
|
13
13
|
} else {
|
|
14
14
|
_window = null;
|
|
15
15
|
}
|