@design-edito/tools 0.3.9 → 0.3.11
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 +2 -2
- package/agnostic/arrays/index.js +2 -2
- 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 +54 -1
- package/agnostic/css/clss/index.js +3 -3
- package/agnostic/css/generate-nice-color/index.js +1 -0
- package/agnostic/css/index.d.ts +1 -1
- package/agnostic/css/index.js +1 -1
- package/agnostic/css/styles-set/index.d.ts +4 -4
- package/agnostic/css/styles-set/index.js +1 -1
- package/agnostic/errors/index.d.ts +1 -1
- package/agnostic/errors/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 +14 -14
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +14 -14
- 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 +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/index.js +3 -3
- 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 +5 -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/index.d.ts +1 -1
- package/agnostic/misc/crossenv/index.js +1 -1
- 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 +6 -6
- package/agnostic/misc/index.js +6 -6
- package/agnostic/misc/is-constructor-function/index.d.ts +1 -1
- package/agnostic/misc/logs/logger/index.d.ts +11 -1
- package/agnostic/misc/logs/logger/index.js +40 -10
- package/agnostic/misc/logs/styles/index.d.ts +1 -0
- package/agnostic/misc/logs/styles/index.js +27 -9
- 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 +5 -4
- package/agnostic/objects/index.js +5 -4
- 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 +1 -1
- package/agnostic/sanitization/index.js +1 -1
- 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 +3 -3
- package/agnostic/strings/index.js +3 -3
- 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/transitions/index.d.ts +3 -3
- package/agnostic/time/transitions/index.js +4 -4
- package/agnostic/time/wait/index.d.ts +2 -2
- package/agnostic/time/wait/index.js +1 -1
- package/components/Disclaimer/index.d.ts +45 -0
- package/components/Disclaimer/index.js +70 -0
- package/components/Drawer/index.d.ts +45 -0
- package/components/Drawer/index.js +82 -0
- package/components/Drawer/styles.module.css +0 -0
- package/components/EventListener/index.d.ts +20 -3
- package/components/EventListener/index.js +15 -22
- package/components/Gallery/index.d.ts +67 -0
- package/components/Gallery/index.js +173 -0
- package/components/Gallery/styles.module.css +33 -0
- package/components/Gallery/utils.d.ts +1 -0
- package/components/Image/index.d.ts +60 -0
- package/components/Image/index.js +99 -0
- package/components/Image/styles.module.css +0 -0
- package/components/IntersectionObserver/index.d.ts +48 -11
- package/components/IntersectionObserver/index.js +13 -22
- package/components/Paginator/index.d.ts +72 -0
- package/components/Paginator/index.js +116 -0
- package/components/Paginator/styles.module.css +9 -0
- package/components/ResizeObserver/index.d.ts +27 -0
- package/components/ResizeObserver/index.js +81 -0
- package/components/Scrllgngn/index.d.ts +123 -0
- package/components/Scrllgngn/index.js +175 -0
- package/components/Scrllgngn/styles.module.css +74 -0
- package/components/Sequencer/index.controlled.d.ts +78 -0
- package/components/Sequencer/index.d.ts +85 -0
- package/components/Sequencer/index.js +109 -0
- package/components/Sequencer/styles.module.css +0 -0
- package/components/ShadowRoot/index.d.ts +35 -0
- package/components/ShadowRoot/index.js +56 -0
- package/components/ShadowRoot/styles.module.css +0 -0
- package/components/Subtitles/index.d.ts +58 -0
- package/components/Subtitles/index.js +111 -0
- package/components/Subtitles/styles.module.css +0 -0
- package/components/Subtitles/types.d.ts +10 -0
- package/components/Subtitles/types.js +0 -0
- package/components/Subtitles/utils.d.ts +28 -0
- package/components/Theatre/index.d.ts +64 -0
- package/components/Theatre/index.js +97 -0
- package/components/Theatre/styles.module.css +0 -0
- package/components/Video/index.d.ts +119 -0
- package/components/Video/index.js +358 -0
- package/components/Video/styles.module.css +0 -0
- package/components/Video/utils.d.ts +10 -0
- package/components/_WIP_AudioQuote/index.d.ts +1 -0
- package/components/_WIP_AudioQuote/index.js +0 -0
- package/components/_WIP_Icon/index.d.ts +1 -0
- package/components/_WIP_Icon/index.js +0 -0
- package/components/index.d.ts +15 -1
- package/components/index.js +15 -1
- package/components/public-classnames.d.ts +14 -3
- package/components/utils/index.d.ts +1 -0
- package/components/utils/index.js +12 -0
- package/components/utils/types.d.ts +3 -0
- package/components/utils/types.js +0 -0
- package/node/@aws-s3/index.test.d.ts +1 -0
- 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/index.d.ts +1 -1
- package/node/@aws-s3/storage/directory/index.js +1 -1
- 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 +2 -2
- package/node/@aws-s3/storage/file/index.js +2 -2
- 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 +6 -6
- package/node/@google-cloud/storage/file/index.js +6 -6
- 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 +1 -1
- package/node/cloud-storage/operations/index.js +1 -1
- 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/encryption/index.d.ts +1 -1
- package/node/encryption/index.js +1 -1
- 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/index.d.ts +2 -2
- package/node/ftps/directory/index.js +2 -2
- 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 +1 -1
- package/node/ftps/file/index.js +1 -1
- 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 +1 -1
- package/node/images/index.js +1 -1
- 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 +2 -2
- package/node/index.js +2 -2
- package/node/process/prompt-continue/index.js +1 -1
- package/node/process/spawner/index.d.ts +61 -10
- package/node/process/spawner/index.js +15 -13
- 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 +2 -2
- package/node/sftp/file/index.js +2 -2
- 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 +2265 -14
- package/components/Input/index.d.ts +0 -7
- package/components/Input/index.js +0 -29
- /package/components/{Input → Disclaimer}/styles.module.css +0 -0
|
@@ -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
|
}
|
|
@@ -67,7 +67,7 @@ var DataSize = class {
|
|
|
67
67
|
if (this.unit === "exbibyte") return this.value * 8 * Math.pow(1024, 6);
|
|
68
68
|
return this.value;
|
|
69
69
|
}
|
|
70
|
-
/* * * * * * * * * * * * * * * * * *
|
|
70
|
+
/* * * * * * * * * * * * * * * * * *
|
|
71
71
|
* Decimal unit converters
|
|
72
72
|
* * * * * * * * * * * * * * * * * */
|
|
73
73
|
toBytes() {
|
|
@@ -98,7 +98,7 @@ var DataSize = class {
|
|
|
98
98
|
return this.toBytes() / 1e18;
|
|
99
99
|
}
|
|
100
100
|
toEB = this.toExabytes.bind(this);
|
|
101
|
-
/* * * * * * * * * * * * * * * * * *
|
|
101
|
+
/* * * * * * * * * * * * * * * * * *
|
|
102
102
|
* Binary unit converters
|
|
103
103
|
* * * * * * * * * * * * * * * * * */
|
|
104
104
|
toKibibytes() {
|
package/agnostic/misc/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * as connection from './connection/index.js'
|
|
2
|
-
export * as cast from './cast/index.js'
|
|
3
1
|
export * as assert from './assert/index.js'
|
|
2
|
+
export * as cast from './cast/index.js'
|
|
3
|
+
export * as connection from './connection/index.js'
|
|
4
4
|
export * as crawler from './crawler/index.js'
|
|
5
|
-
export * as
|
|
6
|
-
export * as isNullish from './is-nullish/index.js'
|
|
5
|
+
export * as crossenv from './crossenv/index.js'
|
|
7
6
|
export * as isConstructorFunction from './is-constructor-function/index.js'
|
|
7
|
+
export * as dataSize from './data-size/index.js'
|
|
8
8
|
export * as logs from './logs/index.js'
|
|
9
|
+
export * as normalizeExtension from './normalize-extension/index.js'
|
|
10
|
+
export * as isNullish from './is-nullish/index.js'
|
|
9
11
|
export * as loremIpsum from './lorem-ipsum/index.js'
|
|
10
|
-
export * as crossenv from './crossenv/index.js'
|
|
11
12
|
export * as outcome from './outcome/index.js'
|
|
12
|
-
export * as normalizeExtension from './normalize-extension/index.js'
|
package/agnostic/misc/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * as connection from './connection/index.js'
|
|
2
|
-
export * as cast from './cast/index.js'
|
|
3
1
|
export * as assert from './assert/index.js'
|
|
2
|
+
export * as cast from './cast/index.js'
|
|
3
|
+
export * as connection from './connection/index.js'
|
|
4
4
|
export * as crawler from './crawler/index.js'
|
|
5
|
-
export * as
|
|
6
|
-
export * as isNullish from './is-nullish/index.js'
|
|
5
|
+
export * as crossenv from './crossenv/index.js'
|
|
7
6
|
export * as isConstructorFunction from './is-constructor-function/index.js'
|
|
7
|
+
export * as dataSize from './data-size/index.js'
|
|
8
8
|
export * as logs from './logs/index.js'
|
|
9
|
+
export * as normalizeExtension from './normalize-extension/index.js'
|
|
10
|
+
export * as isNullish from './is-nullish/index.js'
|
|
9
11
|
export * as loremIpsum from './lorem-ipsum/index.js'
|
|
10
|
-
export * as crossenv from './crossenv/index.js'
|
|
11
12
|
export * as outcome from './outcome/index.js'
|
|
12
|
-
export * as normalizeExtension from './normalize-extension/index.js'
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @template T - The type of object constructed by the function.
|
|
5
5
|
*/
|
|
6
|
-
export type ConstructorFunction<T
|
|
6
|
+
export type ConstructorFunction<T = any> = new (...args: any[]) => T;
|
|
7
7
|
/**
|
|
8
8
|
* Checks whether a given value is a constructor function (i.e., a class or function with a prototype).
|
|
9
9
|
*
|
|
@@ -29,14 +29,24 @@ declare class Log<T extends ConsoleMethod = ConsoleMethod> {
|
|
|
29
29
|
get displayStack(): string;
|
|
30
30
|
}
|
|
31
31
|
export declare class Logger {
|
|
32
|
-
_private_threads: Map<string, Log[]>;
|
|
32
|
+
_private_threads: Map<string, Log<ConsoleMethod>[]>;
|
|
33
33
|
constructor();
|
|
34
|
+
assert(thread?: string, ...args: ConsoleMethodsParams['assert']): void;
|
|
35
|
+
count(thread?: string, ...args: ConsoleMethodsParams['count']): void;
|
|
36
|
+
countReset(thread?: string, ...args: ConsoleMethodsParams['countReset']): void;
|
|
37
|
+
debug(thread?: string, ...args: ConsoleMethodsParams['debug']): void;
|
|
34
38
|
dir(thread?: string, ...args: ConsoleMethodsParams['dir']): void;
|
|
39
|
+
dirxml(thread?: string, ...args: ConsoleMethodsParams['dirxml']): void;
|
|
35
40
|
error(thread?: string, ...args: ConsoleMethodsParams['error']): void;
|
|
36
41
|
group(thread?: string, ...args: ConsoleMethodsParams['group']): void;
|
|
42
|
+
groupCollapsed(thread?: string, ...args: ConsoleMethodsParams['groupCollapsed']): void;
|
|
37
43
|
groupEnd(thread?: string, ...args: ConsoleMethodsParams['groupEnd']): void;
|
|
44
|
+
info(thread?: string, ...args: ConsoleMethodsParams['info']): void;
|
|
38
45
|
log(thread?: string, ...args: ConsoleMethodsParams['log']): void;
|
|
39
46
|
table(thread?: string, ...args: ConsoleMethodsParams['table']): void;
|
|
47
|
+
time(thread?: string, ...args: ConsoleMethodsParams['time']): void;
|
|
48
|
+
timeEnd(thread?: string, ...args: ConsoleMethodsParams['timeEnd']): void;
|
|
49
|
+
trace(thread?: string, ...args: ConsoleMethodsParams['trace']): void;
|
|
40
50
|
warn(thread?: string, ...args: ConsoleMethodsParams['warn']): void;
|
|
41
51
|
setLog<T extends ConsoleMethod>(threadName: string, type: T, data: ConsoleMethodsParams[T]): this;
|
|
42
52
|
print(this: Logger, threadFilter?: string, withStack?: boolean): void;
|
|
@@ -32,45 +32,75 @@ var Log = class {
|
|
|
32
32
|
var Logger = class {
|
|
33
33
|
_private_threads = /* @__PURE__ */ new Map();
|
|
34
34
|
constructor() {
|
|
35
|
+
this.assert = this.assert.bind(this);
|
|
36
|
+
this.count = this.count.bind(this);
|
|
37
|
+
this.countReset = this.countReset.bind(this);
|
|
38
|
+
this.debug = this.debug.bind(this);
|
|
35
39
|
this.dir = this.dir.bind(this);
|
|
40
|
+
this.dirxml = this.dirxml.bind(this);
|
|
36
41
|
this.error = this.error.bind(this);
|
|
37
42
|
this.group = this.group.bind(this);
|
|
43
|
+
this.groupCollapsed = this.groupCollapsed.bind(this);
|
|
38
44
|
this.groupEnd = this.groupEnd.bind(this);
|
|
45
|
+
this.info = this.info.bind(this);
|
|
39
46
|
this.log = this.log.bind(this);
|
|
40
47
|
this.table = this.table.bind(this);
|
|
48
|
+
this.time = this.time.bind(this);
|
|
49
|
+
this.timeEnd = this.timeEnd.bind(this);
|
|
50
|
+
this.trace = this.trace.bind(this);
|
|
41
51
|
this.warn = this.warn.bind(this);
|
|
42
52
|
this.setLog = this.setLog.bind(this);
|
|
43
53
|
this.print = this.print.bind(this);
|
|
44
54
|
this.printThreads = this.printThreads.bind(this);
|
|
45
55
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
assert(thread = "", ...args) {
|
|
57
|
+
this.setLog(thread, "assert", args);
|
|
58
|
+
}
|
|
59
|
+
count(thread = "", ...args) {
|
|
60
|
+
this.setLog(thread, "count", args);
|
|
61
|
+
}
|
|
62
|
+
countReset(thread = "", ...args) {
|
|
63
|
+
this.setLog(thread, "countReset", args);
|
|
64
|
+
}
|
|
65
|
+
debug(thread = "", ...args) {
|
|
66
|
+
this.setLog(thread, "debug", args);
|
|
67
|
+
}
|
|
50
68
|
dir(thread = "", ...args) {
|
|
51
69
|
this.setLog(thread, "dir", args);
|
|
52
70
|
}
|
|
53
|
-
|
|
71
|
+
dirxml(thread = "", ...args) {
|
|
72
|
+
this.setLog(thread, "dirxml", args);
|
|
73
|
+
}
|
|
54
74
|
error(thread = "", ...args) {
|
|
55
75
|
this.setLog(thread, "error", args);
|
|
56
76
|
}
|
|
57
77
|
group(thread = "", ...args) {
|
|
58
78
|
this.setLog(thread, "group", args);
|
|
59
79
|
}
|
|
60
|
-
|
|
80
|
+
groupCollapsed(thread = "", ...args) {
|
|
81
|
+
this.setLog(thread, "groupCollapsed", args);
|
|
82
|
+
}
|
|
61
83
|
groupEnd(thread = "", ...args) {
|
|
62
84
|
this.setLog(thread, "groupEnd", args);
|
|
63
85
|
}
|
|
64
|
-
|
|
86
|
+
info(thread = "", ...args) {
|
|
87
|
+
this.setLog(thread, "info", args);
|
|
88
|
+
}
|
|
65
89
|
log(thread = "", ...args) {
|
|
66
90
|
this.setLog(thread, "log", args);
|
|
67
91
|
}
|
|
68
92
|
table(thread = "", ...args) {
|
|
69
93
|
this.setLog(thread, "table", args);
|
|
70
94
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
95
|
+
time(thread = "", ...args) {
|
|
96
|
+
this.setLog(thread, "time", args);
|
|
97
|
+
}
|
|
98
|
+
timeEnd(thread = "", ...args) {
|
|
99
|
+
this.setLog(thread, "timeEnd", args);
|
|
100
|
+
}
|
|
101
|
+
trace(thread = "", ...args) {
|
|
102
|
+
this.setLog(thread, "trace", args);
|
|
103
|
+
}
|
|
74
104
|
warn(thread = "", ...args) {
|
|
75
105
|
this.setLog(thread, "warn", args);
|
|
76
106
|
}
|
|
@@ -1,20 +1,38 @@
|
|
|
1
1
|
// src/agnostic/misc/logs/styles/index.ts
|
|
2
|
-
import chalk from "chalk";
|
|
3
2
|
import { makeTextBlock } from "../make-text-block/index.js";
|
|
3
|
+
var ansi = {
|
|
4
|
+
reset: "\x1B[0m",
|
|
5
|
+
bold: "\x1B[1m",
|
|
6
|
+
italic: "\x1B[3m",
|
|
7
|
+
underline: "\x1B[4m",
|
|
8
|
+
fg: {
|
|
9
|
+
red: "\x1B[31m",
|
|
10
|
+
green: "\x1B[32m",
|
|
11
|
+
yellow: "\x1B[33m",
|
|
12
|
+
blue: "\x1B[34m",
|
|
13
|
+
gray: "\x1B[90m",
|
|
14
|
+
whiteBright: "\x1B[97m"
|
|
15
|
+
},
|
|
16
|
+
bg: {
|
|
17
|
+
red: "\x1B[41m"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var wrap = (...ansiCodes) => (text) => `${ansiCodes.join("")}${text}${ansi.reset}`;
|
|
4
21
|
var styles = {
|
|
5
22
|
regular: (text) => text,
|
|
6
|
-
light: (
|
|
7
|
-
danger: (text) =>
|
|
23
|
+
light: wrap(ansi.fg.gray),
|
|
24
|
+
danger: (text) => wrap(ansi.bold, ansi.bg.red, ansi.fg.whiteBright)(makeTextBlock(`/!\\
|
|
8
25
|
|
|
9
26
|
${text}
|
|
10
27
|
`, 2, 6)),
|
|
11
|
-
important: (
|
|
12
|
-
title: (text) => `# ${
|
|
28
|
+
important: wrap(ansi.bold),
|
|
29
|
+
title: (text) => `# ${wrap(ansi.bold, ansi.underline)(`${text}
|
|
13
30
|
`)}`,
|
|
14
|
-
info: (
|
|
15
|
-
success: (
|
|
16
|
-
error: (
|
|
17
|
-
warning: (
|
|
31
|
+
info: wrap(ansi.fg.blue),
|
|
32
|
+
success: wrap(ansi.fg.green),
|
|
33
|
+
error: wrap(ansi.fg.red),
|
|
34
|
+
warning: wrap(ansi.fg.yellow),
|
|
35
|
+
italic: wrap(ansi.italic)
|
|
18
36
|
};
|
|
19
37
|
export {
|
|
20
38
|
styles
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @property {true} success - Always `true`.
|
|
6
6
|
* @property {Payload} payload - The success value.
|
|
7
7
|
*/
|
|
8
|
-
export type Success<Payload
|
|
8
|
+
export type Success<Payload = any> = {
|
|
9
9
|
success: true;
|
|
10
10
|
payload: Payload;
|
|
11
11
|
};
|
|
@@ -16,7 +16,7 @@ export type Success<Payload extends any = any> = {
|
|
|
16
16
|
* @property {false} success - Always `false`.
|
|
17
17
|
* @property {Error} error - The error value.
|
|
18
18
|
*/
|
|
19
|
-
export type Failure<Error
|
|
19
|
+
export type Failure<Error = any> = {
|
|
20
20
|
success: false;
|
|
21
21
|
error: Error;
|
|
22
22
|
};
|
|
@@ -26,7 +26,7 @@ export type Failure<Error extends any = any> = {
|
|
|
26
26
|
* @template Payload - Type of success payload.
|
|
27
27
|
* @template Error - Type of error.
|
|
28
28
|
*/
|
|
29
|
-
export type Either<Payload
|
|
29
|
+
export type Either<Payload = any, Error = any> = Success<Payload> | Failure<Error>;
|
|
30
30
|
/**
|
|
31
31
|
* Creates a success outcome with the given payload.
|
|
32
32
|
*
|
|
@@ -34,7 +34,7 @@ export type Either<Payload extends any = any, Error extends any = any> = Success
|
|
|
34
34
|
* @param {Payload} payload - The success value.
|
|
35
35
|
* @returns {Success<Payload>} A success outcome object.
|
|
36
36
|
*/
|
|
37
|
-
export declare function makeSuccess<Payload
|
|
37
|
+
export declare function makeSuccess<Payload>(payload: Payload): Success<Payload>;
|
|
38
38
|
/**
|
|
39
39
|
* Creates a failure outcome with the given error.
|
|
40
40
|
*
|
|
@@ -42,7 +42,7 @@ export declare function makeSuccess<Payload extends any>(payload: Payload): Succ
|
|
|
42
42
|
* @param {Error} error - The error value.
|
|
43
43
|
* @returns {Failure<Error>} A failure outcome object.
|
|
44
44
|
*/
|
|
45
|
-
export declare function makeFailure<Error
|
|
45
|
+
export declare function makeFailure<Error>(error: Error): Failure<Error>;
|
|
46
46
|
/**
|
|
47
47
|
* Creates either a success or failure outcome based on a boolean flag.
|
|
48
48
|
*
|
|
@@ -52,5 +52,5 @@ export declare function makeFailure<Error extends any>(error: Error): Failure<Er
|
|
|
52
52
|
* @param {Payload | Error} payloadOrError - The payload if success, or the error if failure.
|
|
53
53
|
* @returns {Either<Payload, Error>} The resulting outcome.
|
|
54
54
|
*/
|
|
55
|
-
export declare function make<Payload
|
|
56
|
-
export declare function make<Error
|
|
55
|
+
export declare function make<Payload>(success: true, payload: Payload): Success<Payload>;
|
|
56
|
+
export declare function make<Error>(success: false, error: Error): Failure<Error>;
|
|
@@ -44,8 +44,10 @@ function approximateRationalDumb(target, maxRounds) {
|
|
|
44
44
|
function approximateRational(target, maxDenominator = 1e3) {
|
|
45
45
|
const sign = target < 0 ? -1 : 1;
|
|
46
46
|
const absTarget = Math.abs(target);
|
|
47
|
-
let h1 = 1
|
|
48
|
-
let
|
|
47
|
+
let h1 = 1;
|
|
48
|
+
let h2 = 0;
|
|
49
|
+
let k1 = 0;
|
|
50
|
+
let k2 = 1;
|
|
49
51
|
let b = absTarget;
|
|
50
52
|
do {
|
|
51
53
|
const a = Math.floor(b);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * as
|
|
1
|
+
export * as approximateRational from './approximate-rational/index.js'
|
|
2
2
|
export * as clamp from './clamp/index.js'
|
|
3
3
|
export * as geometricProgressions from './geometric-progressions/index.js'
|
|
4
|
-
export * as approximateRational from './approximate-rational/index.js'
|
|
5
|
-
export * as round from './round/index.js'
|
|
6
4
|
export * as interpolate from './interpolate/index.js'
|
|
5
|
+
export * as round from './round/index.js'
|
|
6
|
+
export * as absoluteModulo from './absolute-modulo/index.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * as
|
|
1
|
+
export * as approximateRational from './approximate-rational/index.js'
|
|
2
2
|
export * as clamp from './clamp/index.js'
|
|
3
3
|
export * as geometricProgressions from './geometric-progressions/index.js'
|
|
4
|
-
export * as approximateRational from './approximate-rational/index.js'
|
|
5
|
-
export * as round from './round/index.js'
|
|
6
4
|
export * as interpolate from './interpolate/index.js'
|
|
5
|
+
export * as round from './round/index.js'
|
|
6
|
+
export * as absoluteModulo from './absolute-modulo/index.js'
|
|
@@ -6,14 +6,14 @@ function deepGetProperty(anythingThatHasProperties, pathString) {
|
|
|
6
6
|
let returned = currentObject;
|
|
7
7
|
pathChunks.forEach((chunk, pos) => {
|
|
8
8
|
const isLast = pos === pathChunks.length - 1;
|
|
9
|
-
if (!isRecord(currentObject)) throw "PROPERTY_UNREACHABLE";
|
|
9
|
+
if (!isRecord(currentObject)) throw new Error("PROPERTY_UNREACHABLE");
|
|
10
10
|
if (isLast) {
|
|
11
11
|
const val = currentObject[chunk];
|
|
12
12
|
returned = val;
|
|
13
13
|
} else {
|
|
14
14
|
const found = currentObject[chunk];
|
|
15
15
|
if (isRecord(found)) currentObject = found;
|
|
16
|
-
else throw "PROPERTY_UNREACHABLE";
|
|
16
|
+
else throw new Error("PROPERTY_UNREACHABLE");
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
return returned;
|
|
@@ -5,7 +5,8 @@ function flattenGetters(obj) {
|
|
|
5
5
|
).filter(([_, desc]) => typeof desc.get === "function").map(([key]) => key);
|
|
6
6
|
const returned = { ...obj };
|
|
7
7
|
getters.forEach((getter) => {
|
|
8
|
-
|
|
8
|
+
const key = getter;
|
|
9
|
+
returned[getter] = obj[key];
|
|
9
10
|
});
|
|
10
11
|
return returned;
|
|
11
12
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * as deepGetProperty from './deep-get-property/index.js'
|
|
2
|
-
export * as
|
|
3
|
-
export * as isObject from './is-object/index.js'
|
|
2
|
+
export * as enums from './enums/index.js'
|
|
4
3
|
export * as isRecord from './is-record/index.js'
|
|
4
|
+
export * as isObject from './is-object/index.js'
|
|
5
5
|
export * as recordFormat from './record-format/index.js'
|
|
6
|
-
export * as
|
|
6
|
+
export * as flattenGetters from './flatten-getters/index.js'
|
|
7
7
|
export * as recordMap from './record-map/index.js'
|
|
8
|
-
export * as
|
|
8
|
+
export * as sortKeys from './sort-keys/index.js'
|
|
9
|
+
export * as validation from './validation/index.js'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * as deepGetProperty from './deep-get-property/index.js'
|
|
2
|
-
export * as
|
|
3
|
-
export * as isObject from './is-object/index.js'
|
|
2
|
+
export * as enums from './enums/index.js'
|
|
4
3
|
export * as isRecord from './is-record/index.js'
|
|
4
|
+
export * as isObject from './is-object/index.js'
|
|
5
5
|
export * as recordFormat from './record-format/index.js'
|
|
6
|
-
export * as
|
|
6
|
+
export * as flattenGetters from './flatten-getters/index.js'
|
|
7
7
|
export * as recordMap from './record-map/index.js'
|
|
8
|
-
export * as
|
|
8
|
+
export * as sortKeys from './sort-keys/index.js'
|
|
9
|
+
export * as validation from './validation/index.js'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a new object with the keys sorted according to the provided sorter.
|
|
3
|
+
*
|
|
4
|
+
* @template T - The type of the input object.
|
|
5
|
+
* @param {T} obj - The object whose keys should be sorted.
|
|
6
|
+
* @param {(a: keyof T, b: keyof T) => number} [sorter] - Optional function used to compare keys for sorting. Defaults to alphabetical order.
|
|
7
|
+
* @returns {{ [K in keyof T]: T[K] }} A new object with the same keys and values as the input, but sorted by key.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sortKeys<T extends Record<string, unknown>>(obj: T, sorter?: (a: keyof T, b: keyof T) => number): {
|
|
10
|
+
[K in keyof T]: T[K];
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/agnostic/objects/sort-keys/index.ts
|
|
2
|
+
function sortKeys(obj, sorter = (a, b) => String(a).localeCompare(String(b))) {
|
|
3
|
+
const out = {};
|
|
4
|
+
const keys = Object.keys(obj);
|
|
5
|
+
for (const key of keys.sort(sorter)) {
|
|
6
|
+
out[key] = obj[key];
|
|
7
|
+
}
|
|
8
|
+
return out;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
sortKeys
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,7 +3,7 @@ function memoize(toMemoizeFunc) {
|
|
|
3
3
|
let cachedArgs;
|
|
4
4
|
let cachedResult;
|
|
5
5
|
const memoizedFunc = (...args) => {
|
|
6
|
-
const argsMatch = cachedArgs !== void 0 && args.length === cachedArgs.length && args.every((arg, i) => arg === cachedArgs[i]);
|
|
6
|
+
const argsMatch = cachedArgs !== void 0 && args.length === cachedArgs.length && args.every((arg, i) => arg === cachedArgs?.[i]);
|
|
7
7
|
if (argsMatch && cachedResult !== void 0) return cachedResult.value;
|
|
8
8
|
const result = toMemoizeFunc(...args);
|
|
9
9
|
cachedArgs = args;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
type BasicFunction = (...args: any[]) => any;
|
|
2
|
-
|
|
3
|
-
* Returns a throttled version of the function passed as an argument
|
|
4
|
-
* @param toThrottleFunc - The function that has to be throttled
|
|
5
|
-
* @param delayMs - The throttle delay in ms
|
|
6
|
-
*/
|
|
7
|
-
export declare function throttle<T extends BasicFunction = BasicFunction>(toThrottleFunc: T, delayMs: number): {
|
|
2
|
+
type ThrottledResult<T extends BasicFunction> = {
|
|
8
3
|
throttled: (...args: any[]) => {
|
|
9
4
|
returnValue: ReturnType<T> | undefined;
|
|
10
5
|
lastExecutedOn: number;
|
|
@@ -14,11 +9,12 @@ export declare function throttle<T extends BasicFunction = BasicFunction>(toThro
|
|
|
14
9
|
setDelay: (delayMs: number) => void;
|
|
15
10
|
};
|
|
16
11
|
/**
|
|
17
|
-
* Returns a
|
|
18
|
-
* @param
|
|
19
|
-
* @param delayMs - The
|
|
12
|
+
* Returns a throttled version of the function passed as an argument
|
|
13
|
+
* @param toThrottleFunc - The function that has to be throttled
|
|
14
|
+
* @param delayMs - The throttle delay in ms
|
|
20
15
|
*/
|
|
21
|
-
export declare function
|
|
16
|
+
export declare function throttle<T extends BasicFunction = BasicFunction>(toThrottleFunc: T, delayMs: number): ThrottledResult<T>;
|
|
17
|
+
type DebounceResult<T extends BasicFunction> = {
|
|
22
18
|
debounced: (...args: any[]) => {
|
|
23
19
|
returnValue: ReturnType<T> | undefined;
|
|
24
20
|
lastExecutedOn: number;
|
|
@@ -27,4 +23,10 @@ export declare function debounce<T extends BasicFunction = BasicFunction>(toDebo
|
|
|
27
23
|
};
|
|
28
24
|
setDelay: (delayMs: number) => void;
|
|
29
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Returns a debounced version of the function passed as an argument
|
|
28
|
+
* @param toDebounceFunc - The function that has to be debounced
|
|
29
|
+
* @param delayMs - The debounce delay in ms
|
|
30
|
+
*/
|
|
31
|
+
export declare function debounce<T extends BasicFunction = BasicFunction>(toDebounceFunc: T, delayMs: number): DebounceResult<T>;
|
|
30
32
|
export {};
|
|
@@ -3,7 +3,7 @@ function throttle(toThrottleFunc, delayMs) {
|
|
|
3
3
|
let currentDelayMs = delayMs;
|
|
4
4
|
let lastArgs = [];
|
|
5
5
|
let lastExecutedOn = 0;
|
|
6
|
-
let lastReturnValue
|
|
6
|
+
let lastReturnValue;
|
|
7
7
|
let nextExecutionTimeout = null;
|
|
8
8
|
function scheduleNextCall() {
|
|
9
9
|
if (nextExecutionTimeout !== null) {
|
|
@@ -56,7 +56,7 @@ function debounce(toDebounceFunc, delayMs) {
|
|
|
56
56
|
let lastArgs = [];
|
|
57
57
|
let lastCalledOn = 0;
|
|
58
58
|
let lastExecutedOn = 0;
|
|
59
|
-
let lastReturnValue
|
|
59
|
+
let lastReturnValue;
|
|
60
60
|
let nextExecutionTimeout = null;
|
|
61
61
|
function scheduleNextCall() {
|
|
62
62
|
if (nextExecutionTimeout !== null) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { setTimeout } from 'node:timers';
|
|
1
|
+
import { type setTimeout } from 'node:timers';
|
|
2
2
|
export type NodeTimeout = ReturnType<typeof setTimeout>;
|
package/agnostic/random/index.js
CHANGED