1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | function getIdentifierForArgumentValue(value) {
|
17 | switch (value.kind) {
|
18 | case 'Variable':
|
19 | return {
|
20 | variable: value.variableName
|
21 | };
|
22 |
|
23 | case 'Literal':
|
24 | return {
|
25 | value: value.value
|
26 | };
|
27 |
|
28 | case 'ListValue':
|
29 | return {
|
30 | list: value.items.map(function (item) {
|
31 | return getIdentifierForArgumentValue(item);
|
32 | })
|
33 | };
|
34 |
|
35 | case 'ObjectValue':
|
36 | return {
|
37 | object: value.fields.map(function (field) {
|
38 | return {
|
39 | name: field.name,
|
40 | value: getIdentifierForArgumentValue(field.value)
|
41 | };
|
42 | })
|
43 | };
|
44 |
|
45 | default:
|
46 | !false ? process.env.NODE_ENV !== "production" ? require("fbjs/lib/invariant")(false, 'getIdentifierForArgumentValue(): Unsupported AST kind `%s`.', value.kind) : require("fbjs/lib/invariant")(false) : void 0;
|
47 | }
|
48 | }
|
49 |
|
50 | module.exports = getIdentifierForArgumentValue; |
\ | No newline at end of file |