(optionList: OptionType[], isChildren = false)
| 35 | }; |
| 36 | |
| 37 | const dig = (optionList: OptionType[], isChildren = false) => { |
| 38 | // for loop to speed up collection speed |
| 39 | for (let i = 0; i < optionList.length; i += 1) { |
| 40 | const option = optionList[i]; |
| 41 | if (!option[fieldNames.options] || isChildren) { |
| 42 | valueOptions.set(option[fieldNames.value], option); |
| 43 | setLabelOptions(labelOptions, option, fieldNames.label); |
| 44 | // https://github.com/ant-design/ant-design/issues/35304 |
| 45 | setLabelOptions(labelOptions, option, optionFilterProp); |
| 46 | setLabelOptions(labelOptions, option, optionLabelProp); |
| 47 | } else { |
| 48 | dig(option[fieldNames.options], true); |
| 49 | } |
| 50 | } |
| 51 | }; |
| 52 | |
| 53 | dig(mergedOptions); |
| 54 |
no test coverage detected