@type {(constructor: string, tag: string, fallback: string, size?: string) => string}
(constructor, tag, fallback, size = '')
| 1024 | |
| 1025 | /** @type {(constructor: string, tag: string, fallback: string, size?: string) => string} */ |
| 1026 | function getPrefix(constructor, tag, fallback, size = '') { |
| 1027 | if (constructor === null) { |
| 1028 | if (tag !== '' && fallback !== tag) { |
| 1029 | return `[${fallback}${size}: null prototype] [${tag}] `; |
| 1030 | } |
| 1031 | return `[${fallback}${size}: null prototype] `; |
| 1032 | } |
| 1033 | |
| 1034 | let result = `${constructor}${size} `; |
| 1035 | if (tag !== '') { |
| 1036 | const position = constructor.indexOf(tag); |
| 1037 | if (position === -1) { |
| 1038 | result += `[${tag}] `; |
| 1039 | } else { |
| 1040 | const endPos = position + tag.length; |
| 1041 | if (endPos !== constructor.length && |
| 1042 | constructor[endPos] === constructor[endPos].toLowerCase()) { |
| 1043 | result += `[${tag}] `; |
| 1044 | } |
| 1045 | } |
| 1046 | } |
| 1047 | return result; |
| 1048 | } |
| 1049 | |
| 1050 | // Look up the keys of the object. |
| 1051 | function getKeys(value, showHidden) { |
no test coverage detected
searching dependent graphs…