@tmlmobilidade/utils 20250828.1816.30 → 20250829.936.9

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.
@@ -8,11 +8,11 @@ import { type Permission } from '@tmlmobilidade/types';
8
8
  */
9
9
  export declare function getPermission(permissions: Permission<unknown>[], scope: string, action: string): Permission<unknown>;
10
10
  /**
11
- * Check if a permission exists in a list of permissions
12
- * @param permissions - The list of permissions
13
- * @param scope - The scope of the permission
14
- * @param action - The action of the permission
15
- * @returns The permission
11
+ * Check if a permission exists in a list of permissions.
12
+ * @param permissions The list of permissions.
13
+ * @param scope The scope of the permission.
14
+ * @param action The action of the permission.
15
+ * @returns The permission object or undefined if not found.
16
16
  */
17
17
  export declare function hasPermission(permissions: Permission<unknown>[], scope: string, action: string): boolean;
18
18
  export interface HasPermissionResourceArgs<T> {
@@ -20,11 +20,11 @@ export function getPermission(permissions, scope, action) {
20
20
  });
21
21
  }
22
22
  /**
23
- * Check if a permission exists in a list of permissions
24
- * @param permissions - The list of permissions
25
- * @param scope - The scope of the permission
26
- * @param action - The action of the permission
27
- * @returns The permission
23
+ * Check if a permission exists in a list of permissions.
24
+ * @param permissions The list of permissions.
25
+ * @param scope The scope of the permission.
26
+ * @param action The action of the permission.
27
+ * @returns The permission object or undefined if not found.
28
28
  */
29
29
  export function hasPermission(permissions, scope, action) {
30
30
  return permissions.find(permission => permission.scope === scope && permission.action === action) !== undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/utils",
3
- "version": "20250828.1816.30",
3
+ "version": "20250829.936.9",
4
4
  "author": "João de Vasconcelos & Jusi Monteiro",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "homepage": "https://github.com/tmlmobilidade/services#readme",