(obj, name, mustExist)
| 732 | } |
| 733 | |
| 734 | function getFunction(obj, name, mustExist) { |
| 735 | let func = obj === null || obj === undefined ? null : obj[name]; |
| 736 | if (typeof func === 'function') { |
| 737 | return func; |
| 738 | } |
| 739 | if (!mustExist && (func === null || func === undefined)) { |
| 740 | return null; |
| 741 | } |
| 742 | throw new Error(`${name} is not a function`); |
| 743 | } |
| 744 | |
| 745 | function getKeyed(obj, key) { |
| 746 | if (Array.isArray(obj)) { |