@qlibs/utils 1.12.0 → 1.12.1

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.
@@ -7,3 +7,4 @@ export declare function removeUserData(): void;
7
7
  export declare function saveMySubRoles(mySubRoles: object): void;
8
8
  export declare function getMySubRoles(): any;
9
9
  export declare function removeMySubRoles(): void;
10
+ export declare function checkIsMyMode(): boolean;
@@ -9,6 +9,7 @@ exports.removeUserData = removeUserData;
9
9
  exports.saveMySubRoles = saveMySubRoles;
10
10
  exports.getMySubRoles = getMySubRoles;
11
11
  exports.removeMySubRoles = removeMySubRoles;
12
+ exports.checkIsMyMode = checkIsMyMode;
12
13
  const APP_AUTH_TOKEN = 'APP_AUTH_TOKEN';
13
14
  const APP_AUTH_USER_DATA = 'APP_AUTH_USER_DATA';
14
15
  const MY_SUB_ROLES = 'MY_SUB_ROLES';
@@ -57,3 +58,16 @@ function getMySubRoles() {
57
58
  function removeMySubRoles() {
58
59
  return localStorage.removeItem(MY_SUB_ROLES);
59
60
  }
61
+ function checkIsMyMode() {
62
+ const mySubRoles = getMySubRoles();
63
+ if (!mySubRoles) {
64
+ return false;
65
+ }
66
+ let isTrue = false;
67
+ Object.values(mySubRoles).forEach(value => {
68
+ if (Array.isArray(value) && value.length > 0) {
69
+ isTrue = true;
70
+ }
71
+ });
72
+ return isTrue;
73
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qlibs/utils",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "",
5
5
  "author": "QBIT Developer",
6
6
  "license": "MIT",