@d0paminedriven/fs 10.0.0 → 10.1.0

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.
@@ -117,33 +117,9 @@ var FsFetch = class extends FsTmp {
117
117
  if (!URL.canParse(inputUrl))
118
118
  throw new Error(`invalid URL ${inputUrl} is unable to be parsed`);
119
119
  try {
120
- const [head, meta] = await Promise.all([
121
- fetch(inputUrl, {
122
- method: this.knownToBlockHead(inputUrl)
123
- }),
124
- this.extractRemote(inputUrl, 4096 * 48)
125
- ]);
126
- let ct;
127
- let ext;
128
- let size;
129
- const s = head.headers.get("Content-Type");
130
- const cl = head.headers.get("content-length");
131
- if (meta.contentType && meta.byteSize && meta.format) {
132
- if (!s?.startsWith("image/") || !s?.startsWith("text") || !s?.startsWith("application")) {
133
- ct = meta.contentType;
134
- ext = this.toExtObj[s][0];
135
- size = meta.byteSize;
136
- } else {
137
- ct = meta.contentType;
138
- ext = meta.format;
139
- size = meta.byteSize;
140
- }
141
- } else {
142
- const assetTypeViaUrl = this.assetType(inputUrl);
143
- ct = head.headers.get("Content-Type") ?? "application/octet-stream";
144
- ext = typeof assetTypeViaUrl === "undefined" ? this.toExtObj[ct][0] : assetTypeViaUrl;
145
- size = cl ? Number.parseInt(cl, 10) / (1024 * 1024) : 0;
146
- }
120
+ const meta = await this.extractRemote(inputUrl, 4096 * 48);
121
+ const ext = meta.format ?? "bin";
122
+ const size = meta.byteSize ?? 0;
147
123
  const { unit, value } = this.autoFileSizeRaw(size);
148
124
  console.log(
149
125
  `fetchRemoteWriteLocalLargeFiles extracting a file of size ${value} ${unit}`
@@ -184,4 +160,4 @@ var FsFetch = class extends FsTmp {
184
160
  export {
185
161
  FsFetch
186
162
  };
187
- //# sourceMappingURL=chunk-7JQ56XIH.js.map
163
+ //# sourceMappingURL=chunk-4D2YBCI6.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FsFetch
3
- } from "./chunk-7JQ56XIH.js";
3
+ } from "./chunk-4D2YBCI6.js";
4
4
  import {
5
5
  __name
6
6
  } from "./chunk-7QVYU63E.js";
@@ -74,4 +74,4 @@ var Fs = class extends FsFetch {
74
74
  export {
75
75
  Fs
76
76
  };
77
- //# sourceMappingURL=chunk-7LOAFIZM.js.map
77
+ //# sourceMappingURL=chunk-JZ6JNZZ6.js.map
package/dist/fs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Fs
3
- } from "../chunk-7LOAFIZM.js";
4
- import "../chunk-7JQ56XIH.js";
3
+ } from "../chunk-JZ6JNZZ6.js";
4
+ import "../chunk-4D2YBCI6.js";
5
5
  import "../chunk-PATMSIQK.js";
6
6
  import "../chunk-OHKRQJZH.js";
7
7
  import "../chunk-DNR5ZI2T.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FsFetch
3
- } from "../chunk-7JQ56XIH.js";
3
+ } from "../chunk-4D2YBCI6.js";
4
4
  import "../chunk-PATMSIQK.js";
5
5
  import "../chunk-OHKRQJZH.js";
6
6
  import "../chunk-DNR5ZI2T.js";
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Fs
3
- } from "./chunk-7LOAFIZM.js";
3
+ } from "./chunk-JZ6JNZZ6.js";
4
4
  import {
5
5
  FsFetch
6
- } from "./chunk-7JQ56XIH.js";
6
+ } from "./chunk-4D2YBCI6.js";
7
7
  import {
8
8
  FsTmp
9
9
  } from "./chunk-PATMSIQK.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d0paminedriven/fs",
3
- "version": "10.0.0",
3
+ "version": "10.1.0",
4
4
  "homepage": "https://github.com/DopamineDriven/d0paminedriven/blob/master/packages/fs/README.md",
5
5
  "author": "Andrew Ross",
6
6
  "description": "convenient fs helpers",
@@ -115,8 +115,8 @@
115
115
  "typescript": "^5.9.3",
116
116
  "typescript-eslint": "^8.47.0",
117
117
  "@d0paminedriven/prettier-config": "0.1.0",
118
- "@d0paminedriven/eslint-config": "0.1.0",
119
- "@d0paminedriven/tsconfig": "0.1.0"
118
+ "@d0paminedriven/tsconfig": "0.1.0",
119
+ "@d0paminedriven/eslint-config": "0.1.0"
120
120
  },
121
121
  "prettier": "@d0paminedriven/prettier-config",
122
122
  "scripts": {