File

src/app/models/order-v-cursor-mode-priority.pipe.ts

import { Pipe, PipeTransform } from "@angular/core";

@Pipe({
    name: "orderVCursorModeByPriorityPipe",
    standalone: false
})
export class OrderVCursorModeByPriorityPipe implements PipeTransform {
	transform(array: any): any[] {
		if (!Array.isArray(array)) {
			return;
		}

		array.sort((a: any, b: any) => {
			if (a[1] < b[1]) {
				return -1;
			} else if (a[1] > b[1]) {
				return 1;
			} else {
				return 0;
			}
		});
		return array;
	}
}

results matching ""

    No results matching ""