UNPKG

jswagger-common

Version:

This is jswagger's common package.

21 lines (20 loc) 592 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function findApisByTag(schema, tag) { const output = []; Object.entries(schema.paths) .forEach(([path, apis]) => { Object.entries(apis) .forEach((entry) => { const method = entry[0]; const api = entry[1]; if (api.tags.find(v => v == tag)) { output.push({ path, method, api }); } }); }); return output; } exports.findApisByTag = findApisByTag;