(inputs_list: any)
| 825 | } |
| 826 | |
| 827 | function inputsToDict(inputs_list: any) { |
| 828 | // Ported directly from _utils.py, inputs_to_dict |
| 829 | // takes an array of inputs (some inputs may be an array) |
| 830 | // returns an Object (map): |
| 831 | // keys of the form `id.property` or `{"id": 0}.property` |
| 832 | // values contain the property value |
| 833 | if (!inputs_list) { |
| 834 | return {}; |
| 835 | } |
| 836 | const inputs: any = {}; |
| 837 | for (let i = 0; i < inputs_list.length; i++) { |
| 838 | if (Array.isArray(inputs_list[i])) { |
| 839 | const inputsi = inputs_list[i]; |
| 840 | for (let ii = 0; ii < inputsi.length; ii++) { |
| 841 | const id_str = `${stringifyId(inputsi[ii].id)}.${ |
| 842 | inputsi[ii].property |
| 843 | }`; |
| 844 | inputs[id_str] = inputsi[ii].value ?? null; |
| 845 | } |
| 846 | } else { |
| 847 | const id_str = `${stringifyId(inputs_list[i].id)}.${ |
| 848 | inputs_list[i].property |
| 849 | }`; |
| 850 | inputs[id_str] = inputs_list[i].value ?? null; |
| 851 | } |
| 852 | } |
| 853 | return inputs; |
| 854 | } |
| 855 | |
| 856 | function getTriggeredId(triggered: string[]): string | object | undefined { |
| 857 | // for regular callbacks, takes the first triggered prop_id, e.g. "btn.n_clicks" and returns "btn" |
no test coverage detected
searching dependent graphs…