MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / hasAttribute

Function hasAttribute

packages/nativescript-inspector/src/index.ts:119–131  ·  view source on GitHub ↗
(this: any, name: string)

Source from the content-addressed store, hash-verified

117function installDebugAttributeShim(): void {
118 const shimMethods: Record<string, (this: any, ...args: any[]) => any> = {
119 hasAttribute(this: any, name: string): boolean {
120 try {
121 if (debugAttributeStore(this).has(name)) return true;
122 } catch {
123 // node lacks a writable property bag — fall through to introspection.
124 }
125 return safeCall(
126 () =>
127 Object.prototype.hasOwnProperty.call(this, name) ||
128 this[name] != null,
129 false,
130 );
131 },
132 getAttribute(this: any, name: string): string | null {
133 try {
134 const attributes = debugAttributeStore(this);

Callers

nothing calls this directly

Calls 2

debugAttributeStoreFunction · 0.85
safeCallFunction · 0.85

Tested by

no test coverage detected