MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / classifyResetArg

Function classifyResetArg

packages/vite/hmr/client/index.ts:186–205  ·  view source on GitHub ↗
(arg: any)

Source from the content-addressed store, hash-verified

184}
185
186function classifyResetArg(arg: any) {
187 try {
188 const ctorName = String(arg?.constructor?.name || '').replace(/^_+/, '');
189 const keys = Object.keys(arg || {});
190 const hasCreate = typeof arg?.create === 'function';
191 const hasModuleName = typeof arg?.moduleName === 'string';
192 const isFrameLike = !!arg && (ctorName === 'Frame' || /^Frame(\$\d+)?$/.test(ctorName) || (typeof arg?.navigate === 'function' && typeof arg?.addChild === 'function'));
193 const isPageLike = !!arg && (ctorName === 'Page' || /^Page(\$\d+)?$/.test(ctorName) || (typeof arg?.content !== 'undefined' && typeof arg?.addChild === 'function'));
194 return {
195 ctorName,
196 keys,
197 hasCreate,
198 hasModuleName,
199 isFrameLike,
200 isPageLike,
201 };
202 } catch {
203 return { ctorName: 'unknown' };
204 }
205}
206
207function installDeepDiagnostics() {
208 if (!VERBOSE) return;

Callers 1

installDeepDiagnosticsFunction · 0.85

Calls 4

replaceMethod · 0.80
keysMethod · 0.65
StringClass · 0.50
testMethod · 0.45

Tested by

no test coverage detected