Skip to content

Commit db2ce37

Browse files
flakey5avivkeller
andauthored
Apply suggestions from code review
Co-authored-by: Aviv Keller <me@aviv.sh>
1 parent b5d67be commit db2ce37

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/generators/json-all/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default {
3535
* @returns {Promise<object>}
3636
*/
3737
async generate(input, { version, output }) {
38-
const versionString = `v${version.toString()}`;
38+
const versionString = `v${version.raw}`;
3939

4040
const generatedValue = {
4141
$schema: `${BASE_URL}docs/${versionString}/api/${SCHEMA_FILENAME}`,

src/generators/json/utils/findParentSection.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ import { enforceArray } from '../../../utils/array.mjs';
88
* @param {import('../generated/generated.d.ts').SectionBase['type'] | Array<import('../generated/generated.d.ts').SectionBase['type']>} type
99
* @returns {import('../types.d.ts').Section | undefined}
1010
*/
11-
export function findParentSection(section, type) {
11+
export function findParentSection({ parent }, type) {
1212
type = enforceArray(type);
1313

14-
let parent = section.parent;
15-
1614
while (parent) {
1715
if (type.includes(parent.type)) {
1816
return parent;

src/generators/json/utils/sections/base.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function addDescriptionAndExamples(section, nodes) {
5252

5353
if (section.description) {
5454
section.description = section.description.trim();
55-
}
55+
section.description &&= section.description.trim();
5656
}
5757

5858
/**

0 commit comments

Comments
 (0)