How to use the @nestjs/common/utils/shared.utils.isUndefined function in @nestjs/common

To help you get started, weโ€™ve selected a few @nestjs/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nestjs / nest / packages / microservices / client / client-kafka.ts View on Github external
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();
  }
github nestjs / nest / lib / core / router / router-explorer.js View on Github external
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) {
github nestjs / nest / lib / websockets / middlewares-injector.js View on Github external
isGatewayMiddleware(middleware) {
        return !shared_utils_1.isUndefined(middleware.resolve);
    }
}
github nestjs / nest / lib / core / middlewares / routes-mapper.js View on Github external
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) {
github nestjs / nest / packages / core / injector / module.ts View on Github external
public isCustomValue(provider: any): provider is ValueProvider {
    return !isUndefined((provider as ValueProvider).useValue);
  }
github nestjs / nest / packages / core / injector / injector.ts View on Github external
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,
    );
github nestjs / nest / packages / core / injector / module.ts View on Github external
public isCustomValue(provider: any): provider is ValueProvider {
    return !isUndefined((provider as ValueProvider).useValue);
  }
github nestjs / nest / bundle / core / injector / module.js View on Github external
isCustomValue(component) {
        return !shared_utils_1.isUndefined(component.useValue);
    }
    isCustomFactory(component) {
github nestjs / nest / packages / core / router / router-explorer.ts View on Github external
public validateRoutePath(path: string): string {
    if (isUndefined(path)) {
      throw new UnknownRequestMappingException();
    }
    return validatePath(path);
  }
github nestjs / nest / packages / microservices / listener-metadata-explorer.ts View on Github external
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 };
    }
  }
}