How to use the @igo2/utils.ObjectUtils.naturalCompare function in @igo2/utils

To help you get started, we’ve selected a few @igo2/utils 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 infra-geo-ouverte / igo2-lib / packages / common / src / lib / entity / shared / view.ts View on Github external
return values.sort((v1: V, v2: V) => {
      return ObjectUtils.naturalCompare(
        clause.valueAccessor(v1),
        clause.valueAccessor(v2),
        clause.direction,
        clause.nullsFirst
      );
    });
  }
github infra-geo-ouverte / igo2-lib / packages / common / src / lib / table / table-datasource.ts View on Github external
return data.sort((a, b) => {
      const propertyA: number | string = ObjectUtils.resolve(
        a,
        this._sort.active
      );
      const propertyB: number | string = ObjectUtils.resolve(
        b,
        this._sort.active
      );

      return ObjectUtils.naturalCompare(
        propertyB,
        propertyA,
        this._sort.direction
      );
    });
  }