MCPcopy
hub / github.com/loopbackio/loopback-next / buildConstructorArgs

Function buildConstructorArgs

packages/core/src/application.ts:44–59  ·  view source on GitHub ↗

* A helper function to build constructor args for `Context` * @param configOrParent - Application config or parent context * @param parent - Parent context if the first arg is application config

(
  configOrParent?: ApplicationConfig | Context,
  parent?: Context,
)

Source from the content-addressed store, hash-verified

42 * @param parent - Parent context if the first arg is application config
43 */
44function buildConstructorArgs(
45 configOrParent?: ApplicationConfig | Context,
46 parent?: Context,
47) {
48 let name: string | undefined;
49 let parentCtx: Context | undefined;
50
51 if (configOrParent instanceof Context) {
52 parentCtx = configOrParent;
53 name = undefined;
54 } else {
55 parentCtx = parent;
56 name = configOrParent?.name;
57 }
58 return [parentCtx, name];
59}
60
61/**
62 * Application is the container for various types of artifacts, such as

Callers 1

constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected