Skip to content

Commit 2155927

Browse files
authored
chore: code cleanup (#511)
1 parent 8ba9461 commit 2155927

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

packages/dts-generator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![npm (scoped)](https://img.shields.io/npm/v/@ui5/dts-generator.svg)](https://www.npmjs.com/package/@ui5/dts-generator)
22

3-
# @ui5/dts-Generator
3+
# @ui5/dts-generator
44

55
This npm package is used for generating (and checking) TypeScript type definitions (`*.d.ts` files) for SAPUI5/OpenUI5 libraries implemented in JavaScript. Input for this generation are the `api.json` files which describe the API of a library.
66

packages/dts-generator/src/phases/dts-code-gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ function genModule(ast: Module) {
255255
text += `declare module "${ast.name}" {` + NL;
256256
text += APPEND_ITEMS(ast.imports, genImport);
257257
text += APPEND_ITEMS(ast.exports, genExport);
258-
((text += APPEND_ITEMS(ast.namespaces, (namespace: Namespace) =>
258+
text += APPEND_ITEMS(ast.namespaces, (namespace: Namespace) =>
259259
genNamespace(namespace, { export: namespace.export }),
260-
)),
261-
(text += "}"));
260+
);
261+
text += "}";
262262
return text;
263263
}
264264

packages/ts-interface-generator/src/astGenerationHelper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@ function generateSettingsInterface(
202202
propertySignature,
203203
buildJSDocStringFromLines(createJSDocCenterPart(association)),
204204
);
205-
(factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),
206-
interfaceProperties.push(propertySignature));
205+
interfaceProperties.push(propertySignature);
207206
}
208207
}
209208

packages/ts-interface-generator/src/jsdocGenerator.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,17 @@ export function createJSDocCenterPart(info: APIMember, lines: string[] = []) {
4646
lines.push("");
4747
}
4848

49-
(info.since ? lines.push("@since " + info.since) : "",
50-
info.deprecation !== undefined
51-
? lines.push("@deprecated " + info.deprecation)
52-
: "", // "undefined" check to even output the tag when there is empty text
53-
info.experimental !== undefined
54-
? lines.push("@experimental " + info.experimental)
55-
: ""); // "undefined" check to even output the tag when there is empty text
49+
if (info.since) {
50+
lines.push("@since " + info.since);
51+
}
52+
if (info.deprecation !== undefined) {
53+
// "undefined" check to even output the tag when there is empty text}
54+
lines.push("@deprecated " + info.deprecation);
55+
}
56+
if (info.experimental !== undefined) {
57+
// "undefined" check to even output the tag when there is empty text}
58+
lines.push("@experimental " + info.experimental);
59+
}
5660

5761
return lines;
5862
}

0 commit comments

Comments
 (0)