@open-tender/utils 0.1.120 → 0.1.121

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.
package/dist/.DS_Store CHANGED
Binary file
@@ -1,8 +1,10 @@
1
- import { MenuCategories, MenuDisplayedSections, MenuItems } from '@open-tender/types';
1
+ import { MenuCategories, MenuDisplayedSections } from '@open-tender/types';
2
2
  export declare const getBinaryArr: <T>(arr: T[]) => T[][];
3
- export declare const makeMenuItemChunks: (items: MenuItems, chunkSize: number) => {
3
+ export declare const makeItemChunks: <T extends {
4
+ id: number;
5
+ }>(items: T[], chunkSize: number) => {
4
6
  key: string;
5
- items: import("@open-tender/types").MenuItem[];
7
+ items: T[];
6
8
  }[];
7
9
  export declare const makeOtherMenuSections: (displayedSections: MenuDisplayedSections, length?: number) => {
8
10
  name: string;
@@ -90,7 +92,7 @@ export declare const makeFlatCategories: (categories: MenuCategories) => {
90
92
  children: MenuCategories;
91
93
  description: string | null;
92
94
  id: number;
93
- items: MenuItems;
95
+ items: import("@open-tender/types").MenuItems;
94
96
  large_image_url: string | null;
95
97
  menu_name: string;
96
98
  menu_name_id: number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeFlatCategories = exports.makeOtherMenuSections = exports.makeMenuItemChunks = exports.getBinaryArr = void 0;
3
+ exports.makeFlatCategories = exports.makeOtherMenuSections = exports.makeItemChunks = exports.getBinaryArr = void 0;
4
4
  const helpers_1 = require("./helpers");
5
5
  const getBinaryArr = (arr) => {
6
6
  const result = [];
@@ -12,7 +12,7 @@ const getBinaryArr = (arr) => {
12
12
  return result;
13
13
  };
14
14
  exports.getBinaryArr = getBinaryArr;
15
- const makeMenuItemChunks = (items, chunkSize) => {
15
+ const makeItemChunks = (items, chunkSize) => {
16
16
  const arr = [];
17
17
  for (let i = 0; i < items.length; i += chunkSize) {
18
18
  const chunk = items.slice(i, i + chunkSize);
@@ -21,7 +21,7 @@ const makeMenuItemChunks = (items, chunkSize) => {
21
21
  }
22
22
  return arr;
23
23
  };
24
- exports.makeMenuItemChunks = makeMenuItemChunks;
24
+ exports.makeItemChunks = makeItemChunks;
25
25
  const makeOtherMenuSections = (displayedSections, length = 10) => {
26
26
  return Object.entries(displayedSections).map(([section, items]) => {
27
27
  const slug = (0, helpers_1.slugify)(section);
@@ -1,8 +1,10 @@
1
- import { MenuCategories, MenuDisplayedSections, MenuItems } from '@open-tender/types';
1
+ import { MenuCategories, MenuDisplayedSections } from '@open-tender/types';
2
2
  export declare const getBinaryArr: <T>(arr: T[]) => T[][];
3
- export declare const makeMenuItemChunks: (items: MenuItems, chunkSize: number) => {
3
+ export declare const makeItemChunks: <T extends {
4
+ id: number;
5
+ }>(items: T[], chunkSize: number) => {
4
6
  key: string;
5
- items: import("@open-tender/types").MenuItem[];
7
+ items: T[];
6
8
  }[];
7
9
  export declare const makeOtherMenuSections: (displayedSections: MenuDisplayedSections, length?: number) => {
8
10
  name: string;
@@ -90,7 +92,7 @@ export declare const makeFlatCategories: (categories: MenuCategories) => {
90
92
  children: MenuCategories;
91
93
  description: string | null;
92
94
  id: number;
93
- items: MenuItems;
95
+ items: import("@open-tender/types").MenuItems;
94
96
  large_image_url: string | null;
95
97
  menu_name: string;
96
98
  menu_name_id: number;
@@ -8,7 +8,7 @@ export const getBinaryArr = (arr) => {
8
8
  }
9
9
  return result;
10
10
  };
11
- export const makeMenuItemChunks = (items, chunkSize) => {
11
+ export const makeItemChunks = (items, chunkSize) => {
12
12
  const arr = [];
13
13
  for (let i = 0; i < items.length; i += chunkSize) {
14
14
  const chunk = items.slice(i, i + chunkSize);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.1.120",
3
+ "version": "0.1.121",
4
4
  "description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",