main
Last change
on this file since 65b6638 was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
829 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
---|
| 4 | exports.__esModule = true;
|
---|
| 5 | exports.default = opId;
|
---|
| 6 | var _index = _interopRequireDefault(require("./id-from-path-method/index.js"));
|
---|
| 7 | var _replaceSpecialCharsWithUnderscore = _interopRequireDefault(require("./replace-special-chars-with-underscore.js"));
|
---|
| 8 | function opId(operation, pathName, method = '', {
|
---|
| 9 | v2OperationIdCompatibilityMode
|
---|
| 10 | } = {}) {
|
---|
| 11 | if (!operation || typeof operation !== 'object') {
|
---|
| 12 | return null;
|
---|
| 13 | }
|
---|
| 14 | const idWithoutWhitespace = (operation.operationId || '').replace(/\s/g, '');
|
---|
| 15 | if (idWithoutWhitespace.length) {
|
---|
| 16 | return (0, _replaceSpecialCharsWithUnderscore.default)(operation.operationId);
|
---|
| 17 | }
|
---|
| 18 | return (0, _index.default)(pathName, method, {
|
---|
| 19 | v2OperationIdCompatibilityMode
|
---|
| 20 | });
|
---|
| 21 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.