Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected getReplyTopicPartition(topic: string): string {
const topicAssignments = this.consumerAssignments[topic];
if (isUndefined(topicAssignments)) {
throw new InvalidKafkaClientTopicException(topic);
}
// if the current member isn't listening to
// any partitions on the topic then throw an error.
if (isUndefined(topicAssignments[0])) {
throw new InvalidKafkaClientTopicPartitionException(topic);
}
return topicAssignments[0].toString();
}
validateRoutePath(path) {
if (shared_utils_1.isUndefined(path)) {
throw new unknown_request_mapping_exception_1.UnknownRequestMappingException();
}
return shared_utils_1.validatePath(path);
}
scanForPaths(instance, prototype) {
isGatewayMiddleware(middleware) {
return !shared_utils_1.isUndefined(middleware.resolve);
}
}
mapObjectToPath(routeOrPath) {
if (shared_utils_1.isString(routeOrPath)) {
return this.validateRoutePath(routeOrPath);
}
const { path } = routeOrPath;
if (shared_utils_1.isUndefined(path)) {
throw new unknown_request_mapping_exception_1.UnknownRequestMappingException();
}
return this.validateRoutePath(path);
}
validateGlobalPath(path) {
public isCustomValue(provider: any): provider is ValueProvider {
return !isUndefined((provider as ValueProvider).useValue);
}
public async resolveSingleParam(
wrapper: InstanceWrapper,
param: Type | string | symbol | any,
dependencyContext: InjectorDependencyContext,
module: Module,
contextId = STATIC_CONTEXT,
inquirer?: InstanceWrapper,
keyOrIndex?: string | number,
) {
if (isUndefined(param)) {
throw new UndefinedDependencyException(
wrapper.name,
dependencyContext,
module,
);
}
const token = this.resolveParamToken(wrapper, param);
return this.resolveComponentInstance(
module,
isFunction(token) ? (token as Type).name : token,
dependencyContext,
wrapper,
contextId,
inquirer,
keyOrIndex,
);
public isCustomValue(provider: any): provider is ValueProvider {
return !isUndefined((provider as ValueProvider).useValue);
}
isCustomValue(component) {
return !shared_utils_1.isUndefined(component.useValue);
}
isCustomFactory(component) {
public validateRoutePath(path: string): string {
if (isUndefined(path)) {
throw new UnknownRequestMappingException();
}
return validatePath(path);
}
public *scanForClientHooks(
instance: Controller,
): IterableIterator {
for (const propertyKey in instance) {
if (isFunction(propertyKey)) {
continue;
}
const property = String(propertyKey);
const isClient = Reflect.getMetadata(CLIENT_METADATA, instance, property);
if (isUndefined(isClient)) {
continue;
}
const metadata = Reflect.getMetadata(
CLIENT_CONFIGURATION_METADATA,
instance,
property,
);
yield { property, metadata };
}
}
}