@hono/node-server 1.19.1 → 1.19.3

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/index.js CHANGED
@@ -430,8 +430,9 @@ var responseViaCache = async (res, outgoing) => {
430
430
  ;
431
431
  outgoing[outgoingEnded]?.();
432
432
  };
433
+ var isPromise = (res) => typeof res.then === "function";
433
434
  var responseViaResponseObject = async (res, outgoing, options = {}) => {
434
- if (res instanceof Promise) {
435
+ if (isPromise(res)) {
435
436
  if (options.errorHandler) {
436
437
  try {
437
438
  res = await res;
package/dist/index.mjs CHANGED
@@ -391,8 +391,9 @@ var responseViaCache = async (res, outgoing) => {
391
391
  ;
392
392
  outgoing[outgoingEnded]?.();
393
393
  };
394
+ var isPromise = (res) => typeof res.then === "function";
394
395
  var responseViaResponseObject = async (res, outgoing, options = {}) => {
395
- if (res instanceof Promise) {
396
+ if (isPromise(res)) {
396
397
  if (options.errorHandler) {
397
398
  try {
398
399
  res = await res;
package/dist/listener.js CHANGED
@@ -422,8 +422,9 @@ var responseViaCache = async (res, outgoing) => {
422
422
  ;
423
423
  outgoing[outgoingEnded]?.();
424
424
  };
425
+ var isPromise = (res) => typeof res.then === "function";
425
426
  var responseViaResponseObject = async (res, outgoing, options = {}) => {
426
- if (res instanceof Promise) {
427
+ if (isPromise(res)) {
427
428
  if (options.errorHandler) {
428
429
  try {
429
430
  res = await res;
package/dist/listener.mjs CHANGED
@@ -388,8 +388,9 @@ var responseViaCache = async (res, outgoing) => {
388
388
  ;
389
389
  outgoing[outgoingEnded]?.();
390
390
  };
391
+ var isPromise = (res) => typeof res.then === "function";
391
392
  var responseViaResponseObject = async (res, outgoing, options = {}) => {
392
- if (res instanceof Promise) {
393
+ if (isPromise(res)) {
393
394
  if (options.errorHandler) {
394
395
  try {
395
396
  res = await res;
@@ -130,8 +130,8 @@ var serveStatic = (options = { root: "" }) => {
130
130
  c.header("Accept-Ranges", "bytes");
131
131
  c.header("Date", stats.birthtime.toUTCString());
132
132
  const parts = range.replace(/bytes=/, "").split("-", 2);
133
- const start = parts[0] ? parseInt(parts[0], 10) : 0;
134
- let end = parts[1] ? parseInt(parts[1], 10) : stats.size - 1;
133
+ const start = parseInt(parts[0], 10) || 0;
134
+ let end = parseInt(parts[1], 10) || size - 1;
135
135
  if (size < end - start + 1) {
136
136
  end = size - 1;
137
137
  }
@@ -106,8 +106,8 @@ var serveStatic = (options = { root: "" }) => {
106
106
  c.header("Accept-Ranges", "bytes");
107
107
  c.header("Date", stats.birthtime.toUTCString());
108
108
  const parts = range.replace(/bytes=/, "").split("-", 2);
109
- const start = parts[0] ? parseInt(parts[0], 10) : 0;
110
- let end = parts[1] ? parseInt(parts[1], 10) : stats.size - 1;
109
+ const start = parseInt(parts[0], 10) || 0;
110
+ let end = parseInt(parts[1], 10) || size - 1;
111
111
  if (size < end - start + 1) {
112
112
  end = size - 1;
113
113
  }
package/dist/server.js CHANGED
@@ -426,8 +426,9 @@ var responseViaCache = async (res, outgoing) => {
426
426
  ;
427
427
  outgoing[outgoingEnded]?.();
428
428
  };
429
+ var isPromise = (res) => typeof res.then === "function";
429
430
  var responseViaResponseObject = async (res, outgoing, options = {}) => {
430
- if (res instanceof Promise) {
431
+ if (isPromise(res)) {
431
432
  if (options.errorHandler) {
432
433
  try {
433
434
  res = await res;
package/dist/server.mjs CHANGED
@@ -391,8 +391,9 @@ var responseViaCache = async (res, outgoing) => {
391
391
  ;
392
392
  outgoing[outgoingEnded]?.();
393
393
  };
394
+ var isPromise = (res) => typeof res.then === "function";
394
395
  var responseViaResponseObject = async (res, outgoing, options = {}) => {
395
- if (res instanceof Promise) {
396
+ if (isPromise(res)) {
396
397
  if (options.errorHandler) {
397
398
  try {
398
399
  res = await res;
package/dist/vercel.js CHANGED
@@ -424,8 +424,9 @@ var responseViaCache = async (res, outgoing) => {
424
424
  ;
425
425
  outgoing[outgoingEnded]?.();
426
426
  };
427
+ var isPromise = (res) => typeof res.then === "function";
427
428
  var responseViaResponseObject = async (res, outgoing, options = {}) => {
428
- if (res instanceof Promise) {
429
+ if (isPromise(res)) {
429
430
  if (options.errorHandler) {
430
431
  try {
431
432
  res = await res;
package/dist/vercel.mjs CHANGED
@@ -388,8 +388,9 @@ var responseViaCache = async (res, outgoing) => {
388
388
  ;
389
389
  outgoing[outgoingEnded]?.();
390
390
  };
391
+ var isPromise = (res) => typeof res.then === "function";
391
392
  var responseViaResponseObject = async (res, outgoing, options = {}) => {
392
- if (res instanceof Promise) {
393
+ if (isPromise(res)) {
393
394
  if (options.errorHandler) {
394
395
  try {
395
396
  res = await res;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hono/node-server",
3
- "version": "1.19.1",
3
+ "version": "1.19.3",
4
4
  "description": "Node.js Adapter for Hono",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",