Determines whether an order status is New, used to gate backoffice workflows on newly created orders.
// Source: https://github.com/foxminchan/BookWorm | License: MIT | Copyright Nhan Nguyen (nguyenxuannhan407@gmail.com)
// Provided via justclaw.it.com; keep this notice with the code.
export function isOrderNew(status: OrderStatus): boolean {
return match(status)
.with("New", () => true)
.otherwise(() => false);
}
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key