Codibre/fluent-iterable

View on GitHub
src/common/assure-order.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { AnyIterable } from 'augmentative-iterable';
import { orderAssured } from '../types-internal';
export function assureOrderRecipe<T>(direction: number) {
  return function (this: AnyIterable<T>) {
    (this as any)[orderAssured] = direction;

    return this;
  };
}

export const assureOrder = assureOrderRecipe(1);
export const o = assureOrder;
export const assureOrderDescending = assureOrderRecipe(-1);
export const od = assureOrderDescending;