@design-edito/tools 0.3.8 → 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 +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 +5 -5
- package/agnostic/colors/index.js +5 -5
- 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 +3 -3
- package/agnostic/css/index.js +3 -3
- 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 +21 -21
- package/agnostic/html/hyper-json/smart-tags/coalesced/index.js +21 -21
- 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 +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/index.js +5 -5
- 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 +2 -2
- package/agnostic/html/index.js +2 -2
- package/agnostic/html/placeholders/index.d.ts +1 -1
- package/agnostic/html/selector-to-element/index.js +1 -1
- package/agnostic/index.d.ts +7 -7
- package/agnostic/index.js +7 -7
- 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 +4 -4
- package/agnostic/misc/index.js +4 -4
- 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 +3 -3
- 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/index.d.ts +1 -1
- package/agnostic/optim/index.js +1 -1
- 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 +2 -2
- package/agnostic/random/index.js +2 -2
- 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/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 +10 -0
- package/components/EventListener/index.js +47 -0
- package/components/EventListener/styles.module.css +0 -0
- package/components/Input/index.d.ts +7 -0
- package/components/Input/index.js +29 -0
- package/components/Input/styles.module.css +0 -0
- package/components/IntersectionObserver/index.d.ts +20 -0
- package/components/IntersectionObserver/index.js +79 -0
- package/components/IntersectionObserver/styles.module.css +0 -0
- package/components/index.d.ts +3 -1
- package/components/index.js +3 -1
- package/components/public-classnames.d.ts +3 -0
- package/index.d.ts +2 -2
- package/index.js +2 -2
- 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/@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 +4 -4
- package/node/cloud-storage/operations/index.js +4 -4
- 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/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 +3 -3
- package/node/ftps/file/index.js +3 -3
- 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 +5 -5
- package/node/index.js +5 -5
- 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/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 +1260 -26
- package/components/Comp/index.d.ts +0 -1
- package/components/Comp/index.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
import * as Outcome from '../../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
import type { BrightenOperationParams } from '../../../types.js';
|
|
4
4
|
export declare function isBrightenOperationParams(obj: unknown): Outcome.Either<BrightenOperationParams, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
import * as Outcome from '../../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
import type { ExtendOperationParams } from '../../../types.js';
|
|
4
4
|
export declare function isExtendOperationParams(obj: unknown): Outcome.Either<ExtendOperationParams, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
import * as Outcome from '../../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
import type { ExtractOperationParams } from '../../../types.js';
|
|
4
4
|
export declare function isExtractOperationParams(obj: unknown): Outcome.Either<ExtractOperationParams, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
import * as Outcome from '../../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
import type { FlattenOperationParams } from '../../../types.js';
|
|
4
4
|
export declare function isFlattenOperationParams(obj: unknown): Outcome.Either<FlattenOperationParams, string>;
|
|
@@ -14,7 +14,7 @@ function isFlattenOperationParams(obj) {
|
|
|
14
14
|
async function flatten(sharpInstance, params) {
|
|
15
15
|
const inputBg = params.background;
|
|
16
16
|
const rgbBackground = inputBg !== void 0 ? toSharpColor(inputBg) : void 0;
|
|
17
|
-
const background = rgbBackground
|
|
17
|
+
const background = rgbBackground ?? rgbBackground;
|
|
18
18
|
return sharpInstance.flatten({ background });
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
export declare function flip(sharpInstance: sharp.Sharp): Promise<sharp.Sharp>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
export declare function flop(sharpInstance: sharp.Sharp): Promise<sharp.Sharp>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
import * as Outcome from '../../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
import type { HueOperationParams } from '../../../types.js';
|
|
4
4
|
export declare function isHueOperationParams(obj: unknown): Outcome.Either<HueOperationParams, string>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export * as blur from './blur/index.js'
|
|
2
2
|
export * as brighten from './brighten/index.js'
|
|
3
|
-
export * as extend from './extend/index.js'
|
|
4
3
|
export * as extract from './extract/index.js'
|
|
4
|
+
export * as extend from './extend/index.js'
|
|
5
5
|
export * as flatten from './flatten/index.js'
|
|
6
|
-
export * as
|
|
6
|
+
export * as flop from './flop/index.js'
|
|
7
7
|
export * as hue from './hue/index.js'
|
|
8
8
|
export * as level from './level/index.js'
|
|
9
9
|
export * as lighten from './lighten/index.js'
|
|
10
|
-
export * as
|
|
10
|
+
export * as flip from './flip/index.js'
|
|
11
11
|
export * as overlay from './overlay/index.js'
|
|
12
|
-
export * as resize from './resize/index.js'
|
|
13
12
|
export * as rotate from './rotate/index.js'
|
|
14
|
-
export * as
|
|
13
|
+
export * as resize from './resize/index.js'
|
|
15
14
|
export * as normalize from './normalize/index.js'
|
|
15
|
+
export * as saturate from './saturate/index.js'
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export * as blur from './blur/index.js'
|
|
2
2
|
export * as brighten from './brighten/index.js'
|
|
3
|
-
export * as extend from './extend/index.js'
|
|
4
3
|
export * as extract from './extract/index.js'
|
|
4
|
+
export * as extend from './extend/index.js'
|
|
5
5
|
export * as flatten from './flatten/index.js'
|
|
6
|
-
export * as
|
|
6
|
+
export * as flop from './flop/index.js'
|
|
7
7
|
export * as hue from './hue/index.js'
|
|
8
8
|
export * as level from './level/index.js'
|
|
9
9
|
export * as lighten from './lighten/index.js'
|
|
10
|
-
export * as
|
|
10
|
+
export * as flip from './flip/index.js'
|
|
11
11
|
export * as overlay from './overlay/index.js'
|
|
12
|
-
export * as resize from './resize/index.js'
|
|
13
12
|
export * as rotate from './rotate/index.js'
|
|
14
|
-
export * as
|
|
13
|
+
export * as resize from './resize/index.js'
|
|
15
14
|
export * as normalize from './normalize/index.js'
|
|
15
|
+
export * as saturate from './saturate/index.js'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
import * as Outcome from '../../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
import type { LevelOperationParams } from '../../../types.js';
|
|
4
4
|
export declare function isLevelOperationParams(obj: unknown): Outcome.Either<LevelOperationParams, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
import * as Outcome from '../../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
import type { LightenOperationParams } from '../../../types.js';
|
|
4
4
|
export declare function isLightenOperationParams(obj: unknown): Outcome.Either<LightenOperationParams, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
import * as Outcome from '../../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
import type { NormalizeOperationParams } from '../../../types.js';
|
|
4
4
|
export declare function isNormalizeOperationParams(obj: unknown): Outcome.Either<NormalizeOperationParams, string>;
|
|
@@ -8,7 +8,7 @@ function isOverlayOperationParams(obj) {
|
|
|
8
8
|
const schema = z.object({
|
|
9
9
|
input: z.union([
|
|
10
10
|
z.custom(isDuckTypedSharpInstance),
|
|
11
|
-
z.custom(Buffer.isBuffer),
|
|
11
|
+
z.custom((data) => Buffer.isBuffer(data)),
|
|
12
12
|
z.string(),
|
|
13
13
|
z.object({
|
|
14
14
|
width: z.number().optional(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
import * as Outcome from '../../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
import type { ResizeOperationParams } from '../../../types.js';
|
|
4
4
|
export declare function isResizeOperationParams(obj: unknown): Outcome.Either<ResizeOperationParams, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
import * as Outcome from '../../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
import type { RotateOperationParams } from '../../../types.js';
|
|
4
4
|
export declare function isRotateOperationParams(obj: unknown): Outcome.Either<RotateOperationParams, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import type sharp from 'sharp';
|
|
2
2
|
import * as Outcome from '../../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
import type { SaturateOperationParams } from '../../../types.js';
|
|
4
4
|
export declare function isSaturateOperationParams(obj: unknown): Outcome.Either<SaturateOperationParams, string>;
|
package/node/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export * as awsS3 from './@aws-s3/index.js'
|
|
2
|
-
export * as
|
|
2
|
+
export * as designEdito from './@design-edito/index.js'
|
|
3
3
|
export * as googleCloud from './@google-cloud/index.js'
|
|
4
|
-
export * as
|
|
4
|
+
export * as express from './@express/index.js'
|
|
5
5
|
export * as encryption from './encryption/index.js'
|
|
6
|
+
export * as cloudStorage from './cloud-storage/index.js'
|
|
6
7
|
export * as files from './files/index.js'
|
|
7
|
-
export * as process from './process/index.js'
|
|
8
|
-
export * as images from './images/index.js'
|
|
9
8
|
export * as ftps from './ftps/index.js'
|
|
9
|
+
export * as images from './images/index.js'
|
|
10
|
+
export * as process from './process/index.js'
|
|
10
11
|
export * as sftp from './sftp/index.js'
|
|
11
|
-
export * as designEdito from './@design-edito/index.js'
|
package/node/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export * as awsS3 from './@aws-s3/index.js'
|
|
2
|
-
export * as
|
|
2
|
+
export * as designEdito from './@design-edito/index.js'
|
|
3
3
|
export * as googleCloud from './@google-cloud/index.js'
|
|
4
|
-
export * as
|
|
4
|
+
export * as express from './@express/index.js'
|
|
5
5
|
export * as encryption from './encryption/index.js'
|
|
6
|
+
export * as cloudStorage from './cloud-storage/index.js'
|
|
6
7
|
export * as files from './files/index.js'
|
|
7
|
-
export * as process from './process/index.js'
|
|
8
|
-
export * as images from './images/index.js'
|
|
9
8
|
export * as ftps from './ftps/index.js'
|
|
9
|
+
export * as images from './images/index.js'
|
|
10
|
+
export * as process from './process/index.js'
|
|
10
11
|
export * as sftp from './sftp/index.js'
|
|
11
|
-
export * as designEdito from './@design-edito/index.js'
|
|
@@ -6,13 +6,5 @@ type Output = {
|
|
|
6
6
|
err: unknown;
|
|
7
7
|
};
|
|
8
8
|
export declare function spawner(label: string | null, command: string, args: string[], argsPrintFormat?: (args: string[]) => string[], throwOnError?: boolean, options?: SpawnOptions): Promise<Outcome.Either<Output, Output>>;
|
|
9
|
-
export declare function spawnerSync(label: string | null, command: string, args: string[], argsPrintFormat?: (args: string[]) => string[], throwOnError?: boolean, options?: SpawnSyncOptions): Outcome.
|
|
10
|
-
stdout: string;
|
|
11
|
-
stderr: string;
|
|
12
|
-
err: Error | undefined;
|
|
13
|
-
}> | Outcome.Success<{
|
|
14
|
-
stdout: string;
|
|
15
|
-
stderr: string;
|
|
16
|
-
err: Error | undefined;
|
|
17
|
-
}>;
|
|
9
|
+
export declare function spawnerSync(label: string | null, command: string, args: string[], argsPrintFormat?: (args: string[]) => string[], throwOnError?: boolean, options?: SpawnSyncOptions): Outcome.Either<Output, Output>;
|
|
18
10
|
export {};
|
|
@@ -9,7 +9,7 @@ import * as Outcome from "../../../agnostic/misc/outcome/index.js";
|
|
|
9
9
|
import { styles } from "../../../agnostic/misc/logs/styles/index.js";
|
|
10
10
|
import { unknownToString } from "../../../agnostic/errors/unknown-to-string/index.js";
|
|
11
11
|
async function spawner(label, command, args, argsPrintFormat, throwOnError, options) {
|
|
12
|
-
return new Promise((resolve, reject) => {
|
|
12
|
+
return await new Promise((resolve, reject) => {
|
|
13
13
|
if (label !== null) console.log("\n" + styles.info(label) + "\n");
|
|
14
14
|
const printableArgs = argsPrintFormat !== void 0 ? argsPrintFormat(args) : args;
|
|
15
15
|
console.log(styles.light(`> ${command} ${printableArgs.join(" ")}
|
|
@@ -19,19 +19,21 @@ async function spawner(label, command, args, argsPrintFormat, throwOnError, opti
|
|
|
19
19
|
let stderr = "";
|
|
20
20
|
let err = null;
|
|
21
21
|
prcss.stdout?.on("data", (data) => {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const strData = unknownToString(data);
|
|
23
|
+
stdout += strData;
|
|
24
|
+
console.log(styles.light(strData.replace(ansiRegex(), "").trim()));
|
|
24
25
|
});
|
|
25
26
|
prcss.stderr?.on("data", (data) => {
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
const strData = unknownToString(data);
|
|
28
|
+
stderr += strData;
|
|
29
|
+
console.log(styles.warning(strData.replace(ansiRegex(), "").trim()));
|
|
28
30
|
});
|
|
29
31
|
prcss.on("error", (e) => {
|
|
30
32
|
err = e;
|
|
31
33
|
console.log(styles.error(unknownToString(err).replace(ansiRegex(), "").trim()));
|
|
32
34
|
});
|
|
33
35
|
prcss.on("close", (code) => {
|
|
34
|
-
if (code !== 0 && throwOnError === true) reject(stderr + "\n" + stdout);
|
|
36
|
+
if (code !== 0 && throwOnError === true) reject(new Error(stderr + "\n" + stdout));
|
|
35
37
|
else if (code !== 0) return resolve(Outcome.makeFailure({ stdout, stderr, err }));
|
|
36
38
|
else return resolve(Outcome.makeSuccess({ stdout, stderr, err }));
|
|
37
39
|
});
|
|
@@ -51,12 +53,12 @@ function spawnerSync(label, command, args, argsPrintFormat, throwOnError, option
|
|
|
51
53
|
console.log(styles.error(unknownToString(err).replace(ansiRegex(), "")));
|
|
52
54
|
console.log("");
|
|
53
55
|
}
|
|
54
|
-
if (stderr) {
|
|
56
|
+
if (stderr !== "") {
|
|
55
57
|
console.log(styles.light(chalk.italic("stderr:\n")));
|
|
56
58
|
console.log(styles.warning(stderr.replace(ansiRegex(), "")));
|
|
57
59
|
console.log("");
|
|
58
60
|
}
|
|
59
|
-
if (stdout) {
|
|
61
|
+
if (stdout !== "") {
|
|
60
62
|
console.log(styles.light(chalk.italic("stdout:\n")));
|
|
61
63
|
console.log(styles.light(stdout.replace(ansiRegex(), "")));
|
|
62
64
|
console.log("");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type TransferOptions } from 'ssh2-sftp-client';
|
|
2
|
+
import type Client from 'ssh2-sftp-client';
|
|
2
3
|
import * as Outcome from '../../../../agnostic/misc/outcome/index.js';
|
|
3
4
|
export type CopyDirOptions = TransferOptions & {
|
|
4
5
|
/**
|
|
@@ -20,11 +20,11 @@ async function copyDir(sftp, sourceDir, targetDir, options) {
|
|
|
20
20
|
} else if (entry.type === "-") {
|
|
21
21
|
if (!overwrite) {
|
|
22
22
|
const exists = await sftp.exists(dst);
|
|
23
|
-
if (exists) throw new Error(`File already exists at ${dst}.`);
|
|
23
|
+
if (exists !== false) throw new Error(`File already exists at ${dst}.`);
|
|
24
24
|
}
|
|
25
25
|
if (ensureDir) {
|
|
26
26
|
const dirPath = dst.substring(0, dst.lastIndexOf("/"));
|
|
27
|
-
|
|
27
|
+
await sftp.mkdir(dirPath, true);
|
|
28
28
|
}
|
|
29
29
|
const pass = new PassThrough();
|
|
30
30
|
const upload = sftp.put(pass, dst, transferOptions);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Client from 'ssh2-sftp-client';
|
|
1
|
+
import type Client from 'ssh2-sftp-client';
|
|
2
2
|
import * as Outcome from '../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
export type MoveDirOptions = {
|
|
4
4
|
/** If false and `targetDir` exists, the operation is aborted. Defaults to false. */
|
|
@@ -6,13 +6,11 @@ async function moveDir(sftp, sourceDir, targetDir, options) {
|
|
|
6
6
|
try {
|
|
7
7
|
if (ensureDir) {
|
|
8
8
|
const parentDir = targetDir.substring(0, targetDir.lastIndexOf("/"));
|
|
9
|
-
|
|
10
|
-
await sftp.mkdir(parentDir, true);
|
|
11
|
-
}
|
|
9
|
+
await sftp.mkdir(parentDir, true);
|
|
12
10
|
}
|
|
13
11
|
if (!overwrite) {
|
|
14
12
|
const exists = await sftp.exists(targetDir);
|
|
15
|
-
if (exists) return Outcome.makeFailure(`Target ${targetDir} already exists.`);
|
|
13
|
+
if (exists !== false) return Outcome.makeFailure(`Target ${targetDir} already exists.`);
|
|
16
14
|
}
|
|
17
15
|
await sftp.rename(sourceDir, targetDir);
|
|
18
16
|
return Outcome.makeSuccess(true);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Client from 'ssh2-sftp-client';
|
|
1
|
+
import type Client from 'ssh2-sftp-client';
|
|
2
2
|
import * as Outcome from '../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
export type RemoveDirOptions = {
|
|
4
4
|
/**
|
|
@@ -17,7 +17,7 @@ export type RemoveDirOptions = {
|
|
|
17
17
|
* @param {RemoveDirOptions} [options] - Optional configuration.
|
|
18
18
|
* @param {boolean} [options.ignoreMissing=true] - Whether to ignore a missing directory.
|
|
19
19
|
* @returns {Promise<Outcome.Either<true, string>>}
|
|
20
|
-
* - On success: `Outcome.makeSuccess(true)`
|
|
20
|
+
* - On success: `Outcome.makeSuccess(true)` – deletion succeeded, or the
|
|
21
21
|
* directory was absent and `ignoreMissing` is true.
|
|
22
22
|
* - On failure: `Outcome.makeFailure(errStr)` if deletion fails, or directory
|
|
23
23
|
* absent and `ignoreMissing` is false.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type TransferOptions } from 'ssh2-sftp-client';
|
|
2
|
+
import type Client from 'ssh2-sftp-client';
|
|
2
3
|
import * as Outcome from '../../../../agnostic/misc/outcome/index.js';
|
|
3
4
|
export type CopyOptions = TransferOptions & {
|
|
4
5
|
/**
|
|
@@ -11,11 +11,11 @@ async function copy(sftp, sourcePath, targetPath, options) {
|
|
|
11
11
|
try {
|
|
12
12
|
if (!overwrite) {
|
|
13
13
|
const exists = await sftp.exists(targetPath);
|
|
14
|
-
if (exists) return Outcome.makeFailure(`File already exists at ${targetPath}.`);
|
|
14
|
+
if (exists !== false) return Outcome.makeFailure(`File already exists at ${targetPath}.`);
|
|
15
15
|
}
|
|
16
16
|
if (ensureDir) {
|
|
17
17
|
const dirPath = targetPath.substring(0, targetPath.lastIndexOf("/"));
|
|
18
|
-
|
|
18
|
+
await sftp.mkdir(dirPath, true);
|
|
19
19
|
}
|
|
20
20
|
const pass = new PassThrough();
|
|
21
21
|
const uploadPromise = sftp.put(pass, targetPath, transferOptions);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Readable } from 'node:stream';
|
|
2
|
-
import { ReadStreamOptions } from 'ssh2';
|
|
3
|
-
import Client from 'ssh2-sftp-client';
|
|
1
|
+
import { type Readable } from 'node:stream';
|
|
2
|
+
import { type ReadStreamOptions } from 'ssh2';
|
|
3
|
+
import type Client from 'ssh2-sftp-client';
|
|
4
4
|
import * as Outcome from '../../../../agnostic/misc/outcome/index.js';
|
|
5
5
|
export type DownloadOptions = ReadStreamOptions;
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
export * as download from './download/index.js'
|
|
1
2
|
export * as copy from './copy/index.js'
|
|
2
|
-
export * as exists from './exists/index.js'
|
|
3
3
|
export * as move from './move/index.js'
|
|
4
|
-
export * as
|
|
4
|
+
export * as exists from './exists/index.js'
|
|
5
5
|
export * as stat from './stat/index.js'
|
|
6
|
+
export * as remove from './remove/index.js'
|
|
6
7
|
export * as upload from './upload/index.js'
|
|
7
|
-
export * as download from './download/index.js'
|
package/node/sftp/file/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
export * as download from './download/index.js'
|
|
1
2
|
export * as copy from './copy/index.js'
|
|
2
|
-
export * as exists from './exists/index.js'
|
|
3
3
|
export * as move from './move/index.js'
|
|
4
|
-
export * as
|
|
4
|
+
export * as exists from './exists/index.js'
|
|
5
5
|
export * as stat from './stat/index.js'
|
|
6
|
+
export * as remove from './remove/index.js'
|
|
6
7
|
export * as upload from './upload/index.js'
|
|
7
|
-
export * as download from './download/index.js'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Client from 'ssh2-sftp-client';
|
|
1
|
+
import type Client from 'ssh2-sftp-client';
|
|
2
2
|
import * as Outcome from '../../../../agnostic/misc/outcome/index.js';
|
|
3
3
|
export type MoveOptions = {
|
|
4
4
|
/**
|
|
@@ -20,9 +20,9 @@ export type MoveOptions = {
|
|
|
20
20
|
* The function uses `rename`, which atomically moves the file from
|
|
21
21
|
* `sourcePath` to `targetPath`. It supports two safety features:
|
|
22
22
|
*
|
|
23
|
-
* 1. **ensureDir** –
|
|
23
|
+
* 1. **ensureDir** – If enabled, the parent directory of `targetPath`
|
|
24
24
|
* is created with `mkdir -p` semantics before the rename.
|
|
25
|
-
* 2. **overwrite** –
|
|
25
|
+
* 2. **overwrite** – If disabled (default) the function first checks whether
|
|
26
26
|
* something already exists at `targetPath`; if so, it aborts.
|
|
27
27
|
*
|
|
28
28
|
* @param {Client} sftp - The ssh2‑sftp‑client instance.
|
|
@@ -9,13 +9,11 @@ async function move(sftp, sourcePath, targetPath, options) {
|
|
|
9
9
|
try {
|
|
10
10
|
if (ensureDir) {
|
|
11
11
|
const dirPath = targetPath.substring(0, targetPath.lastIndexOf("/"));
|
|
12
|
-
|
|
12
|
+
await sftp.mkdir(dirPath, true);
|
|
13
13
|
}
|
|
14
14
|
if (!overwrite) {
|
|
15
|
-
const exists = await sftp.exists(targetPath);
|
|
16
|
-
if (exists) {
|
|
17
|
-
return Outcome.makeFailure(`File already exists at ${targetPath}.`);
|
|
18
|
-
}
|
|
15
|
+
const exists = await sftp.exists(targetPath) !== false;
|
|
16
|
+
if (exists) return Outcome.makeFailure(`File already exists at ${targetPath}.`);
|
|
19
17
|
}
|
|
20
18
|
await sftp.rename(sourcePath, targetPath);
|
|
21
19
|
return Outcome.makeSuccess(true);
|
|
@@ -4,7 +4,7 @@ import * as Outcome from "../../../../agnostic/misc/outcome/index.js";
|
|
|
4
4
|
async function remove(sftp, targetPath, options) {
|
|
5
5
|
const { ignoreMissing = true } = options ?? {};
|
|
6
6
|
try {
|
|
7
|
-
const exists = await sftp.exists(targetPath);
|
|
7
|
+
const exists = await sftp.exists(targetPath) !== false;
|
|
8
8
|
if (!exists) {
|
|
9
9
|
if (ignoreMissing) return Outcome.makeSuccess(true);
|
|
10
10
|
return Outcome.makeFailure(`File not found at ${targetPath}.`);
|
|
@@ -6,7 +6,7 @@ async function stat(sftp, path) {
|
|
|
6
6
|
const info = await sftp.stat(path);
|
|
7
7
|
return Outcome.makeSuccess({
|
|
8
8
|
size: info.size,
|
|
9
|
-
modifiedAt:
|
|
9
|
+
modifiedAt: new Date(info.modifyTime * 1e3),
|
|
10
10
|
mode: info.mode,
|
|
11
11
|
uid: info.uid,
|
|
12
12
|
gid: info.gid,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Readable } from 'node:stream';
|
|
2
|
-
import Client
|
|
1
|
+
import type { Readable } from 'node:stream';
|
|
2
|
+
import type Client from 'ssh2-sftp-client';
|
|
3
|
+
import { type TransferOptions } from 'ssh2-sftp-client';
|
|
3
4
|
import * as Outcome from '../../../../agnostic/misc/outcome/index.js';
|
|
4
5
|
export type UploadOptions = TransferOptions & {
|
|
5
6
|
ensureDir?: boolean;
|
|
@@ -7,7 +7,7 @@ async function upload(sftp, targetPath, fileStream, options) {
|
|
|
7
7
|
overwrite = false
|
|
8
8
|
} = options ?? {};
|
|
9
9
|
try {
|
|
10
|
-
const exists = await sftp.exists(targetPath);
|
|
10
|
+
const exists = await sftp.exists(targetPath) !== false;
|
|
11
11
|
if (exists && !overwrite) return Outcome.makeFailure(`File already exists at ${targetPath}.`);
|
|
12
12
|
if (ensureDir) {
|
|
13
13
|
const dirPath = targetPath.substring(0, targetPath.lastIndexOf("/"));
|