update
This commit is contained in:
parent
8b07197224
commit
ca592afec9
12
package.json
12
package.json
@ -34,13 +34,13 @@
|
||||
"@push.rocks/smartmime": "^1.0.5",
|
||||
"@push.rocks/smartpath": "^5.0.11",
|
||||
"@push.rocks/smartpromise": "^4.0.2",
|
||||
"@push.rocks/smartrequest": "^2.0.18",
|
||||
"@push.rocks/smartstream": "^2.0.4",
|
||||
"@types/fs-extra": "^11.0.2",
|
||||
"@push.rocks/smartrequest": "^2.0.20",
|
||||
"@push.rocks/smartstream": "^3.0.7",
|
||||
"@types/fs-extra": "^11.0.3",
|
||||
"@types/glob": "^8.1.0",
|
||||
"@types/js-yaml": "^4.0.6",
|
||||
"@types/js-yaml": "^4.0.8",
|
||||
"fs-extra": "^11.1.1",
|
||||
"glob": "^10.3.5",
|
||||
"glob": "^10.3.10",
|
||||
"js-yaml": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -48,7 +48,7 @@
|
||||
"@git.zone/tsrun": "^1.2.46",
|
||||
"@git.zone/tstest": "^1.0.81",
|
||||
"@push.rocks/tapbundle": "^5.0.15",
|
||||
"@types/node": "^20.6.3"
|
||||
"@types/node": "^20.8.10"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
|
238
pnpm-lock.yaml
generated
238
pnpm-lock.yaml
generated
@ -30,26 +30,26 @@ dependencies:
|
||||
specifier: ^4.0.2
|
||||
version: 4.0.3
|
||||
'@push.rocks/smartrequest':
|
||||
specifier: ^2.0.18
|
||||
version: 2.0.18
|
||||
specifier: ^2.0.20
|
||||
version: 2.0.20
|
||||
'@push.rocks/smartstream':
|
||||
specifier: ^2.0.4
|
||||
version: 2.0.4
|
||||
specifier: ^3.0.7
|
||||
version: 3.0.7
|
||||
'@types/fs-extra':
|
||||
specifier: ^11.0.2
|
||||
version: 11.0.2
|
||||
specifier: ^11.0.3
|
||||
version: 11.0.3
|
||||
'@types/glob':
|
||||
specifier: ^8.1.0
|
||||
version: 8.1.0
|
||||
'@types/js-yaml':
|
||||
specifier: ^4.0.6
|
||||
version: 4.0.6
|
||||
specifier: ^4.0.8
|
||||
version: 4.0.8
|
||||
fs-extra:
|
||||
specifier: ^11.1.1
|
||||
version: 11.1.1
|
||||
glob:
|
||||
specifier: ^10.3.5
|
||||
version: 10.3.5
|
||||
specifier: ^10.3.10
|
||||
version: 10.3.10
|
||||
js-yaml:
|
||||
specifier: ^4.1.0
|
||||
version: 4.1.0
|
||||
@ -60,16 +60,16 @@ devDependencies:
|
||||
version: 2.1.70
|
||||
'@git.zone/tsrun':
|
||||
specifier: ^1.2.46
|
||||
version: 1.2.46(@types/node@20.6.3)
|
||||
version: 1.2.46(@types/node@20.8.10)
|
||||
'@git.zone/tstest':
|
||||
specifier: ^1.0.81
|
||||
version: 1.0.81(@types/node@20.6.3)(sinon@16.0.0)
|
||||
version: 1.0.81(@types/node@20.8.10)(sinon@17.0.1)
|
||||
'@push.rocks/tapbundle':
|
||||
specifier: ^5.0.15
|
||||
version: 5.0.15(sinon@16.0.0)
|
||||
version: 5.0.15(sinon@17.0.1)
|
||||
'@types/node':
|
||||
specifier: ^20.6.3
|
||||
version: 20.6.3
|
||||
specifier: ^20.8.10
|
||||
version: 20.8.10
|
||||
|
||||
packages:
|
||||
|
||||
@ -107,7 +107,7 @@ packages:
|
||||
'@push.rocks/smartopen': 2.0.0
|
||||
'@push.rocks/smartpath': 5.0.11
|
||||
'@push.rocks/smartpromise': 4.0.3
|
||||
'@push.rocks/smartrequest': 2.0.18
|
||||
'@push.rocks/smartrequest': 2.0.20
|
||||
'@push.rocks/smartrx': 3.0.6
|
||||
'@push.rocks/smartsitemap': 2.0.2
|
||||
'@push.rocks/smarttime': 4.0.5
|
||||
@ -411,13 +411,13 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@git.zone/tsrun@1.2.46(@types/node@20.6.3):
|
||||
/@git.zone/tsrun@1.2.46(@types/node@20.8.10):
|
||||
resolution: {integrity: sha512-8miFVBle9Mnjx+uPGI/P+EuWcIOXWjBAkdjN5IYbdp5Ytt4xQODCLh4JSnC9h56UeU1nUxCAxZeJs2e9TXrivA==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@push.rocks/smartfile': 10.0.30
|
||||
'@push.rocks/smartshell': 3.0.3
|
||||
ts-node: 10.9.1(@types/node@20.6.3)(typescript@5.1.6)
|
||||
ts-node: 10.9.1(@types/node@20.8.10)(typescript@5.1.6)
|
||||
typescript: 5.1.6
|
||||
transitivePeerDependencies:
|
||||
- '@swc/core'
|
||||
@ -425,13 +425,13 @@ packages:
|
||||
- '@types/node'
|
||||
dev: true
|
||||
|
||||
/@git.zone/tstest@1.0.81(@types/node@20.6.3)(sinon@16.0.0):
|
||||
/@git.zone/tstest@1.0.81(@types/node@20.8.10)(sinon@17.0.1):
|
||||
resolution: {integrity: sha512-OUTACsOmvvzbKay4i1hbBaToLzo/OaCYV1PiYpoK9S2BJMbVJAik+ZbdixbJugoLrw7bR9velYgT66lnS6OZUA==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@api.global/typedserver': 3.0.5
|
||||
'@git.zone/tsbundle': 2.0.9
|
||||
'@git.zone/tsrun': 1.2.46(@types/node@20.6.3)
|
||||
'@git.zone/tsrun': 1.2.46(@types/node@20.8.10)
|
||||
'@push.rocks/consolecolor': 2.0.1
|
||||
'@push.rocks/smartbrowser': 2.0.6
|
||||
'@push.rocks/smartdelay': 3.0.5
|
||||
@ -439,7 +439,7 @@ packages:
|
||||
'@push.rocks/smartlog': 3.0.3
|
||||
'@push.rocks/smartpromise': 4.0.3
|
||||
'@push.rocks/smartshell': 3.0.3
|
||||
'@push.rocks/tapbundle': 5.0.15(sinon@16.0.0)
|
||||
'@push.rocks/tapbundle': 5.0.15(sinon@17.0.1)
|
||||
figures: 5.0.0
|
||||
transitivePeerDependencies:
|
||||
- '@swc/core'
|
||||
@ -555,7 +555,7 @@ packages:
|
||||
lit-html: 1.4.1
|
||||
dev: true
|
||||
|
||||
/@open-wc/testing@2.5.33(sinon@16.0.0):
|
||||
/@open-wc/testing@2.5.33(sinon@17.0.1):
|
||||
resolution: {integrity: sha512-+EJNs0i+VV4nE+BrG70l2DNGXOZTSrluruaaU06HUSk57ZlKa+kIxWmkLxCOLlbgnQgrPrQWxbs3lgB1tIx/YA==}
|
||||
dependencies:
|
||||
'@open-wc/chai-dom-equals': 0.12.36
|
||||
@ -569,7 +569,7 @@ packages:
|
||||
chai-a11y-axe: 1.5.0
|
||||
chai-dom: 1.11.0(chai@4.3.8)(mocha@6.2.3)
|
||||
mocha: 6.2.3
|
||||
sinon-chai: 3.7.0(chai@4.3.8)(sinon@16.0.0)
|
||||
sinon-chai: 3.7.0(chai@4.3.8)(sinon@17.0.1)
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- sinon
|
||||
@ -703,13 +703,13 @@ packages:
|
||||
'@push.rocks/smartmime': 1.0.6
|
||||
'@push.rocks/smartpath': 5.0.11
|
||||
'@push.rocks/smartpromise': 4.0.3
|
||||
'@push.rocks/smartrequest': 2.0.18
|
||||
'@push.rocks/smartstream': 2.0.4
|
||||
'@types/fs-extra': 11.0.2
|
||||
'@push.rocks/smartrequest': 2.0.20
|
||||
'@push.rocks/smartstream': 2.0.8
|
||||
'@types/fs-extra': 11.0.3
|
||||
'@types/glob': 8.1.0
|
||||
'@types/js-yaml': 4.0.6
|
||||
'@types/js-yaml': 4.0.8
|
||||
fs-extra: 11.1.1
|
||||
glob: 10.3.5
|
||||
glob: 10.3.10
|
||||
js-yaml: 4.1.0
|
||||
dev: true
|
||||
|
||||
@ -724,13 +724,13 @@ packages:
|
||||
'@push.rocks/smartmime': 1.0.6
|
||||
'@push.rocks/smartpath': 5.0.11
|
||||
'@push.rocks/smartpromise': 4.0.3
|
||||
'@push.rocks/smartrequest': 2.0.18
|
||||
'@push.rocks/smartstream': 2.0.4
|
||||
'@types/fs-extra': 11.0.2
|
||||
'@push.rocks/smartrequest': 2.0.20
|
||||
'@push.rocks/smartstream': 2.0.8
|
||||
'@types/fs-extra': 11.0.3
|
||||
'@types/glob': 8.1.0
|
||||
'@types/js-yaml': 4.0.6
|
||||
'@types/js-yaml': 4.0.8
|
||||
fs-extra: 11.1.1
|
||||
glob: 10.3.5
|
||||
glob: 10.3.10
|
||||
js-yaml: 4.1.0
|
||||
dev: true
|
||||
|
||||
@ -861,8 +861,8 @@ packages:
|
||||
- utf-8-validate
|
||||
dev: true
|
||||
|
||||
/@push.rocks/smartrequest@2.0.18:
|
||||
resolution: {integrity: sha512-MsTou9rRHhlhBC83dUGoi6quYKrWD9urI23Bcgk2GjvkiOpaddpSib6x1cQfidoOVpwP7LaVDMD+tFnW4CpWRA==}
|
||||
/@push.rocks/smartrequest@2.0.20:
|
||||
resolution: {integrity: sha512-7Y22kOS9CGJLjayjpRbkoDxd5kqmnG9WDY1WWR3/kqo63WFhdgHueatmJjT/v1QqvKSG88gL36kG4f7YG/0xTA==}
|
||||
dependencies:
|
||||
'@push.rocks/smartpromise': 4.0.3
|
||||
'@push.rocks/smarturl': 3.0.7
|
||||
@ -875,6 +875,12 @@ packages:
|
||||
'@push.rocks/smartpromise': 4.0.3
|
||||
rxjs: 7.8.1
|
||||
|
||||
/@push.rocks/smartrx@3.0.7:
|
||||
resolution: {integrity: sha512-qCWy0s3RLAgGSnaw/Gu0BNaJ59CsI6RK5OJDCCqxc7P2X/S755vuLtnAR5/0dEjdhCHXHX9ytPZx+o9g/CNiyA==}
|
||||
dependencies:
|
||||
'@push.rocks/smartpromise': 4.0.3
|
||||
rxjs: 7.8.1
|
||||
|
||||
/@push.rocks/smartshell@3.0.3:
|
||||
resolution: {integrity: sha512-S4RXI76ltPetdJ8Gv4HlnlhR/hXDV8QmSU7TdhLEe171ZzfouAyt9XZ4MFDCtjk3VQ4Mw+zz4mSDaACXP/QdlQ==}
|
||||
dependencies:
|
||||
@ -932,15 +938,23 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@push.rocks/smartstream@2.0.4:
|
||||
resolution: {integrity: sha512-rbQf4+sLle9ga6RidRv0WXb/TuLFcMordRQBbqPq01n/mpBHoEiqIThWzVuImPVRVuSK/LKbM/QX4Ey26FFerg==}
|
||||
/@push.rocks/smartstream@2.0.8:
|
||||
resolution: {integrity: sha512-GlF/9cCkvBHwKa3DK4DO5wjfSgqkj6gAS4TrY9uD5NMHu9RQv4WiNrElTYj7iCEpnZgUnLO3tzw1JA3NRIMnnA==}
|
||||
dependencies:
|
||||
'@push.rocks/smartpromise': 4.0.3
|
||||
'@push.rocks/smartrx': 3.0.6
|
||||
'@types/from2': 2.3.2
|
||||
'@types/through2': 2.0.38
|
||||
'@push.rocks/smartrx': 3.0.7
|
||||
'@types/from2': 2.3.4
|
||||
'@types/through2': 2.0.40
|
||||
from2: 2.3.0
|
||||
through2: 4.0.2
|
||||
dev: true
|
||||
|
||||
/@push.rocks/smartstream@3.0.7:
|
||||
resolution: {integrity: sha512-F4HsYlMJusa7uf18aIXGuuAdlPxKaIcr7UDMLg4QUCtGK114SVt6E+72bXtN6yPyZ40+x8BVUWUkkTOdw22BeA==}
|
||||
dependencies:
|
||||
'@push.rocks/smartpromise': 4.0.3
|
||||
'@push.rocks/smartrx': 3.0.7
|
||||
dev: false
|
||||
|
||||
/@push.rocks/smartstring@4.0.9:
|
||||
resolution: {integrity: sha512-VB0jzKmI4ZpdzEZe79M8rKVjAReNWGMG6ktzS0R5FeH96SSk3jvfOezgz/RJ7JbRN3UcyR0Ra/mXlpyeqJUHvw==}
|
||||
@ -987,14 +1001,14 @@ packages:
|
||||
/@push.rocks/smartyaml@2.0.5:
|
||||
resolution: {integrity: sha512-tBcf+HaOIfeEsTMwgUZDtZERCxXQyRsWO8Ar5DjBdiSRchbhVGZQEBzXswMS0W5ZoRenjgPK+4tPW3JQGRTfbg==}
|
||||
dependencies:
|
||||
'@types/js-yaml': 3.12.8
|
||||
'@types/js-yaml': 3.12.9
|
||||
js-yaml: 3.14.1
|
||||
dev: true
|
||||
|
||||
/@push.rocks/tapbundle@5.0.15(sinon@16.0.0):
|
||||
/@push.rocks/tapbundle@5.0.15(sinon@17.0.1):
|
||||
resolution: {integrity: sha512-vVTVmQCovYq9xhif96z7wN8pFiB3UB9MZSkqMDgfNTWhlU19ZZR1azCZn+zXsYxgJmD8wKNYhvZYgdRz73KbBg==}
|
||||
dependencies:
|
||||
'@open-wc/testing': 2.5.33(sinon@16.0.0)
|
||||
'@open-wc/testing': 2.5.33(sinon@17.0.1)
|
||||
'@push.rocks/smartdelay': 3.0.5
|
||||
'@push.rocks/smartenv': 5.0.5
|
||||
'@push.rocks/smartexpect': 1.0.21
|
||||
@ -1308,6 +1322,12 @@ packages:
|
||||
'@sinonjs/commons': 3.0.0
|
||||
dev: true
|
||||
|
||||
/@sinonjs/fake-timers@11.2.2:
|
||||
resolution: {integrity: sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==}
|
||||
dependencies:
|
||||
'@sinonjs/commons': 3.0.0
|
||||
dev: true
|
||||
|
||||
/@sinonjs/samsam@8.0.0:
|
||||
resolution: {integrity: sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==}
|
||||
dependencies:
|
||||
@ -1362,7 +1382,7 @@ packages:
|
||||
/@types/accepts@1.3.5:
|
||||
resolution: {integrity: sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==}
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
|
||||
/@types/babel__code-frame@7.0.3:
|
||||
@ -1373,7 +1393,7 @@ packages:
|
||||
resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==}
|
||||
dependencies:
|
||||
'@types/connect': 3.4.35
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
|
||||
/@types/buffer-json@2.0.1:
|
||||
@ -1399,21 +1419,21 @@ packages:
|
||||
/@types/clean-css@4.2.7:
|
||||
resolution: {integrity: sha512-lcoZHjUAANLTACLGi+O/0pN+oKQAQ8zAMWJSxiBRNLxqZG/WE8hfXJUs1eYwJOvOnDJrvxU1kR77UiVJ3+9N0Q==}
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
source-map: 0.6.1
|
||||
dev: true
|
||||
|
||||
/@types/co-body@6.1.0:
|
||||
resolution: {integrity: sha512-3e0q2jyDAnx/DSZi0z2H0yoZ2wt5yRDZ+P7ymcMObvq0ufWRT4tsajyO+Q1VwVWiv9PRR4W3YEjEzBjeZlhF+w==}
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
'@types/qs': 6.9.8
|
||||
dev: true
|
||||
|
||||
/@types/connect@3.4.35:
|
||||
resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==}
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
|
||||
/@types/content-disposition@0.5.5:
|
||||
@ -1434,13 +1454,13 @@ packages:
|
||||
'@types/connect': 3.4.35
|
||||
'@types/express': 4.17.17
|
||||
'@types/keygrip': 1.0.2
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
|
||||
/@types/cors@2.8.14:
|
||||
resolution: {integrity: sha512-RXHUvNWYICtbP6s18PnOCaqToK8y14DnLd75c6HfyKf228dxy7pHNOQkxPtvXKp/hINFMDjbYzsj63nnpPMSRQ==}
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
|
||||
/@types/debounce@1.2.1:
|
||||
@ -1454,7 +1474,7 @@ packages:
|
||||
/@types/express-serve-static-core@4.17.36:
|
||||
resolution: {integrity: sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==}
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
'@types/qs': 6.9.8
|
||||
'@types/range-parser': 1.2.4
|
||||
'@types/send': 0.17.1
|
||||
@ -1469,22 +1489,23 @@ packages:
|
||||
'@types/serve-static': 1.15.2
|
||||
dev: true
|
||||
|
||||
/@types/from2@2.3.2:
|
||||
resolution: {integrity: sha512-s1pdctxW2+CA4FOxxTBRxC3RKQL9Br1a2s2LngP4jh1BI84JBL3mDXj87EwcckN9z/IXp8o3ySmvZveGEAAwqw==}
|
||||
/@types/from2@2.3.4:
|
||||
resolution: {integrity: sha512-Ofj/U9ytMjG5FIfFlTokSyGQdLgX8js+hbw9/qxZQbsGRjcjQPzoLGZhe6OEzrg7Sd98Il57iyxDtU1ArvCSTw==}
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
|
||||
/@types/fs-extra@11.0.2:
|
||||
resolution: {integrity: sha512-c0hrgAOVYr21EX8J0jBMXGLMgJqVf/v6yxi0dLaJboW9aQPh16Id+z6w2Tx1hm+piJOLv8xPfVKZCLfjPw/IMQ==}
|
||||
/@types/fs-extra@11.0.3:
|
||||
resolution: {integrity: sha512-sF59BlXtUdzEAL1u0MSvuzWd7PdZvZEtnaVkzX5mjpdWTJ8brG0jUqve3jPCzSzvAKKMHTG8F8o/WMQLtleZdQ==}
|
||||
dependencies:
|
||||
'@types/jsonfile': 6.1.2
|
||||
'@types/node': 20.6.3
|
||||
'@types/jsonfile': 6.1.3
|
||||
'@types/node': 20.8.10
|
||||
|
||||
/@types/glob@8.1.0:
|
||||
resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==}
|
||||
dependencies:
|
||||
'@types/minimatch': 5.1.2
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
|
||||
/@types/html-minifier@4.0.3:
|
||||
resolution: {integrity: sha512-e55KfPv+cXjd2AXwkuVfMw/hcJipNoS+JML+z3ijqzMHgc6F2iviWSEUx5tXQ6Yu5UtYtLH35ae2ftFsRJTmLA==}
|
||||
@ -1522,17 +1543,17 @@ packages:
|
||||
'@types/istanbul-lib-report': 3.0.0
|
||||
dev: true
|
||||
|
||||
/@types/js-yaml@3.12.8:
|
||||
resolution: {integrity: sha512-6McoI148SFmiE2m2Y9lpzwN238grgzEn2J1mHoc8UWwDKvAUsjl100jjqoj5ORVqDwWuEmD+zlOES0+jI7fZCA==}
|
||||
/@types/js-yaml@3.12.9:
|
||||
resolution: {integrity: sha512-s5v3+2RB96nd7AOZXLScwHDRClor83+0E5q+5fzq0fTFXw8spF3QWHAUmHwItmmlr7XnDjpM0FkAgNKHzDTXtg==}
|
||||
dev: true
|
||||
|
||||
/@types/js-yaml@4.0.6:
|
||||
resolution: {integrity: sha512-ACTuifTSIIbyksx2HTon3aFtCKWcID7/h3XEmRpDYdMCXxPbl+m9GteOJeaAkiAta/NJaSFuA7ahZ0NkwajDSw==}
|
||||
/@types/js-yaml@4.0.8:
|
||||
resolution: {integrity: sha512-m6jnPk1VhlYRiLFm3f8X9Uep761f+CK8mHyS65LutH2OhmBF0BeMEjHgg05usH8PLZMWWc/BUR9RPmkvpWnyRA==}
|
||||
|
||||
/@types/jsonfile@6.1.2:
|
||||
resolution: {integrity: sha512-8t92P+oeW4d/CRQfJaSqEwXujrhH4OEeHRjGU3v1Q8mUS8GPF3yiX26sw4svv6faL2HfBtGTe2xWIoVgN3dy9w==}
|
||||
/@types/jsonfile@6.1.3:
|
||||
resolution: {integrity: sha512-/yqTk2SZ1wIezK0hiRZD7RuSf4B3whFxFamB1kGStv+8zlWScTMcHanzfc0XKWs5vA1TkHeckBlOyM8jxU8nHA==}
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
|
||||
/@types/keygrip@1.0.2:
|
||||
resolution: {integrity: sha512-GJhpTepz2udxGexqos8wgaBx4I/zWIDPh/KOGEwAqtuGDkOUJu5eFvwmdBX4AmB8Odsr+9pHCQqiAqDL/yKMKw==}
|
||||
@ -1554,7 +1575,7 @@ packages:
|
||||
'@types/http-errors': 2.0.1
|
||||
'@types/keygrip': 1.0.2
|
||||
'@types/koa-compose': 3.2.5
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
|
||||
/@types/mime-types@2.1.1:
|
||||
@ -1579,8 +1600,10 @@ packages:
|
||||
resolution: {integrity: sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==}
|
||||
dev: true
|
||||
|
||||
/@types/node@20.6.3:
|
||||
resolution: {integrity: sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==}
|
||||
/@types/node@20.8.10:
|
||||
resolution: {integrity: sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==}
|
||||
dependencies:
|
||||
undici-types: 5.26.5
|
||||
|
||||
/@types/parse5@6.0.3:
|
||||
resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==}
|
||||
@ -1609,7 +1632,7 @@ packages:
|
||||
resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==}
|
||||
dependencies:
|
||||
'@types/mime': 1.3.2
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
|
||||
/@types/serve-static@1.15.2:
|
||||
@ -1617,7 +1640,7 @@ packages:
|
||||
dependencies:
|
||||
'@types/http-errors': 2.0.1
|
||||
'@types/mime': 3.0.1
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
|
||||
/@types/shortid@0.0.29:
|
||||
@ -1644,15 +1667,16 @@ packages:
|
||||
/@types/symbol-tree@3.2.2:
|
||||
resolution: {integrity: sha512-+NcSHyA9K2EDHv3ny4wpbRSA+f+Tj0O7hIj7+w4tVw9yxqMavXwtFwuZEo3vyigTgOhGkrAUl3gj4oxAcyLfRQ==}
|
||||
|
||||
/@types/through2@2.0.38:
|
||||
resolution: {integrity: sha512-YFu+nHmjxMurkH1BSzA0Z1WrKDAY8jUKPZctNQn7mc+/KKtp2XxnclHFXxdB1m7Iqnzb5aywgP8TMK283LezGQ==}
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
|
||||
/@types/through2@2.0.39:
|
||||
resolution: {integrity: sha512-zhK74atBQ1pl1CNNYDpRJT8I6m794CsDGN0q8aDcQ7jvxlg1SVUy7gio7nOnYHMzhnGT0Vv4C53lw94MSWCeWA==}
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
|
||||
/@types/through2@2.0.40:
|
||||
resolution: {integrity: sha512-QeEwyeGxvtKjP0I/SR8pHtKMgmqotWTI8V/rNMTjbF3arWZJV/kYtbZXtwQKxUuV/oPSGkUilSspFKkTgCPTpA==}
|
||||
dependencies:
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
|
||||
/@types/trusted-types@2.0.4:
|
||||
resolution: {integrity: sha512-IDaobHimLQhjwsQ/NMwRVfa/yL7L/wriQPMhw1ZJall0KX6E1oxk29XMDeilW5qTIg5aoiqf5Udy8U/51aNoQQ==}
|
||||
@ -1683,14 +1707,14 @@ packages:
|
||||
/@types/ws@7.4.7:
|
||||
resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==}
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
|
||||
/@types/yauzl@2.10.0:
|
||||
resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==}
|
||||
/@types/yauzl@2.10.2:
|
||||
resolution: {integrity: sha512-Km7XAtUIduROw7QPgvcft0lIupeG8a8rdKL8RiSyKvlE7dYY31fEn41HVuQsRFDuROA8tA4K2UVL+WdfFmErBA==}
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
@ -2320,6 +2344,7 @@ packages:
|
||||
|
||||
/core-util-is@1.0.3:
|
||||
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
|
||||
dev: true
|
||||
|
||||
/cors@2.8.5:
|
||||
resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==}
|
||||
@ -2588,7 +2613,7 @@ packages:
|
||||
dependencies:
|
||||
'@types/cookie': 0.4.1
|
||||
'@types/cors': 2.8.14
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
accepts: 1.3.8
|
||||
base64id: 2.0.0
|
||||
cookie: 0.4.2
|
||||
@ -2800,7 +2825,7 @@ packages:
|
||||
get-stream: 5.2.0
|
||||
yauzl: 2.10.0
|
||||
optionalDependencies:
|
||||
'@types/yauzl': 2.10.0
|
||||
'@types/yauzl': 2.10.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
@ -2956,6 +2981,7 @@ packages:
|
||||
dependencies:
|
||||
inherits: 2.0.4
|
||||
readable-stream: 2.3.8
|
||||
dev: true
|
||||
|
||||
/fs-constants@1.0.0:
|
||||
resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
|
||||
@ -3042,15 +3068,15 @@ packages:
|
||||
is-glob: 4.0.3
|
||||
dev: true
|
||||
|
||||
/glob@10.3.5:
|
||||
resolution: {integrity: sha512-bYUpUD7XDEHI4Q2O5a7PXGvyw4deKR70kHiDxzQbe925wbZknhOzUt2xBgTkYL6RBcVeXYuD9iNYeqoWbBZQnA==}
|
||||
/glob@10.3.10:
|
||||
resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==}
|
||||
engines: {node: '>=16 || 14 >=14.17'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
foreground-child: 3.1.1
|
||||
jackspeak: 2.3.3
|
||||
jackspeak: 2.3.6
|
||||
minimatch: 9.0.3
|
||||
minipass: 7.0.3
|
||||
minipass: 7.0.4
|
||||
path-scurry: 1.10.1
|
||||
|
||||
/glob@7.1.3:
|
||||
@ -3510,6 +3536,7 @@ packages:
|
||||
|
||||
/isarray@1.0.0:
|
||||
resolution: {integrity: sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=}
|
||||
dev: true
|
||||
|
||||
/isarray@2.0.5:
|
||||
resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==}
|
||||
@ -3549,8 +3576,8 @@ packages:
|
||||
istanbul-lib-report: 3.0.1
|
||||
dev: true
|
||||
|
||||
/jackspeak@2.3.3:
|
||||
resolution: {integrity: sha512-R2bUw+kVZFS/h1AZqBKrSgDmdmjApzgY0AlCPumopFiAlbUxE2gf+SCuBzQ0cP5hHmUmFYF5yw55T97Th5Kstg==}
|
||||
/jackspeak@2.3.6:
|
||||
resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==}
|
||||
engines: {node: '>=14'}
|
||||
dependencies:
|
||||
'@isaacs/cliui': 8.0.2
|
||||
@ -3972,8 +3999,8 @@ packages:
|
||||
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||
dev: true
|
||||
|
||||
/minipass@7.0.3:
|
||||
resolution: {integrity: sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==}
|
||||
/minipass@7.0.4:
|
||||
resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==}
|
||||
engines: {node: '>=16 || 14 >=14.17'}
|
||||
|
||||
/mkdirp-classic@0.5.3:
|
||||
@ -4064,8 +4091,8 @@ packages:
|
||||
engines: {node: '>= 0.6'}
|
||||
dev: true
|
||||
|
||||
/nise@5.1.4:
|
||||
resolution: {integrity: sha512-8+Ib8rRJ4L0o3kfmyVCL7gzrohyDe0cMFTBa2d364yIrEGMEoetznKJx899YxjybU6bL9SQkYPSBBs1gyYs8Xg==}
|
||||
/nise@5.1.5:
|
||||
resolution: {integrity: sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw==}
|
||||
dependencies:
|
||||
'@sinonjs/commons': 2.0.0
|
||||
'@sinonjs/fake-timers': 10.3.0
|
||||
@ -4291,7 +4318,7 @@ packages:
|
||||
engines: {node: '>=16 || 14 >=14.17'}
|
||||
dependencies:
|
||||
lru-cache: 10.0.1
|
||||
minipass: 7.0.3
|
||||
minipass: 7.0.4
|
||||
|
||||
/path-to-regexp@0.1.7:
|
||||
resolution: {integrity: sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=}
|
||||
@ -4376,6 +4403,7 @@ packages:
|
||||
|
||||
/process-nextick-args@2.0.1:
|
||||
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
|
||||
dev: true
|
||||
|
||||
/progress@2.0.3:
|
||||
resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}
|
||||
@ -4508,6 +4536,7 @@ packages:
|
||||
safe-buffer: 5.1.2
|
||||
string_decoder: 1.1.1
|
||||
util-deprecate: 1.0.2
|
||||
dev: true
|
||||
|
||||
/readable-stream@3.6.2:
|
||||
resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
|
||||
@ -4628,6 +4657,7 @@ packages:
|
||||
|
||||
/safe-buffer@5.1.2:
|
||||
resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
|
||||
dev: true
|
||||
|
||||
/safe-buffer@5.2.1:
|
||||
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
|
||||
@ -4742,24 +4772,24 @@ packages:
|
||||
resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
|
||||
engines: {node: '>=14'}
|
||||
|
||||
/sinon-chai@3.7.0(chai@4.3.8)(sinon@16.0.0):
|
||||
/sinon-chai@3.7.0(chai@4.3.8)(sinon@17.0.1):
|
||||
resolution: {integrity: sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g==}
|
||||
peerDependencies:
|
||||
chai: ^4.0.0
|
||||
sinon: '>=4.0.0'
|
||||
dependencies:
|
||||
chai: 4.3.8
|
||||
sinon: 16.0.0
|
||||
sinon: 17.0.1
|
||||
dev: true
|
||||
|
||||
/sinon@16.0.0:
|
||||
resolution: {integrity: sha512-B8AaZZm9CT5pqe4l4uWJztfD/mOTa7dL8Qo0W4+s+t74xECOgSZDDQCBjNgIK3+n4kyxQrSTv2V5ul8K25qkiQ==}
|
||||
/sinon@17.0.1:
|
||||
resolution: {integrity: sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==}
|
||||
dependencies:
|
||||
'@sinonjs/commons': 3.0.0
|
||||
'@sinonjs/fake-timers': 10.3.0
|
||||
'@sinonjs/fake-timers': 11.2.2
|
||||
'@sinonjs/samsam': 8.0.0
|
||||
diff: 5.1.0
|
||||
nise: 5.1.4
|
||||
nise: 5.1.5
|
||||
supports-color: 7.2.0
|
||||
dev: true
|
||||
|
||||
@ -4929,6 +4959,7 @@ packages:
|
||||
resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
|
||||
dependencies:
|
||||
safe-buffer: 5.1.2
|
||||
dev: true
|
||||
|
||||
/string_decoder@1.3.0:
|
||||
resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
|
||||
@ -5087,7 +5118,7 @@ packages:
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/ts-node@10.9.1(@types/node@20.6.3)(typescript@5.1.6):
|
||||
/ts-node@10.9.1(@types/node@20.8.10)(typescript@5.1.6):
|
||||
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
@ -5106,7 +5137,7 @@ packages:
|
||||
'@tsconfig/node12': 1.0.11
|
||||
'@tsconfig/node14': 1.0.3
|
||||
'@tsconfig/node16': 1.0.4
|
||||
'@types/node': 20.6.3
|
||||
'@types/node': 20.8.10
|
||||
acorn: 8.10.0
|
||||
acorn-walk: 8.2.0
|
||||
arg: 4.1.3
|
||||
@ -5233,6 +5264,9 @@ packages:
|
||||
through: 2.3.8
|
||||
dev: true
|
||||
|
||||
/undici-types@5.26.5:
|
||||
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
|
||||
|
||||
/unicode-trie@0.3.1:
|
||||
resolution: {integrity: sha1-1nHd3YkQGgi6w3tqUWEBBgIFIIU=}
|
||||
dependencies:
|
||||
|
0
test/test.streamfile.ts
Normal file
0
test/test.streamfile.ts
Normal file
10
test/test.ts
10
test/test.ts
@ -64,7 +64,7 @@ tap.test('.fs.fileTreeToObject -> should read a file tree into an Object', async
|
||||
path.resolve('./test/testassets/'),
|
||||
'**/*.txt'
|
||||
);
|
||||
expect(fileArrayArg[0]).toBeInstanceOf(smartfile.Smartfile);
|
||||
expect(fileArrayArg[0]).toBeInstanceOf(smartfile.SmartFile);
|
||||
expect(fileArrayArg[0].contents.toString()).toEqual(fileArrayArg[0].contentBuffer.toString());
|
||||
});
|
||||
|
||||
@ -175,7 +175,7 @@ tap.test('.Smartfile -> should produce vinyl compatible files', async () => {
|
||||
'./test/testassets/testfolder/**/*'
|
||||
);
|
||||
const localSmartfile = smartfileArray[0];
|
||||
expect(localSmartfile).toBeInstanceOf(smartfile.Smartfile);
|
||||
expect(localSmartfile).toBeInstanceOf(smartfile.SmartFile);
|
||||
expect(localSmartfile.contents).toBeInstanceOf(Buffer);
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
expect(localSmartfile.isBuffer()).toBeTrue();
|
||||
@ -202,9 +202,9 @@ tap.test('should output a smartfile array to disk', async () => {
|
||||
tap.test('should create, store and retrieve valid smartfiles', async () => {
|
||||
const fileString = 'hi there';
|
||||
const filePath = './test/testassets/utf8.txt';
|
||||
const smartfileInstance = await smartfile.Smartfile.fromString(filePath, fileString, 'utf8');
|
||||
const smartfileInstance = await smartfile.SmartFile.fromString(filePath, fileString, 'utf8');
|
||||
smartfileInstance.write();
|
||||
const smartfileInstance2 = await smartfile.Smartfile.fromFilePath(filePath);
|
||||
const smartfileInstance2 = await smartfile.SmartFile.fromFilePath(filePath);
|
||||
const retrievedString = smartfileInstance.contents.toString();
|
||||
expect(retrievedString).toEqual(fileString);
|
||||
});
|
||||
@ -212,7 +212,7 @@ tap.test('should create, store and retrieve valid smartfiles', async () => {
|
||||
tap.test('should get a hash', async () => {
|
||||
const fileString = 'hi there';
|
||||
const filePath = './test/testassets/utf8.txt';
|
||||
const smartfileInstance = await smartfile.Smartfile.fromString(filePath, fileString, 'utf8');
|
||||
const smartfileInstance = await smartfile.SmartFile.fromString(filePath, fileString, 'utf8');
|
||||
const hash = await smartfileInstance.getHash();
|
||||
console.log(hash);
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as plugins from './smartfile.plugins.js';
|
||||
import * as fs from './smartfile.fs.js';
|
||||
import * as memory from './smartfile.memory.js';
|
||||
import * as fs from './fs.js';
|
||||
import * as memory from './memory.js';
|
||||
|
||||
export interface ISmartfileConstructorOptions {
|
||||
path: string;
|
||||
@ -9,10 +9,9 @@ export interface ISmartfileConstructorOptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* class Smartfile
|
||||
* -> is vinyl file compatible
|
||||
* an vinyl file compatible in memory file class
|
||||
*/
|
||||
export class Smartfile extends plugins.smartjson.Smartjson {
|
||||
export class SmartFile extends plugins.smartjson.Smartjson {
|
||||
// ======
|
||||
// STATIC
|
||||
// ======
|
||||
@ -24,7 +23,7 @@ export class Smartfile extends plugins.smartjson.Smartjson {
|
||||
public static async fromFilePath(filePath: string, baseArg: string = process.cwd()) {
|
||||
filePath = plugins.path.resolve(filePath);
|
||||
const fileBuffer = fs.toBufferSync(filePath);
|
||||
const smartfile = new Smartfile({
|
||||
const smartfile = new SmartFile({
|
||||
contentBuffer: fileBuffer,
|
||||
base: baseArg,
|
||||
path: plugins.path.relative(baseArg, filePath),
|
||||
@ -37,7 +36,7 @@ export class Smartfile extends plugins.smartjson.Smartjson {
|
||||
contentBufferArg: Buffer,
|
||||
baseArg: string = process.cwd()
|
||||
) {
|
||||
const smartfile = new Smartfile({
|
||||
const smartfile = new SmartFile({
|
||||
contentBuffer: contentBufferArg,
|
||||
base: baseArg,
|
||||
path: plugins.path.relative(baseArg, filePath),
|
||||
@ -52,7 +51,7 @@ export class Smartfile extends plugins.smartjson.Smartjson {
|
||||
encodingArg: 'utf8' | 'binary',
|
||||
baseArg = process.cwd()
|
||||
) {
|
||||
const smartfile = new Smartfile({
|
||||
const smartfile = new SmartFile({
|
||||
contentBuffer: Buffer.from(contentStringArg, encodingArg),
|
||||
base: baseArg,
|
||||
path: plugins.path.relative(baseArg, filePath),
|
||||
@ -62,7 +61,7 @@ export class Smartfile extends plugins.smartjson.Smartjson {
|
||||
}
|
||||
|
||||
public static async fromFoldedJson(foldedJsonArg: string) {
|
||||
return new Smartfile(plugins.smartjson.parse(foldedJsonArg));
|
||||
return new SmartFile(plugins.smartjson.parse(foldedJsonArg));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -75,14 +74,14 @@ export class Smartfile extends plugins.smartjson.Smartjson {
|
||||
stream: plugins.stream.Readable,
|
||||
filePath: string,
|
||||
baseArg: string = process.cwd()
|
||||
): Promise<Smartfile> {
|
||||
return new Promise<Smartfile>((resolve, reject) => {
|
||||
): Promise<SmartFile> {
|
||||
return new Promise<SmartFile>((resolve, reject) => {
|
||||
const chunks: Buffer[] = [];
|
||||
stream.on('data', (chunk) => chunks.push(Buffer.from(chunk)));
|
||||
stream.on('error', (error) => reject(error));
|
||||
stream.on('end', () => {
|
||||
const contentBuffer = Buffer.concat(chunks);
|
||||
const smartfile = new Smartfile({
|
||||
const smartfile = new SmartFile({
|
||||
contentBuffer: contentBuffer,
|
||||
base: baseArg,
|
||||
path: plugins.path.relative(baseArg, filePath),
|
90
ts/classes.streamfile.ts
Normal file
90
ts/classes.streamfile.ts
Normal file
@ -0,0 +1,90 @@
|
||||
import * as plugins from './smartfile.plugins.js';
|
||||
import * as fsStream from './fsstream.js';
|
||||
import { Readable } from 'stream';
|
||||
|
||||
type StreamSource = () => Promise<Readable>;
|
||||
|
||||
/**
|
||||
* The StreamFile class represents a file as a stream.
|
||||
* It allows creating streams from a file path, a URL, or a buffer.
|
||||
*/
|
||||
export class StreamFile {
|
||||
// INSTANCE
|
||||
relativeFilePath?: string;
|
||||
private streamSource: StreamSource;
|
||||
|
||||
private constructor(streamSource: StreamSource, relativeFilePath?: string) {
|
||||
this.streamSource = streamSource;
|
||||
this.relativeFilePath = relativeFilePath;
|
||||
}
|
||||
|
||||
// STATIC
|
||||
|
||||
public static async fromPath(filePath: string): Promise<StreamFile> {
|
||||
const streamSource = () => Promise.resolve(fsStream.createReadStream(filePath));
|
||||
return new StreamFile(streamSource, filePath);
|
||||
}
|
||||
|
||||
public static async fromUrl(url: string): Promise<StreamFile> {
|
||||
const streamSource = async () => plugins.smartrequest.getStream(url); // Replace with actual plugin method
|
||||
return new StreamFile(streamSource);
|
||||
}
|
||||
|
||||
public static fromBuffer(buffer: Buffer, relativeFilePath?: string): StreamFile {
|
||||
const streamSource = () => {
|
||||
const stream = new Readable();
|
||||
stream.push(buffer);
|
||||
stream.push(null); // End of stream
|
||||
return Promise.resolve(stream);
|
||||
};
|
||||
return new StreamFile(streamSource, relativeFilePath);
|
||||
}
|
||||
|
||||
// METHODS
|
||||
|
||||
/**
|
||||
* Creates a new readable stream from the source.
|
||||
*/
|
||||
public async createReadStream(): Promise<Readable> {
|
||||
return this.streamSource();
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the stream to the disk at the specified path.
|
||||
* @param filePathArg The file path where the stream should be written.
|
||||
*/
|
||||
public async writeToDisk(filePathArg: string): Promise<void> {
|
||||
const readStream = await this.createReadStream();
|
||||
const writeStream = fsStream.createWriteStream(filePathArg);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
readStream.pipe(writeStream);
|
||||
readStream.on('error', reject);
|
||||
writeStream.on('error', reject);
|
||||
writeStream.on('finish', resolve);
|
||||
});
|
||||
}
|
||||
|
||||
public async writeToDir(dirPathArg: string) {
|
||||
const filePath = plugins.path.join(dirPathArg, this.relativeFilePath);
|
||||
return this.writeToDisk(filePath);
|
||||
}
|
||||
|
||||
public async getContentAsBuffer() {
|
||||
const done = plugins.smartpromise.defer<Buffer>();
|
||||
const readStream = await this.createReadStream();
|
||||
const chunks: Buffer[] = [];
|
||||
readStream.on('data', (chunk) => chunks.push(Buffer.from(chunk)));
|
||||
readStream.on('error', done.reject);
|
||||
readStream.on('end', () => {
|
||||
const contentBuffer = Buffer.concat(chunks);
|
||||
done.resolve(contentBuffer);
|
||||
});
|
||||
return done.promise;
|
||||
}
|
||||
|
||||
public async getContentAsString(formatArg: 'utf8' | 'binary' = 'utf8') {
|
||||
const contentBuffer = await this.getContentAsBuffer();
|
||||
return contentBuffer.toString(formatArg);
|
||||
}
|
||||
}
|
@ -1,11 +1,21 @@
|
||||
import { Smartfile } from './smartfile.classes.smartfile.js';
|
||||
import { SmartFile } from './classes.smartfile.js';
|
||||
import * as plugins from './smartfile.plugins.js';
|
||||
import * as fs from './smartfile.fs.js';
|
||||
import * as fs from './fs.js';
|
||||
|
||||
|
||||
export interface IVirtualDirectoryConstructorOptions {
|
||||
mode: ''
|
||||
}
|
||||
|
||||
/**
|
||||
* a virtual directory exposes a fs api
|
||||
*/
|
||||
export class VirtualDirectory {
|
||||
|
||||
consstructor(options = {}) {
|
||||
|
||||
}
|
||||
|
||||
// STATIC
|
||||
public static async fromFsDirPath(pathArg: string): Promise<VirtualDirectory> {
|
||||
const newVirtualDir = new VirtualDirectory();
|
||||
@ -18,17 +28,17 @@ export class VirtualDirectory {
|
||||
): Promise<VirtualDirectory> {
|
||||
const newVirtualDir = new VirtualDirectory();
|
||||
for (const fileArg of virtualDirTransferableObjectArg.files) {
|
||||
newVirtualDir.addSmartfiles([Smartfile.enfoldFromJson(fileArg) as Smartfile]);
|
||||
newVirtualDir.addSmartfiles([SmartFile.enfoldFromJson(fileArg) as SmartFile]);
|
||||
}
|
||||
return newVirtualDir;
|
||||
}
|
||||
|
||||
// INSTANCE
|
||||
public smartfileArray: Smartfile[] = [];
|
||||
public smartfileArray: SmartFile[] = [];
|
||||
|
||||
constructor() {}
|
||||
|
||||
public addSmartfiles(smartfileArrayArg: Smartfile[]) {
|
||||
public addSmartfiles(smartfileArrayArg: SmartFile[]) {
|
||||
this.smartfileArray = this.smartfileArray.concat(smartfileArrayArg);
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
import * as plugins from './smartfile.plugins.js';
|
||||
import * as interpreter from './smartfile.interpreter.js';
|
||||
import * as interpreter from './interpreter.js';
|
||||
|
||||
import { Smartfile } from './smartfile.classes.smartfile.js';
|
||||
import { SmartFile } from './classes.smartfile.js';
|
||||
|
||||
import * as memory from './smartfile.memory.js';
|
||||
import * as memory from './memory.js';
|
||||
/*===============================================================
|
||||
============================ Checks =============================
|
||||
===============================================================*/
|
||||
@ -258,7 +258,7 @@ export const fileTreeToObject = async (dirPathArg: string, miniMatchFilter: stri
|
||||
}
|
||||
|
||||
const fileTree = await listFileTree(dirPath, miniMatchFilter);
|
||||
const smartfileArray: Smartfile[] = [];
|
||||
const smartfileArray: SmartFile[] = [];
|
||||
for (const filePath of fileTree) {
|
||||
const readPath = ((): string => {
|
||||
if (!plugins.path.isAbsolute(filePath)) {
|
||||
@ -271,7 +271,7 @@ export const fileTreeToObject = async (dirPathArg: string, miniMatchFilter: stri
|
||||
|
||||
// push a read file as Smartfile
|
||||
smartfileArray.push(
|
||||
new Smartfile({
|
||||
new SmartFile({
|
||||
contentBuffer: fileBuffer,
|
||||
base: dirPath,
|
||||
path: filePath,
|
12
ts/index.ts
12
ts/index.ts
@ -1,11 +1,11 @@
|
||||
import * as plugins from './smartfile.plugins.js';
|
||||
import * as fsMod from './smartfile.fs.js';
|
||||
import * as fsStreamMod from './smartfile.fsstream.js';
|
||||
import * as interpreterMod from './smartfile.interpreter.js';
|
||||
import * as memoryMod from './smartfile.memory.js';
|
||||
import * as fsMod from './fs.js';
|
||||
import * as fsStreamMod from './fsstream.js';
|
||||
import * as interpreterMod from './interpreter.js';
|
||||
import * as memoryMod from './memory.js';
|
||||
|
||||
export * from './smartfile.classes.smartfile.js';
|
||||
export * from './smartfile.classes.virtualdirectory.js';
|
||||
export * from './classes.smartfile.js';
|
||||
export * from './classes.virtualdirectory.js';
|
||||
|
||||
export const fs = fsMod;
|
||||
export const fsStream = fsStreamMod;
|
||||
|
@ -1,7 +1,8 @@
|
||||
import * as plugins from './smartfile.plugins.js';
|
||||
import { Smartfile } from './smartfile.classes.smartfile.js';
|
||||
import * as smartfileFs from './smartfile.fs.js';
|
||||
import * as interpreter from './smartfile.interpreter.js';
|
||||
import { SmartFile } from './classes.smartfile.js';
|
||||
import * as smartfileFs from './fs.js';
|
||||
import * as interpreter from './interpreter.js';
|
||||
import type { StreamFile } from './classes.streamfile.js';
|
||||
|
||||
/**
|
||||
* converts file to Object
|
||||
@ -24,7 +25,7 @@ export interface IToFsOptions {
|
||||
* @param fileBaseArg
|
||||
*/
|
||||
export let toFs = async (
|
||||
fileContentArg: string | Buffer | Smartfile,
|
||||
fileContentArg: string | Buffer | SmartFile | StreamFile,
|
||||
filePathArg: string,
|
||||
optionsArg: IToFsOptions = {}
|
||||
) => {
|
||||
@ -41,7 +42,7 @@ export let toFs = async (
|
||||
let filePath: string = filePathArg;
|
||||
|
||||
// handle Smartfile
|
||||
if (fileContentArg instanceof Smartfile) {
|
||||
if (fileContentArg instanceof SmartFile) {
|
||||
fileContent = fileContentArg.contentBuffer;
|
||||
// handle options
|
||||
if (optionsArg.respectRelative) {
|
||||
@ -83,7 +84,7 @@ export const toFsSync = (fileArg: string, filePathArg: string) => {
|
||||
plugins.fsExtra.writeFileSync(filePath, fileString, { encoding: 'utf8' });
|
||||
};
|
||||
|
||||
export let smartfileArrayToFs = async (smartfileArrayArg: Smartfile[], dirArg: string) => {
|
||||
export let smartfileArrayToFs = async (smartfileArrayArg: SmartFile[], dirArg: string) => {
|
||||
await smartfileFs.ensureDir(dirArg);
|
||||
for (const smartfile of smartfileArrayArg) {
|
||||
await toFs(smartfile, dirArg, {
|
Loading…
Reference in New Issue
Block a user