Skip to content

Commit

Permalink
chore: update version
Browse files Browse the repository at this point in the history
  • Loading branch information
michelonsouza committed May 14, 2024
1 parent 0a2c1eb commit 3b8fd7b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Using the [`crypto-js`](https://github.com/brix/crypto-js) library as an encrypt
- [_stateManagementUse_](#statemanagementuse)
- [_encAlgorithm_](#encalgorithm)
- [_notifyHandler_](#notifyhandler)
- [_doNotEncryptValues_](#doNotEncryptValues)
- [_doNotParseValues_](#doNotParseValues)
- [Methods](#methods)
- [_setItem_](#setitem)
- [_setMultipleItems_](#setmultipleitems)
Expand Down Expand Up @@ -120,6 +122,7 @@ The `options` object is optional and consists of the following properties:
| `notifyHandler` | `undefined` | [NotifyHandler](./src/types.ts#L23) | `false` |
| `stateManagementUse` | `false` | `boolean` | `false` |
| `doNotEncryptValues` | `false` | `boolean` | `false` |
| `doNotParseValues` | `false` | `boolean` | `false` |

## Usage

Expand Down Expand Up @@ -257,6 +260,25 @@ export const encryptStorage = new EncryptStorage('secret-key-value', {
});
```

#### _doNotParseValues_

default `false` - This option `NOT` parse values, but use those options like `prefix` our `multiple-instances`.:

```typescript
import { EncryptStorage } from 'encrypt-storage';

export const encryptStorage = new EncryptStorage('secret-key-value', {
doNotParseValues: true,
});

encryptStorage.setItem('key', JSON.stringfy({ name: 'John Doe' }));

const value = JSON.parse(encryptStorage.getItem('key')); // { name: 'John Doe' }
```

> NOTE: This option `does not` `JSON.stringify` or `JSON.parse` the data, making `return typing` useless or unnecessary.
> **This is similar to standard browser behavior.**
#### _notifyHandler_

default `undefined` - is a `function` that is `called` every time another `EncryptStorage function` is `called`. Good for logging API and monitoring `localStorage/sessionStorage`.:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "encrypt-storage",
"version": "2.13.00",
"version": "2.13.02",
"description": "Wrapper for encrypted localStorage and sessionStorage in browser",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 3b8fd7b

Please sign in to comment.