UNPKG

@opendoc/openapi-shaking

Version:

Remove the useless components and paths of openapi document.

21 lines (20 loc) 786 B
(function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define(["require", "exports", "openapi-types"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isValidMethod = void 0; const openapi_types_1 = require("openapi-types"); function isValidMethod(method) { if (typeof method !== 'string') return false; return Object.values(openapi_types_1.OpenAPIV3.HttpMethods).some((m) => m === method); } exports.isValidMethod = isValidMethod; });