@edu-tosel/design 1.0.35 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { Order } from "../interface";
2
- export default function sortOrder<K extends string, T extends {
3
- [p in K]: any;
4
- }>(args: T[], order: Order[]): T[];
2
+ export default function sortOrder<T>({ items, orders, }: {
3
+ items?: T[];
4
+ orders: Order[];
5
+ }): T[];
@@ -1,10 +1,10 @@
1
- export default function sortOrder(args, order) {
2
- const allEmpty = order.every(({ orderHow }) => orderHow === "");
1
+ export default function sortOrder({ items, orders, }) {
2
+ const allEmpty = orders.every(({ orderHow }) => orderHow === "");
3
3
  const sortedData = allEmpty
4
- ? [...args]
5
- : [...args].sort((aValue, bValue) => {
6
- for (let i = 0; i < order.length; i++) {
7
- const { orderBy, orderHow } = order[i];
4
+ ? [...items]
5
+ : [...items].sort((aValue, bValue) => {
6
+ for (let i = 0; i < orders.length; i++) {
7
+ const { orderBy, orderHow } = orders[i];
8
8
  if (orderHow === "")
9
9
  continue;
10
10
  const a = aValue[orderBy];
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.35
1
+ 1.0.37