maskdata 1.2.4 → 1.2.5

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.
@@ -23,7 +23,7 @@ console.log(maskedPassword);
23
23
 
24
24
  ## Available mask configs/option
25
25
  ### 1. PasswordMaskOptions
26
- Used in [Password Masking](#mask-password)
26
+ Usage: [Password Masking](./README.md#mask-password)
27
27
  ```javascript
28
28
  {
29
29
  maskWith?: string;
@@ -34,7 +34,7 @@ Used in [Password Masking](#mask-password)
34
34
  ```
35
35
 
36
36
  ### 2. CardMaskOptions
37
- Used in [Card masking](./README.md#mask-card-number)
37
+ Usage: [Card masking](./README.md#mask-card-number)
38
38
  ```javascript
39
39
  {
40
40
  maskWith?: string;
@@ -44,7 +44,7 @@ Used in [Card masking](./README.md#mask-card-number)
44
44
  ```
45
45
 
46
46
  ### 3. EmailMask2Options
47
- Used in [Email masking](./README.md#mask-email-id)
47
+ Usage: [Email masking](./README.md#mask-email-id)
48
48
  ```javascript
49
49
  {
50
50
  maskWith?: string;
@@ -55,7 +55,7 @@ Used in [Email masking](./README.md#mask-email-id)
55
55
  ```
56
56
 
57
57
  ### 4. PhoneMaskOptions
58
- Used in [Phone Number Masking](#mask-phone-number)
58
+ Usage: [Phone Number Masking](./README.md#mask-phone-number)
59
59
  ```javascript
60
60
  {
61
61
  maskWith?: string;
@@ -64,7 +64,7 @@ Used in [Phone Number Masking](#mask-phone-number)
64
64
  }
65
65
  ```
66
66
  ### 5. StringMaskOptions
67
- Used in [String masking](./README.md#mask-the-characters-or-words-in-the-string)
67
+ Usage: [String masking](./README.md#mask-the-characters-or-words-in-the-string)
68
68
  ```javascript
69
69
  {
70
70
  maskWith?: string;
@@ -76,7 +76,7 @@ Used in [String masking](./README.md#mask-the-characters-or-words-in-the-string)
76
76
  ```
77
77
 
78
78
  ### 6. UuidMaskOptions
79
- Used in [UUID Masking](#mask-uuid)
79
+ Usage: [UUID Masking](./README.md#mask-uuid)
80
80
  ```javascript
81
81
  {
82
82
  maskWith?: string;
@@ -86,7 +86,7 @@ Used in [UUID Masking](#mask-uuid)
86
86
  ```
87
87
 
88
88
  ### 7. JsonMask2Configs
89
- Used in [JSON fields masking](#mask-json)
89
+ Usage: [JSON fields masking](./README.md#mask-json)
90
90
  ```javascript
91
91
  {
92
92
  cardMaskOptions?: CardMaskOptions;
@@ -101,12 +101,24 @@ Used in [JSON fields masking](#mask-json)
101
101
  stringFields?: string[];
102
102
  uuidMaskOptions?: UuidMaskOptions;
103
103
  uuidFields?: string[];
104
+ jwtMaskOptions?: JwtMaskOptions;
105
+ jwtFields?: string[];
104
106
  }
105
107
  ```
108
+ ### 8. Mask JWT
109
+ Usage: [JWT masking](./README.md#mask-jwt-token)
110
+ const defaultJwtMaskOptions = {
111
+ maskWith: '*',
112
+ maxMaskedCharacters: 512,
113
+ maskDot: true,
114
+ maskHeader: true,
115
+ maskPayload: true,
116
+ maskSignature: true
117
+ };
106
118
 
107
119
  <br/>
108
120
 
109
121
  ## Available functions to import along with their configs
110
122
  ```javascript
111
- import { maskPassword, PasswordMaskOptions, maskJSON2, JsonMask2Configs, maskPhone, PhoneMaskOptions, maskEmail2, EmailMask2Options, maskCard, CardMaskOptions, maskString, StringMaskOptions, maskUuid, UuidMaskOptions, getInnerProperty, replaceValue } from 'maskdata';
123
+ import { maskPassword, PasswordMaskOptions, maskJSON2, JsonMask2Configs, maskPhone, PhoneMaskOptions, maskEmail2, EmailMask2Options, maskCard, CardMaskOptions, maskString, StringMaskOptions, maskUuid, UuidMaskOptions, maskJwt, JwtMaskOptions, getInnerProperty, replaceValue } from 'maskdata';
112
124
  ```
package/README.md CHANGED
@@ -4,7 +4,7 @@ maskdata is a Node.js module to mask various kinds of data. With the help of mas
4
4
  # Table of Contents
5
5
  - [Features](#features)
6
6
  - [Install maskdata](#install-maskdata)
7
- - [Version 1.2.4 Features](#release-features)
7
+ - [Version 1.2.5 Features](#release-features)
8
8
  - [How to Use](#how-to-use)
9
9
  - [Maskdata for Typescript](#maskdata-for-typescript)
10
10
  - [Mask Card number](#mask-card-number)
@@ -43,7 +43,7 @@ maskdata is a Node.js module to mask various kinds of data. With the help of mas
43
43
  > npm i maskdata
44
44
 
45
45
  # Release Features
46
- ### Version 1.2.4
46
+ ### Version 1.2.5
47
47
  - JWT token masking: Mask JWT tokens with configs to mask as per your need. More details: [Mask JWT Token](#mask-jwt-token)
48
48
  - Mask Json now supports JWT token masking also. More details: [Mask JWT in a JSON](#mask-json)
49
49
  - Bug fix in maskJson2 where it was not checking for the empty/null/undefined fields and was resulting in error `"TypeError: validatedConfig[typeToFunctionMap[key][1]] is not iterable"`
package/index.d.ts CHANGED
@@ -67,6 +67,8 @@ declare module 'maskdata' {
67
67
  stringFields?: string[];
68
68
  uuidMaskOptions?: UuidMaskOptions;
69
69
  uuidFields?: string[];
70
+ jwtMaskOptions?: JwtMaskOptions;
71
+ jwtFields?: string[];
70
72
  }
71
73
 
72
74
  export function maskPassword(password?: string, options?: PasswordMaskOptions): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maskdata",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Node module to mask various kinds of data in the required formats",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",