MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / classOf

Function classOf

Extension/src/Utility/System/info.ts:55–62  ·  view source on GitHub ↗
(instance: AribtraryObject | Constructor)

Source from the content-addressed store, hash-verified

53}
54
55export function classOf(instance: AribtraryObject | Constructor): Constructor | undefined {
56 return instance ? typeof instance === 'function' ? // is it a JavaScript function of some kind?
57 is.asyncConstructor(instance) ? classOf(instance.class) :
58 is.Constructor(instance) ? instance as Constructor // is it really a constructor?
59 : undefined // no, it's a function, but not a constructor
60 : instance.constructor as Constructor : // it's an object, so get the constructor from the object
61 undefined;
62}
63
64/** returns true if the instance is an anonymous object (as opposed to constructed via a class) */
65export function isAnonymousObject(instance: any): boolean {

Callers 2

typeOfFunction · 0.85
hierarchyFunction · 0.85

Calls 2

asyncConstructorMethod · 0.80
ConstructorMethod · 0.80

Tested by

no test coverage detected