(options: FormKitOptions)
| 1850 | * @public |
| 1851 | */ |
| 1852 | export function createValue(options: FormKitOptions): unknown { |
| 1853 | if (options.type === 'group') { |
| 1854 | return init( |
| 1855 | options.value && |
| 1856 | typeof options.value === 'object' && |
| 1857 | !Array.isArray(options.value) |
| 1858 | ? options.value |
| 1859 | : {} |
| 1860 | ) |
| 1861 | } else if (options.type === 'list') { |
| 1862 | return init(Array.isArray(options.value) ? options.value : []) |
| 1863 | } |
| 1864 | return options.value |
| 1865 | } |
| 1866 | /** |
| 1867 | * Sets the internal value of the node. |
| 1868 | * |
no test coverage detected