@ztimson/utils 0.23.21 → 0.23.23
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/dist/files.d.ts +0 -1
- package/dist/http.d.ts +0 -1
- package/dist/index.cjs +7 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +7 -2
- package/dist/index.mjs.map +1 -1
- package/dist/logger.d.ts +0 -1
- package/dist/misc.d.ts +0 -1
- package/dist/path-events.d.ts +0 -1
- package/package.json +4 -4
package/dist/files.d.ts
CHANGED
package/dist/http.d.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -882,7 +882,7 @@ ${opts.message || this.desc}`;
|
|
|
882
882
|
const minutes = offset % 60;
|
|
883
883
|
return (offset > 0 ? "-" : "") + `${hours}:${minutes.toString().padStart(2, "0")}`;
|
|
884
884
|
}
|
|
885
|
-
if (typeof date == "number" || typeof date == "string") date = new Date(date);
|
|
885
|
+
if (typeof date == "number" || typeof date == "string" || date == null) date = new Date(date);
|
|
886
886
|
let t;
|
|
887
887
|
if (tz == null) tz = -(date.getTimezoneOffset() / 60);
|
|
888
888
|
t = timezones.find((t2) => isNaN(tz) ? t2[0] == tz : t2[1] == tz);
|
|
@@ -1209,7 +1209,12 @@ ${opts.message || this.desc}`;
|
|
|
1209
1209
|
}
|
|
1210
1210
|
class HttpResponse extends Response {
|
|
1211
1211
|
constructor(resp, stream) {
|
|
1212
|
-
|
|
1212
|
+
const body = [204, 205, 304].includes(resp.status) ? null : stream;
|
|
1213
|
+
super(body, {
|
|
1214
|
+
headers: resp.headers,
|
|
1215
|
+
status: resp.status,
|
|
1216
|
+
statusText: resp.statusText
|
|
1217
|
+
});
|
|
1213
1218
|
__publicField(this, "data");
|
|
1214
1219
|
__publicField(this, "ok");
|
|
1215
1220
|
__publicField(this, "redirected");
|