summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-12-14 22:10:34 -0800
committerElizabeth Hunt <me@liz.coffee>2025-12-14 22:10:54 -0800
commit594ce452693a71b501d3aff3f35ef3732c06c341 (patch)
treefba9cb7137940b286318dc35a747b171e0013963
parenteeca787c81ac92e46a9375a0b1ce8baa29852b1a (diff)
downloadpengueno-594ce452693a71b501d3aff3f35ef3732c06c341.tar.gz
pengueno-594ce452693a71b501d3aff3f35ef3732c06c341.zip
Fix 400's not having error in response
-rw-r--r--lib/server/response/pengueno.ts2
-rw-r--r--package.json2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/server/response/pengueno.ts b/lib/server/response/pengueno.ts
index e15d3f1..e5cc690 100644
--- a/lib/server/response/pengueno.ts
+++ b/lib/server/response/pengueno.ts
@@ -76,6 +76,6 @@ export class JsonResponse extends PenguenoResponse {
);
return;
}
- super(req, JSON.stringify(Math.floor(opts.status / 100) > 4 ? { error: e } : { ok: e }), opts);
+ super(req, JSON.stringify(opts.status >= 400 ? { error: e } : { ok: e }), opts);
}
}
diff --git a/package.json b/package.json
index 3355d62..b5f4484 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@emprespresso/pengueno",
- "version": "0.0.17",
+ "version": "0.0.18",
"description": "emprespresso pengueno utils",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",