refactor: Improve related types handling and add peer dependencies in package-lock.json

This commit is contained in:
Nawaz Dhandala
2026-02-12 10:33:04 +00:00
parent 8560ecab41
commit f8e26246dd
2 changed files with 17 additions and 6 deletions

View File

@@ -3173,10 +3173,17 @@ export default class ServiceHandler {
detail.relatedTypes || []
).map((rt: RelatedType) => {
const dtDoc: DataTypeDocumentation | undefined = DataTypesByPath[rt.path];
return {
...rt,
description: rt.description || (dtDoc ? dtDoc.description : undefined),
const desc: string | undefined =
rt.description || (dtDoc ? dtDoc.description : undefined);
const result: RelatedType = {
name: rt.name,
path: rt.path,
relationship: rt.relationship,
};
if (desc !== undefined) {
result.description = desc;
}
return result;
});
// Extract _type wrapper from JSON example
@@ -3185,8 +3192,8 @@ export default class ServiceHandler {
const parsed: Record<string, unknown> = JSON.parse(
detail.jsonExample,
) as Record<string, unknown>;
if (parsed._type && typeof parsed._type === "string") {
jsonWrapperType = parsed._type;
if (parsed["_type"] && typeof parsed["_type"] === "string") {
jsonWrapperType = parsed["_type"];
}
} catch {
// ignore parse errors

View File

@@ -279,6 +279,7 @@
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.6.tgz",
"integrity": "sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw==",
"dev": true,
"peer": true,
"dependencies": {
"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.23.5",
@@ -1391,7 +1392,8 @@
"node_modules/@types/node": {
"version": "17.0.45",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz",
"integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw=="
"integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==",
"peer": true
},
"node_modules/@types/prettier": {
"version": "2.7.3",
@@ -1662,6 +1664,7 @@
"url": "https://github.com/sponsors/ai"
}
],
"peer": true,
"dependencies": {
"caniuse-lite": "^1.0.30001565",
"electron-to-chromium": "^1.4.601",
@@ -4009,6 +4012,7 @@
"version": "10.9.2",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
"integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
"peer": true,
"dependencies": {
"@cspotcode/source-map-support": "^0.8.0",
"@tsconfig/node10": "^1.0.7",