@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/index.mjs
CHANGED
|
@@ -878,7 +878,7 @@ function formatDate(format = "YYYY-MM-DD H:mm", date = /* @__PURE__ */ new Date(
|
|
|
878
878
|
const minutes = offset % 60;
|
|
879
879
|
return (offset > 0 ? "-" : "") + `${hours}:${minutes.toString().padStart(2, "0")}`;
|
|
880
880
|
}
|
|
881
|
-
if (typeof date == "number" || typeof date == "string") date = new Date(date);
|
|
881
|
+
if (typeof date == "number" || typeof date == "string" || date == null) date = new Date(date);
|
|
882
882
|
let t;
|
|
883
883
|
if (tz == null) tz = -(date.getTimezoneOffset() / 60);
|
|
884
884
|
t = timezones.find((t2) => isNaN(tz) ? t2[0] == tz : t2[1] == tz);
|
|
@@ -1205,7 +1205,12 @@ function errorFromCode(code, message) {
|
|
|
1205
1205
|
}
|
|
1206
1206
|
class HttpResponse extends Response {
|
|
1207
1207
|
constructor(resp, stream) {
|
|
1208
|
-
|
|
1208
|
+
const body = [204, 205, 304].includes(resp.status) ? null : stream;
|
|
1209
|
+
super(body, {
|
|
1210
|
+
headers: resp.headers,
|
|
1211
|
+
status: resp.status,
|
|
1212
|
+
statusText: resp.statusText
|
|
1213
|
+
});
|
|
1209
1214
|
__publicField(this, "data");
|
|
1210
1215
|
__publicField(this, "ok");
|
|
1211
1216
|
__publicField(this, "redirected");
|