1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.isSchemaAst = exports.isSchemaJson = exports.isWrappedSchemaJson = exports.isSchemaText = exports.pick = void 0;
|
4 |
|
5 |
|
6 |
|
7 | function pick(obj, keys) {
|
8 | for (const key of keys) {
|
9 | if (obj[key]) {
|
10 | return obj[key];
|
11 | }
|
12 | }
|
13 | return obj;
|
14 | }
|
15 | exports.pick = pick;
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | function isSchemaText(obj) {
|
21 | return typeof obj === 'string';
|
22 | }
|
23 | exports.isSchemaText = isSchemaText;
|
24 |
|
25 |
|
26 |
|
27 | function isWrappedSchemaJson(obj) {
|
28 | const json = obj;
|
29 | return json.data !== undefined && json.data.__schema !== undefined;
|
30 | }
|
31 | exports.isWrappedSchemaJson = isWrappedSchemaJson;
|
32 |
|
33 |
|
34 |
|
35 | function isSchemaJson(obj) {
|
36 | const json = obj;
|
37 | return json !== undefined && json.__schema !== undefined;
|
38 | }
|
39 | exports.isSchemaJson = isSchemaJson;
|
40 |
|
41 |
|
42 |
|
43 | function isSchemaAst(obj) {
|
44 | return obj.kind !== undefined;
|
45 | }
|
46 | exports.isSchemaAst = isSchemaAst;
|