Skip to content

Commit

Permalink
Merge 900eaad into eefee81
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Aug 12, 2023
2 parents eefee81 + 900eaad commit 366736f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"checkJs": true,
"lib": ["ES2021"],
"moduleResolution": "nodenext",
"resolveJsonModule": true
},
"exclude": ["dist", "node_modules"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"devDependencies": {
"@commitlint/cli": "^17.6.6",
"@commitlint/config-conventional": "^17.6.6",
"@types/jest": "^29.5.3",
"eslint": "^8.44.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
Expand Down
1 change: 1 addition & 0 deletions scripts/license-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

const { promisify } = require("util");
const { init } = require("license-checker");
// @ts-ignore
const copyLeftLicenses = require("spdx-copyleft");
const path = require("upath");

Expand Down
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ async function fastifyJsonToXml(server, options) {
.getHeader("content-type")
?.toString()
?.includes("application/json") &&
accepts(req).type(["application/json", "application/xml"]) ===
"application/xml"
accepts(req.raw).type(["application/json", "application/xml"]) ===
"application/xml" &&
typeof payload === "string"
) {
res.type("application/xml; charset=utf-8");
return xmlParse("response", secureParse(payload), {
Expand Down
3 changes: 3 additions & 0 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const Fastify = require("fastify");
const plugin = require(".");

describe("JSON-To-XML plugin", () => {
/**
* @type {Fastify.FastifyInstance}
*/
let server;

const resBody = {
Expand Down

0 comments on commit 366736f

Please sign in to comment.