MCPcopy Index your code
hub / github.com/triggerdotdev/jsonhero-web / getHierarchicalTypes

Function getHierarchicalTypes

app/utilities/dataType.ts:11–54  ·  view source on GitHub ↗
(type: JSONValueType)

Source from the content-addressed store, hash-verified

9}
10
11export function getHierarchicalTypes(type: JSONValueType): HierarchicalTypes {
12 let types: string[] = [];
13 types.push(type.name);
14
15 switch (type.name) {
16 case "string": {
17 if (type.format == null) {
18 break;
19 }
20
21 types.push(type.format.name);
22
23 switch (type.format.name) {
24 case "uri": {
25 if (type.format.contentType == null) {
26 break;
27 }
28
29 types.push(type.format.contentType);
30 break;
31 }
32 case "datetime": {
33 types.push(type.format.variant);
34 break;
35 }
36 case "ip": {
37 types.push(type.format.variant);
38 break;
39 }
40 }
41 break;
42 }
43 case "int": {
44 if (type.format == null) {
45 break;
46 }
47
48 types.push(type.format.name);
49 }
50 }
51 return {
52 types: types,
53 };
54}

Callers 1

InfoHeaderFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected