MCPcopy Create free account
hub / github.com/hey-api/hey-api / ExprMixin

Function ExprMixin

packages/openapi-python/src/py-dsl/mixins/expr.ts:18–45  ·  view source on GitHub ↗
(Base: TBase)

Source from the content-addressed store, hash-verified

16}
17
18export function ExprMixin<T extends py.Expression, TBase extends BaseCtor<T>>(Base: TBase) {
19 abstract class Expr extends Base {
20 override analyze(ctx: AnalysisContext): void {
21 super.analyze(ctx);
22 }
23
24 protected attr(...args: DropFirst<Parameters<typeof f.attr>>): ReturnType<typeof f.attr> {
25 // @ts-expect-error - fix this type
26 return f.attr(this, ...args);
27 }
28
29 protected call(...args: DropFirst<Parameters<typeof f.call>>): ReturnType<typeof f.call> {
30 // @ts-expect-error - fix this type
31 return f.call(this, ...args);
32 }
33
34 protected return(): ReturnType<typeof f.return> {
35 // @ts-expect-error - fix this type
36 return f.return(this);
37 }
38
39 protected slice(...args: DropFirst<Parameters<typeof f.slice>>): ReturnType<typeof f.slice> {
40 return f.slice(this, ...args);
41 }
42 }
43
44 return Expr as unknown as MixinCtor<TBase, ExprMethods>;
45}

Callers 3

call.tsFile · 0.90
attr.tsFile · 0.90
expr.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected