How to use the @nestjsx/util.isNull function in @nestjsx/util

To help you get started, we’ve selected a few @nestjsx/util 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 nestjsx / crud / packages / crud-typeorm / src / typeorm-crud.service.ts View on Github external
protected builderSetWhere(
    builder: SelectQueryBuilder,
    condition: SConditionKey,
    field: string,
    value: any,
    operator: ComparisonOperator = '$eq',
  ) {
    const time = process.hrtime();
    const index = `${field}${time[0]}${time[1]}`;
    const args = [
      { field, operator: isNull(value) ? '$isnull' : operator, value },
      index,
      builder,
    ];
    const fn = condition === '$and' ? this.setAndWhere : this.setOrWhere;
    fn.apply(this, args);
  }