source: node_modules/swagger-client/es/helpers/op-id.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 614 bytes
Line 
1import idFromPathMethod from './id-from-path-method/index.js';
2import replaceSpecialCharsWithUnderscore from './replace-special-chars-with-underscore.js';
3export default function opId(operation, pathName, method = '', {
4 v2OperationIdCompatibilityMode
5} = {}) {
6 if (!operation || typeof operation !== 'object') {
7 return null;
8 }
9 const idWithoutWhitespace = (operation.operationId || '').replace(/\s/g, '');
10 if (idWithoutWhitespace.length) {
11 return replaceSpecialCharsWithUnderscore(operation.operationId);
12 }
13 return idFromPathMethod(pathName, method, {
14 v2OperationIdCompatibilityMode
15 });
16}
Note: See TracBrowser for help on using the repository browser.