How to use the fastify/lib/symbols.kChildren function in fastify

To help you get started, we’ve selected a few fastify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SkeLLLa / fastify-oas / lib / openapi / index.js View on Github external
function getSchemasRecursive(instance) {
  const schemas = {};
  Object.assign(schemas, instance.getSchemas());
  const children = instance[symbols.kChildren];
  if (children.length) {
    children.forEach((child) => {
      Object.assign(schemas, getSchemasRecursive(child));
    });
  }
  return schemas;
}

fastify

Fast and low overhead web framework, for Node.js

MIT
Latest version published 8 days ago

Package Health Score

98 / 100
Full package analysis