forked from Rosetta/landing
Add encryption reference and refine documentation
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { access, mkdir, readFile, readdir, writeFile } from 'node:fs/promises';
|
||||
import { basename, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { isMap, isSeq, parseDocument } from 'yaml';
|
||||
import { isMap, isSeq, parseDocument, stringify } from 'yaml';
|
||||
|
||||
const projectRoot = resolve(fileURLToPath(new URL('..', import.meta.url)));
|
||||
const sourceDirectory = resolve(
|
||||
@@ -74,6 +74,10 @@ function mapNamedCollection(node, kind) {
|
||||
pair.value?.commentBefore,
|
||||
pair.value?.comment,
|
||||
);
|
||||
const yaml = stringify(
|
||||
{ [name]: pair.value.toJSON() },
|
||||
{ indent: 2, lineWidth: 0 },
|
||||
).trimEnd();
|
||||
|
||||
if (kind === 'enum') {
|
||||
const values = pair.value.get('values', true);
|
||||
@@ -81,6 +85,7 @@ function mapNamedCollection(node, kind) {
|
||||
name,
|
||||
type: String(pair.value.get('type')),
|
||||
description,
|
||||
yaml,
|
||||
values: isSeq(values)
|
||||
? values.items.map((value) => {
|
||||
const json = value.toJSON();
|
||||
@@ -105,6 +110,7 @@ function mapNamedCollection(node, kind) {
|
||||
name,
|
||||
id: kind === 'packet' ? Number(pair.value.get('id')) : undefined,
|
||||
description,
|
||||
yaml,
|
||||
fields,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user