Skip to content

Commit

Permalink
Finish v_0.14.8
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldatabox committed Feb 2, 2021
2 parents 4997ad9 + 61348e3 commit 4216178
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "sr-meeseeks",
"author": "Joel Rodrigues Moreira",
"repository": "https://github.com/joeldatabox/mr-meeseeks",
"version": "0.14.7",
"version": "0.14.8",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class SrLocalStorageService {
window.localStorage[key] = value;
} else {
if (isNullOrUndefined(encryptKey)) {
encryptKey = true;
encryptKey = false;
}
const localKey: string = encryptKey ? this.encripty(key, seedEncrypt) : key;
window.localStorage[localKey] = this.encripty(value, seedEncrypt);
Expand All @@ -36,7 +36,7 @@ export class SrLocalStorageService {
return window.localStorage[key] || defaultValue;
} else {
if (isNullOrUndefined(encryptKey)) {
encryptKey = true;
encryptKey = false;
}
const localKey: string = encryptKey ? this.decrypt(key, seedEncrypt) : key;
const result = window.localStorage[localKey];
Expand All @@ -49,7 +49,7 @@ export class SrLocalStorageService {
window.localStorage[key] = JSON.stringify(value);
} else {
if (isNullOrUndefined(encryptKey)) {
encryptKey = true;
encryptKey = false;
}
const localKey: string = encryptKey ? this.encripty(key, seedEncrypt) : key;
window.localStorage[localKey] = JSON.stringify(this.encriptyObject(value, seedEncrypt));
Expand All @@ -62,15 +62,23 @@ export class SrLocalStorageService {
return JSON.parse(window.localStorage.getItem(key));
} else {
if (isNullOrUndefined(encryptKey)) {
encryptKey = true;
encryptKey = false;
}
const localKey: string = encryptKey ? this.decrypt(key, seedEncrypt) : key;
return this.decriptyObject(JSON.parse(window.localStorage.getItem(localKey)), seedEncrypt);
}
}

remove(key: string): SrLocalStorageService {
window.localStorage.removeItem(key);
remove(key: string, seedEncrypt?: string, encryptKey?: boolean): SrLocalStorageService {
if (isEmpty(seedEncrypt)) {
window.localStorage.removeItem(key);
} else {
if (isNullOrUndefined(encryptKey)) {
encryptKey = false;
}
const localKey: string = encryptKey ? this.decrypt(key, seedEncrypt) : key;
window.localStorage.removeItem(localKey);
}
return this;
}

Expand Down

0 comments on commit 4216178

Please sign in to comment.