@qlibs/utils 1.7.5 → 1.8.0

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,15 +1,16 @@
1
- export * from './auth';
2
- export * from './axios';
3
- export * from './datetime';
4
- export * from './errorHandler';
5
- export * from './formRules';
6
- export * from './generateQueryString';
7
- export * from './image';
8
- export * from './name';
9
- export * from './number';
10
- export * from './order';
11
- export * from './pagination';
12
- export * from './price';
13
- export * from './text';
14
- export * from './formHandler';
15
- export * from './browser';
1
+ export * from "./auth";
2
+ export * from "./axios";
3
+ export * from "./datetime";
4
+ export * from "./errorHandler";
5
+ export * from "./formRules";
6
+ export * from "./generateQueryString";
7
+ export * from "./image";
8
+ export * from "./name";
9
+ export * from "./number";
10
+ export * from "./order";
11
+ export * from "./pagination";
12
+ export * from "./price";
13
+ export * from "./text";
14
+ export * from "./formHandler";
15
+ export * from "./browser";
16
+ export * from "./passwordExpiry";
@@ -29,3 +29,4 @@ __exportStar(require("./price"), exports);
29
29
  __exportStar(require("./text"), exports);
30
30
  __exportStar(require("./formHandler"), exports);
31
31
  __exportStar(require("./browser"), exports);
32
+ __exportStar(require("./passwordExpiry"), exports);
@@ -0,0 +1,5 @@
1
+ export declare const savePasswordExpiry: (expiryDate: Date, isExpired: boolean) => void;
2
+ export declare const getPasswordExpiry: () => {
3
+ passwordExpiredAt: Date;
4
+ isPasswordExpired: boolean;
5
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPasswordExpiry = exports.savePasswordExpiry = void 0;
4
+ const exp = "passwordExpiry";
5
+ const expiredAt = "passwordExpiredAt";
6
+ const expiredStatus = "isPasswordExpired";
7
+ const savePasswordExpiry = (expiryDate, isExpired) => {
8
+ const data = {
9
+ [expiredAt]: expiryDate,
10
+ [expiredStatus]: isExpired,
11
+ };
12
+ localStorage.setItem(exp, JSON.stringify(data));
13
+ };
14
+ exports.savePasswordExpiry = savePasswordExpiry;
15
+ const getPasswordExpiry = () => {
16
+ const data = localStorage.getItem(exp);
17
+ if (data) {
18
+ const parsedData = JSON.parse(data);
19
+ return {
20
+ [expiredAt]: new Date(parsedData[expiredAt]),
21
+ [expiredStatus]: Boolean(parsedData[expiredStatus]),
22
+ };
23
+ }
24
+ return null;
25
+ };
26
+ exports.getPasswordExpiry = getPasswordExpiry;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qlibs/utils",
3
- "version": "1.7.5",
3
+ "version": "1.8.0",
4
4
  "description": "",
5
5
  "author": "QBIT Developer",
6
6
  "license": "MIT",