(input)
| 834 | |
| 835 | // A helper function to simplify checking for ERR_INVALID_ARG_TYPE output. |
| 836 | function invalidArgTypeHelper(input) { |
| 837 | if (input == null) { |
| 838 | return ` Received ${input}`; |
| 839 | } |
| 840 | if (typeof input === 'function') { |
| 841 | return ` Received function ${input.name}`; |
| 842 | } |
| 843 | if (typeof input === 'object') { |
| 844 | if (input.constructor?.name) { |
| 845 | return ` Received an instance of ${input.constructor.name}`; |
| 846 | } |
| 847 | return ` Received ${inspect(input, { depth: -1 })}`; |
| 848 | } |
| 849 | |
| 850 | let inspected = inspect(input, { colors: false }); |
| 851 | if (inspected.length > 28) { inspected = `${inspected.slice(inspected, 0, 25)}...`; } |
| 852 | |
| 853 | return ` Received type ${typeof input} (${inspected})`; |
| 854 | } |
| 855 | |
| 856 | function requireNoPackageJSONAbove(dir = __dirname) { |
| 857 | let possiblePackage = path.join(dir, '..', 'package.json'); |
no test coverage detected
searching dependent graphs…