Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function componentHelper(
resolver: LazyRuntimeResolver,
registry: JitRegistry,
name: string
): Option {
let handle = registry.lookupComponentHandle(name);
if (handle === null) return null;
let spec = resolver.resolve(handle);
return curry(spec);
}
componentHelper(name: string, meta: TemplateMeta): Option {
let specifier = this.resolver.lookupComponent(name, meta);
if (!specifier) return null;
let spec = this.resolver.resolve(specifier);
return curry(spec);
}
componentHelper(name: string): Option {
let handle = this.resolver.lookupComponentHandle(name);
if (handle === null) return null;
let spec = this.resolver.resolve(handle);
return curry(spec);
}
export function componentHelper(
resolver: TestJitRuntimeResolver,
registry: TestJitRegistry,
name: string
): Option {
let handle = registry.lookupComponentHandle(name);
if (handle === null) return null;
let spec = resolver.resolve(handle);
return curry(spec);
}
componentHelper(name: string): Option {
let handle = this.resolver.lookupComponentHandle(name);
if (handle === null) return null;
let spec = this.resolver.resolve(handle);
return curry(spec);
}
value(): CurriedComponentDefinition | null {
let state = stateFor(this.outletRef);
if (validate(state, this.lastState)) {
return this.definition;
}
this.lastState = state;
let definition = null;
if (state !== null) {
definition = curry(new OutletComponentDefinition(state), this.args);
}
return (this.definition = definition);
}
value(): CurriedComponentDefinition | null {
let state = stateFor(this.outletRef);
if (validate(state, this.lastState)) {
return this.definition;
}
this.lastState = state;
let definition = null;
if (state !== null) {
definition = curry(new OutletComponentDefinition(state));
}
return this.definition = definition;
}
if (typeof name === 'string') {
if (this._lastName === name) {
return this._lastDef;
}
assert(
`You used \`{{mount '${name}'}}\`, but the engine '${name}' can not be found.`,
env.owner.hasRegistration(`engine:${name}`)
);
if (!env.owner.hasRegistration(`engine:${name}`)) {
return null;
}
this._lastName = name;
this._lastDef = curry(new MountDefinition(name), args);
return this._lastDef;
} else {
assert(
`Invalid engine name '${name}' specified, engine name must be either a string, null or undefined.`,
name === null || name === undefined
);
this._lastDef = null;
this._lastName = null;
return null;
}
}