(type: JSONValueType)
| 33 | } |
| 34 | |
| 35 | export function iconForType(type: JSONValueType): IconComponent { |
| 36 | switch (type.name) { |
| 37 | case "object": { |
| 38 | return CubeIcon; |
| 39 | } |
| 40 | case "array": { |
| 41 | return CollectionIcon; |
| 42 | } |
| 43 | case "null": { |
| 44 | return EyeOffIcon; |
| 45 | } |
| 46 | case "bool": { |
| 47 | return CheckCircleIcon; |
| 48 | } |
| 49 | case "int": { |
| 50 | if (type.format == null) { |
| 51 | return HashtagIcon; |
| 52 | } |
| 53 | switch (type.format.name) { |
| 54 | case "timestamp": { |
| 55 | return CalendarIcon; |
| 56 | } |
| 57 | default: { |
| 58 | return HashtagIcon; |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | case "float": { |
| 63 | return HashtagIcon; |
| 64 | } |
| 65 | case "string": { |
| 66 | if (type.format == null) { |
| 67 | return StringIcon; |
| 68 | } |
| 69 | |
| 70 | switch (type.format.name) { |
| 71 | case "timestamp": { |
| 72 | return CalendarIcon; |
| 73 | } |
| 74 | case "datetime": { |
| 75 | switch (type.format.parts) { |
| 76 | case "time": |
| 77 | return ClockIcon; |
| 78 | } |
| 79 | return ClockIcon; |
| 80 | } |
| 81 | case "email": { |
| 82 | return AtSymbolIcon; |
| 83 | } |
| 84 | case "hostname": |
| 85 | case "tld": |
| 86 | case "ip": |
| 87 | return GlobeAltIcon; |
| 88 | case "uri": { |
| 89 | switch (type.format.contentType) { |
| 90 | case "image/jpeg": |
| 91 | case "image/png": |
| 92 | case "image/gif": |
no outgoing calls
no test coverage detected