maskdata 1.3.2 → 1.3.4
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.
- package/MASKDATA_FOR_TYPESCRIPT.md +18 -14
- package/README.md +462 -478
- package/documentation/get_nested_json_property.md +27 -0
- package/documentation/main.md +117 -0
- package/documentation/mask_cards.md +0 -0
- package/documentation/mask_email_id.md +47 -0
- package/documentation/mask_email_id_with_the_default_configuration.md +355 -0
- package/documentation/mask_jwt_token.md +132 -0
- package/documentation/mask_password.md +31 -0
- package/documentation/mask_password_with_the_default_configuration.md +43 -0
- package/documentation/mask_phone_number.md +26 -0
- package/documentation/mask_phone_number_with_the_default_configuration.md +155 -0
- package/documentation/mask_uuid.md +30 -0
- package/documentation/replace_the_value_of_a_json_field.md +220 -0
- package/index.d.ts +6 -0
- package/index.js +5 -0
- package/lib/helpers/Constants.js +2 -1
- package/lib/helpers/MaskHelper.js +12 -1
- package/lib/maskService/StringMask.js +3 -1
- package/package.json +4 -4
- package/tests/testString.js +16 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
## Mask data for Typescript
|
|
2
2
|
The type definitions are bundled with the package. So, no need to install additional dependency. The type definitions are present here: https://github.com/Sumukha1496/maskdata/blob/master/index.d.ts
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
For more examples you can refer: [maskdata](https://www.npmjs.com/package/maskdata)
|
|
5
5
|
|
|
6
6
|
### Example: Mask password functionality
|
|
7
7
|
|
|
@@ -12,6 +12,7 @@ const password: string = 'myPassword123';
|
|
|
12
12
|
const options: PasswordMaskOptions = {
|
|
13
13
|
maskWith: '*',
|
|
14
14
|
maxMaskedCharacters: 10,
|
|
15
|
+
fixedOutputLength: undefined,
|
|
15
16
|
unmaskedStartCharacters: 2,
|
|
16
17
|
unmaskedEndCharacters: 2
|
|
17
18
|
};
|
|
@@ -27,6 +28,7 @@ Usage: [Password Masking](./README.md#mask-password)
|
|
|
27
28
|
{
|
|
28
29
|
maskWith?: string;
|
|
29
30
|
maxMaskedCharacters?: number;
|
|
31
|
+
fixedOutputLength?: undefined | number;
|
|
30
32
|
unmaskedStartCharacters?: number;
|
|
31
33
|
unmaskedEndCharacters?: number;
|
|
32
34
|
}
|
|
@@ -90,12 +92,26 @@ Usage: [Generic String Masking](./README.md#generic-string-masking)
|
|
|
90
92
|
{
|
|
91
93
|
maskWith?: string;
|
|
92
94
|
maxMaskedCharacters?: number;
|
|
95
|
+
fixedOutputLength?: undefined | number;
|
|
93
96
|
unmaskedStartCharacters?: number;
|
|
94
97
|
unmaskedEndCharacters?: number;
|
|
95
98
|
}
|
|
96
99
|
```
|
|
97
100
|
|
|
98
|
-
### 8.
|
|
101
|
+
### 8. Mask JWT
|
|
102
|
+
Usage: [JWT masking](./README.md#mask-jwt-token)
|
|
103
|
+
```javascript
|
|
104
|
+
{
|
|
105
|
+
maskWith?: string;
|
|
106
|
+
maxMaskedCharacters?: number;
|
|
107
|
+
maskDot?: boolean;
|
|
108
|
+
maskHeader?: boolean;
|
|
109
|
+
maskPayload?: boolean;
|
|
110
|
+
maskSignature?: boolean;
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 9. JsonMask2Configs
|
|
99
115
|
Usage: [JSON fields masking](./README.md#mask-json)
|
|
100
116
|
```typescript
|
|
101
117
|
interface GenericStringMaskOptions {
|
|
@@ -121,18 +137,6 @@ interface GenericStringMaskOptions {
|
|
|
121
137
|
genericStrings?: GenericStringMaskOptions[]
|
|
122
138
|
}
|
|
123
139
|
```
|
|
124
|
-
### 9. Mask JWT
|
|
125
|
-
Usage: [JWT masking](./README.md#mask-jwt-token)
|
|
126
|
-
```javascript
|
|
127
|
-
{
|
|
128
|
-
maskWith?: string;
|
|
129
|
-
maxMaskedCharacters?: number;
|
|
130
|
-
maskDot?: boolean;
|
|
131
|
-
maskHeader?: boolean;
|
|
132
|
-
maskPayload?: boolean;
|
|
133
|
-
maskSignature?: boolean;
|
|
134
|
-
}
|
|
135
|
-
```
|
|
136
140
|
<br/>
|
|
137
141
|
|
|
138
142
|
## Available imports
|