1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | function getReaderSourceDefinitionName(node) {
|
19 | var _node$params$metadata, _node$metadata;
|
20 |
|
21 | var _ref = node.kind === 'Request' ? [node.params.name, (_node$params$metadata = node.params.metadata) === null || _node$params$metadata === void 0 ? void 0 : _node$params$metadata.derivedFrom] : node.kind === 'SplitOperation' ? [node.name, (_node$metadata = node.metadata) === null || _node$metadata === void 0 ? void 0 : _node$metadata.derivedFrom] : [node.name, null],
|
22 | name = _ref[0],
|
23 | derivedFrom = _ref[1];
|
24 |
|
25 | return typeof derivedFrom === 'string' ? derivedFrom : name;
|
26 | }
|
27 |
|
28 |
|
29 | function getSourceDefinitionName(node) {
|
30 | var _node$metadata2;
|
31 |
|
32 | var derivedFrom = node.kind === 'Request' || node.kind === 'Root' || node.kind === 'SplitOperation' ? (_node$metadata2 = node.metadata) === null || _node$metadata2 === void 0 ? void 0 : _node$metadata2.derivedFrom : null;
|
33 | return typeof derivedFrom === 'string' ? derivedFrom : node.name;
|
34 | }
|
35 |
|
36 | module.exports = {
|
37 | getReaderSourceDefinitionName: getReaderSourceDefinitionName,
|
38 | getSourceDefinitionName: getSourceDefinitionName
|
39 | }; |
\ | No newline at end of file |