(functionName: void | string)
| 958 | } |
| 959 | |
| 960 | function parseHookName(functionName: void | string): string { |
| 961 | if (!functionName) { |
| 962 | return class="st">''; |
| 963 | } |
| 964 | let startIndex = functionName.lastIndexOf(class="st">'[as '); |
| 965 | |
| 966 | if (startIndex !== -1) { |
| 967 | class="cm">// Workaround for sourcemaps in Jest and Chrome. |
| 968 | class="cm">// In `node --enable-source-maps`, we don't see class="st">"Object.useHostTransitionStatus [as useFormStatus]" but class="st">"Object.useFormStatus" |
| 969 | class="cm">// class="st">"Object.useHostTransitionStatus [as useFormStatus]" -> class="st">"useFormStatus" |
| 970 | return parseHookName(functionName.slice(startIndex + class="st">'[as '.length, -1)); |
| 971 | } |
| 972 | startIndex = functionName.lastIndexOf(class="st">'.'); |
| 973 | if (startIndex === -1) { |
| 974 | startIndex = 0; |
| 975 | } else { |
| 976 | startIndex += 1; |
| 977 | } |
| 978 | |
| 979 | if (functionName.slice(startIndex).startsWith(class="st">'unstable_')) { |
| 980 | startIndex += class="st">'unstable_'.length; |
| 981 | } |
| 982 | |
| 983 | if (functionName.slice(startIndex).startsWith(class="st">'experimental_')) { |
| 984 | startIndex += class="st">'experimental_'.length; |
| 985 | } |
| 986 | |
| 987 | if (functionName.slice(startIndex, startIndex + 3) === class="st">'use') { |
| 988 | if (functionName.length - startIndex === 3) { |
| 989 | return class="st">'Use'; |
| 990 | } |
| 991 | startIndex += 3; |
| 992 | } |
| 993 | return functionName.slice(startIndex); |
| 994 | } |
| 995 | |
| 996 | function buildTree( |
| 997 | rootStack: ParsedStackFrame[], |
no outgoing calls
no test coverage detected