@eztrak/shared 0.13.4 → 0.13.6

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/index.js CHANGED
@@ -80,6 +80,7 @@ __export(src_exports, {
80
80
  storeItemInLocalStorage: () => storeItemInLocalStorage,
81
81
  toDateInputValue: () => toDateInputValue,
82
82
  toLowerCaseText: () => toLowerCaseText,
83
+ transformPermissions: () => transformPermissions,
83
84
  truncateFileName: () => truncateFileName,
84
85
  truncateText: () => truncateText,
85
86
  useGridHeight: () => useGridHeight,
@@ -334,6 +335,18 @@ var getItemFromLocalStorage = getItem;
334
335
  var storeItemInLocalStorage = setItem;
335
336
  var saveItemLocalStorage = setItem;
336
337
 
338
+ // src/utils/permissions.ts
339
+ function transformPermissions(permissions) {
340
+ return permissions.reduce((acc, permission) => {
341
+ const { moduleName, permission: perm, permissionId } = permission;
342
+ if (!acc[moduleName]) {
343
+ acc[moduleName] = {};
344
+ }
345
+ acc[moduleName][perm] = permissionId;
346
+ return acc;
347
+ }, {});
348
+ }
349
+
337
350
  // src/utils/handleApiError.ts
338
351
  var import_react_hot_toast = __toESM(require("react-hot-toast"));
339
352
  var import_sweetalert2 = __toESM(require("sweetalert2"));
@@ -2130,6 +2143,7 @@ function PopupCellRenderer({
2130
2143
  storeItemInLocalStorage,
2131
2144
  toDateInputValue,
2132
2145
  toLowerCaseText,
2146
+ transformPermissions,
2133
2147
  truncateFileName,
2134
2148
  truncateText,
2135
2149
  useGridHeight,