MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / isDisposable

Function isDisposable

packages/agent-core/src/di/lifecycle.ts:118–125  ·  view source on GitHub ↗
(thing: E)

Source from the content-addressed store, hash-verified

116}
117
118export function isDisposable<E>(thing: E): thing is E & IDisposable {
119 return (
120 typeof thing === 'object' &&
121 thing !== null &&
122 typeof (thing as unknown as IDisposable).dispose === 'function' &&
123 (thing as unknown as IDisposable).dispose.length === 0
124 );
125}
126
127export function dispose<T extends IDisposable>(disposable: T): T;
128export function dispose<T extends IDisposable>(

Callers 3

disposeMethod · 0.90
createServicesFunction · 0.90
disposeIfDisposableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected