MCPcopy Create free account
hub / github.com/react-component/select / dig

Function dig

src/hooks/useOptions.ts:37–51  ·  view source on GitHub ↗
(optionList: OptionType[], isChildren = false)

Source from the content-addressed store, hash-verified

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

Callers 1

useOptionsFunction · 0.70

Calls 1

setLabelOptionsFunction · 0.85

Tested by

no test coverage detected