How to use the @nestjsx/util.isString 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-request / src / request-query.builder.ts View on Github external
Object.keys(RequestQueryBuilder._options.paramNamesMap).forEach((key) => {
      const name = RequestQueryBuilder._options.paramNamesMap[key];
      this.paramNames[key] = isString(name) ? (name as string) : (name[0] as string);
    });
  }
github nestjsx / crud / packages / crud-request / src / request-query.builder.ts View on Github external
sortBy(s: QuerySort | QuerySortArr | Array): this {
    if (!isNil(s)) {
      const param = this.checkQueryObjectParam('sort', []);
      this.queryObject[param] = [
        ...this.queryObject[param],
        ...(Array.isArray(s) && !isString(s[0])
          ? (s as Array).map((o) => this.addSortBy(o))
          : [this.addSortBy(s as QuerySort | QuerySortArr)]),
      ];
    }
    return this;
  }
github nestjsx / crud / packages / crud-request / src / request-query.builder.ts View on Github external
private setCondition(
    f: QueryFilter | QueryFilterArr | Array,
    cond: 'filter' | 'or',
  ): void {
    if (!isNil(f)) {
      const param = this.checkQueryObjectParam(cond, []);
      this.queryObject[param] = [
        ...this.queryObject[param],
        ...(Array.isArray(f) && !isString(f[0])
          ? (f as Array).map((o) => this.cond(o, cond))
          : [this.cond(f as QueryFilter | QueryFilterArr, cond)]),
      ];
    }
  }
github nestjsx / crud / packages / crud-request / src / request-query.parser.ts View on Github external
return this._paramNames.filter((p) => {
      const name = this._options.paramNamesMap[type];
      return isString(name) ? name === p : (name as string[]).some((m) => m === p);
    });
  }
github nestjsx / crud / packages / crud-request / src / request-query.builder.ts View on Github external
setJoin(j: QueryJoin | QueryJoinArr | Array): this {
    if (!isNil(j)) {
      const param = this.checkQueryObjectParam('join', []);
      this.queryObject[param] = [
        ...this.queryObject[param],
        ...(Array.isArray(j) && !isString(j[0])
          ? (j as Array).map((o) => this.addJoin(o))
          : [this.addJoin(j as QueryJoin | QueryJoinArr)]),
      ];
    }
    return this;
  }
github nestjsx / crud / packages / crud / src / crud / swagger.helper.ts View on Github external
const name = (n) => {
      const selected = qbOptions.paramNamesMap[n];
      return isString(selected) ? selected : selected[0];
    };