Function
mockValueForType
(type: string | undefined, name: string)
Source from the content-addressed store, hash-verified
| 125 | } |
| 126 | |
| 127 | function mockValueForType(type: string | undefined, name: string): unknown { |
| 128 | switch (type) { |
| 129 | case 'number': |
| 130 | return 42 |
| 131 | case 'boolean': |
| 132 | return true |
| 133 | case 'array': |
| 134 | return [] |
| 135 | case 'object': |
| 136 | return {} |
| 137 | case 'files': |
| 138 | case 'file[]': |
| 139 | return [] |
| 140 | default: |
| 141 | return `mock_${name}` |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | function buildFieldsSample(inputFormat: InputFormatField[]): Record<string, unknown> { |
| 146 | const sample: Record<string, unknown> = {} |
Tested by
no test coverage detected