UNPKG

unmock-core

Version:

[![npm](https://img.shields.io/npm/v/unmock-core.svg)][npmjs] [![CircleCI](https://circleci.com/gh/unmock/unmock-js.svg?style=svg)](https://circleci.com/gh/unmock/unmock-js) [![codecov](https://codecov.io/gh/unmock/unmock-js/branch/dev/graph/badge.svg)](h

25 lines 918 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const constants_1 = require("./constants"); var full_1 = require("loas3/dist/src/generated/full"); exports.isOperation = full_1.isOperation; exports.isReference = full_1.isReference; exports.isSchema = full_1.isSchema; const RESTMethodTypes = [ "get", "head", "post", "put", "patch", "delete", "options", "trace", ]; const DEF_REST_METHOD = [constants_1.DEFAULT_STATE_HTTP_METHOD]; exports.isRESTMethod = (maybeMethod) => RESTMethodTypes.toString().includes(maybeMethod.toLowerCase()); exports.isExtendedRESTMethod = (maybeMethod) => maybeMethod === constants_1.DEFAULT_STATE_HTTP_METHOD || exports.isRESTMethod(maybeMethod); exports.isStateInputGenerator = (u) => u !== undefined && u.top !== undefined && u.gen !== undefined && typeof u.gen === "function"; //# sourceMappingURL=interfaces.js.map