Skip to content

Commit

Permalink
Update dependencies, add JSON logger
Browse files Browse the repository at this point in the history
  • Loading branch information
phjardas committed Dec 13, 2023
1 parent 6f2f097 commit 6abcbb7
Show file tree
Hide file tree
Showing 25 changed files with 4,058 additions and 11,351 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-sloths-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"easy-apigateway": minor
---

Update dependencies
5 changes: 5 additions & 0 deletions .changeset/curvy-vans-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"easy-apigateway": minor
---

Add JSON logger
8 changes: 5 additions & 3 deletions create-errors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const fetch = require("node-fetch");
const { promises: fs } = require("fs");
const prettier = require("prettier");

function functionName({ text }) {
const name =
Expand All @@ -14,7 +15,7 @@ function functionName({ text }) {

async function main() {
const response = await fetch(
"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
);
const html = await response.text();
const errors = html
Expand All @@ -37,11 +38,12 @@ async function main() {
error.text
}"): StatusError {\n return new StatusError(${
error.status
}, message);\n}\n`
}, message);\n}\n`,
),
].join("\n");

await fs.writeFile("src/errors.ts", code, "utf-8");
const formatted = await prettier.format(code, { filepath: "src/errors.ts" });
await fs.writeFile("src/errors.ts", formatted, "utf-8");
}

main().catch((error) => {
Expand Down
Loading

0 comments on commit 6abcbb7

Please sign in to comment.