MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / processNode

Method processNode

packages/hydrooj/src/handler/manage.ts:181–193  ·  view source on GitHub ↗
(node: any, schema: Schema<any, any>, parent?: any, accessKey?: string)

Source from the content-addressed store, hash-verified

179 let value = this.ctx.setting.configSource;
180
181 const processNode = (node: any, schema: Schema<any, any>, parent?: any, accessKey?: string) => {
182 if (!node) return;
183 if (['union', 'intersect'].includes(schema.type)) {
184 for (const item of schema.list) processNode(node, item, parent, accessKey);
185 }
186 if (parent && (schema.meta.secret === true || schema.meta.role === 'secret')) {
187 if (schema.type === 'string') parent[accessKey] = '[hidden]';
188 // TODO support more types
189 }
190 if (schema.type === 'object') {
191 for (const key in schema.dict) processNode(node[key], schema.dict[key], node, key);
192 }
193 };
194
195 try {
196 const temp = yaml.load(this.ctx.setting.configSource);

Callers

nothing calls this directly

Calls 1

processNodeFunction · 0.85

Tested by

no test coverage detected