Files
NapCatQQ/.pnpm-store/v3/files/52/abfa2b7253023773776013b9aaf3a2497fc441102abe8c789df6b8cea21a5bde7398665b5a9b49e819bf57d307a55ca0806c605d017ee0a7381f431dfc2a70
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

20 lines
771 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Recursive = Recursive;
const type_1 = require("../clone/type");
const type_2 = require("../create/type");
const value_1 = require("../guard/value");
const index_1 = require("../symbols/index");
// Auto Tracked For Recursive Types without ID's
let Ordinal = 0;
/** `[Json]` Creates a Recursive type */
function Recursive(callback, options = {}) {
if ((0, value_1.IsUndefined)(options.$id))
options.$id = `T${Ordinal++}`;
const thisType = (0, type_1.CloneType)(callback({ [index_1.Kind]: 'This', $ref: `${options.$id}` }));
thisType.$id = options.$id;
// prettier-ignore
return (0, type_2.CreateType)({ [index_1.Hint]: 'Recursive', ...thisType }, options);
}