maskdata 1.2.1 → 1.2.3

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.
@@ -2,74 +2,107 @@
2
2
  const maskData = require('../index');
3
3
  const expect = require('chai').expect;
4
4
 
5
- describe('Test getValue', function() {
6
- describe('Test get JSON field values', function() {
7
-
5
+ describe('Test getValue', function () {
6
+ describe('Test get JSON field values', function () {
8
7
  let testData = [
9
8
  {
10
9
  title: 'test getting a string field from json',
11
- input: {'stringField': "StringValue", "booleanField": true, "numberField": 1000, "objectField" : [1, 2, 3, 4]},
10
+ input: {
11
+ stringField: 'StringValue',
12
+ booleanField: true,
13
+ numberField: 1000,
14
+ objectField: [1, 2, 3, 4]
15
+ },
12
16
  fieldToGet: 'stringField',
13
17
  output: 'StringValue'
14
18
  },
15
19
  {
16
20
  title: 'test getting a boolean field from json',
17
- input: {'stringField': "StringValue", "booleanField": true, "numberField": 1000, "objectField" : [1, 2, 3, 4]},
21
+ input: {
22
+ stringField: 'StringValue',
23
+ booleanField: true,
24
+ numberField: 1000,
25
+ objectField: [1, 2, 3, 4]
26
+ },
18
27
  fieldToGet: 'booleanField',
19
28
  output: true
20
29
  },
21
30
  {
22
31
  title: 'test getting a number field from json',
23
- input: {'stringField': "StringValue", "booleanField": true, "numberField": 1000, "objectField" : [1, 2, 3, 4]},
32
+ input: {
33
+ stringField: 'StringValue',
34
+ booleanField: true,
35
+ numberField: 1000,
36
+ objectField: [1, 2, 3, 4]
37
+ },
24
38
  fieldToGet: 'numberField',
25
39
  output: 1000
26
40
  }
27
- ]
41
+ ];
28
42
 
29
- testData.forEach(({title, input, fieldToGet, output}) => {
30
- it(`default mask - ${title}`, function() {
43
+ testData.forEach(({ title, input, fieldToGet, output }) => {
44
+ it(`default mask - ${title}`, function () {
31
45
  const jsonFieldValue = maskData.getInnerProperty(input, fieldToGet);
32
46
  expect(jsonFieldValue).to.equal(output, 'Expected json property found');
33
47
  });
34
- })
48
+ });
35
49
  });
36
50
  });
37
51
 
38
- describe('Test replaceValue', function() {
39
- describe('Test replace json field Value', function() {
40
-
52
+ describe('Test replaceValue', function () {
53
+ describe('Test replace json field Value', function () {
41
54
  let testData = [
42
55
  {
43
56
  title: 'test replacing a string field value from json',
44
- input: {'stringField': "StringValue", "booleanField": true, "numberField": 1000, "objectField" : [1, 2, 3, 4]},
57
+ input: {
58
+ stringField: 'StringValue',
59
+ booleanField: true,
60
+ numberField: 1000,
61
+ objectField: [1, 2, 3, 4]
62
+ },
45
63
  fieldToReplace: 'stringField',
46
64
  output: 'NewStringValue'
47
65
  },
48
66
  {
49
67
  title: 'test replacing a boolean field value from json',
50
- input: {'stringField': "StringValue", "booleanField": true, "numberField": 1000, "objectField" : [1, 2, 3, 4]},
68
+ input: {
69
+ stringField: 'StringValue',
70
+ booleanField: true,
71
+ numberField: 1000,
72
+ objectField: [1, 2, 3, 4]
73
+ },
51
74
  fieldToReplace: 'booleanField',
52
75
  output: false
53
76
  },
54
77
  {
55
78
  title: 'test replacing a number field value from json',
56
- input: {'stringField': "StringValue", "booleanField": true, "numberField": 1000, "objectField" : [1, 2, 3, 4]},
79
+ input: {
80
+ stringField: 'StringValue',
81
+ booleanField: true,
82
+ numberField: 1000,
83
+ objectField: [1, 2, 3, 4]
84
+ },
57
85
  fieldToReplace: 'numberField',
58
86
  output: 1111
59
87
  },
60
88
  {
61
89
  title: 'test replacing a object field value from json',
62
- input: {'stringField': "StringValue", "booleanField": true, "numberField": 1000, "objectField" : [1, 2, 3, 4]},
90
+ input: {
91
+ stringField: 'StringValue',
92
+ booleanField: true,
93
+ numberField: 1000,
94
+ objectField: [1, 2, 3, 4]
95
+ },
63
96
  fieldToReplace: 'objectField',
64
97
  output: false
65
98
  }
66
- ]
99
+ ];
67
100
 
68
- testData.forEach(({title, input, fieldToReplace, output}) => {
69
- it(`default mask - ${title}`, function() {
101
+ testData.forEach(({ title, input, fieldToReplace, output }) => {
102
+ it(`default mask - ${title}`, function () {
70
103
  const jsonAfterReplacing = maskData.replaceValue(input, fieldToReplace, output);
71
104
  expect(jsonAfterReplacing[fieldToReplace]).to.equal(output, 'Expected json property found');
72
105
  });
73
- })
106
+ });
74
107
  });
75
108
  });
@@ -5,119 +5,125 @@ const expect = require('chai').expect;
5
5
  const maskHelper = require('../lib/helpers/MaskHelper');
6
6
  const Constants = require('../lib/helpers/Constants');
7
7
 
8
- describe('Test helper functions', function() {
9
-
10
- describe('Test mapWithDefaultValues function', function() {
11
- it('Test mapWithDefaultValues function', function() {
12
- const options = maskHelper.mapWithDefaultValues({}, Constants.defaultCardMaskOptions);
13
- // const defaultCardMaskOptions = {
14
- // maskWith: "*",
15
- // unmaskedStartDigits: 4,
16
- // unmaskedEndDigits: 1
17
- // };
18
- expect(options['maskWith']).to.equal("*");
19
- expect(options['unmaskedStartDigits']).to.equal(4);
20
- expect(options['unmaskedEndDigits']).to.equal(1);
8
+ describe('Test helper functions', function () {
9
+ describe('Test mapWithDefaultValues function', function () {
10
+ it('Test mapWithDefaultValues function', function () {
11
+ const options = maskHelper.mapWithDefaultValues({}, Constants.defaultCardMaskOptions);
12
+ // const defaultCardMaskOptions = {
13
+ // maskWith: "*",
14
+ // unmaskedStartDigits: 4,
15
+ // unmaskedEndDigits: 1
16
+ // };
17
+ expect(options['maskWith']).to.equal('*');
18
+ expect(options['unmaskedStartDigits']).to.equal(4);
19
+ expect(options['unmaskedEndDigits']).to.equal(1);
21
20
  });
22
21
  });
23
22
 
24
- describe('Test getValidatedJsonMask2Configs function', function() {
25
- it('Test getValidatedJsonMask2Configs function with empty configs', function() {
26
- const options = maskHelper.getValidatedJsonMask2Configs({}, Constants.defaultjsonMask2Configs);
27
- // const defaultjsonMask2Configs = {
28
- // cardMaskOptions: defaultCardMaskOptions,
29
- // cardFields: [],
30
- // emailMaskOptions: defaultEmailMask2Options,
31
- // emailFields: [],
32
- // passwordMaskOptions: defaultPasswordMaskOptions,
33
- // passwordFields: [],
34
- // phoneMaskOptions: defaultPhoneMaskOptions,
35
- // phoneFields: [],
36
- // stringMaskOptions: defaultStringMaskOptions,
37
- // stringFields: [],
38
- // uuidMaskOptions: defaultUuidMaskOptions,
39
- // uuidFields: []
40
- // };
41
- expect(options['cardMaskOptions']['maskWith']).to.equal("*");
42
- expect(options['emailMaskOptions']['maskWith']).to.equal("*");
43
- expect(options['passwordMaskOptions']['maskWith']).to.equal("*");
44
- expect(options['phoneMaskOptions']['maskWith']).to.equal("*");
45
- expect(options['stringMaskOptions']['maskWith']).to.equal("*");
46
- expect(options['uuidMaskOptions']['maskWith']).to.equal("*");
23
+ describe('Test getValidatedJsonMask2Configs function', function () {
24
+ it('Test getValidatedJsonMask2Configs function with empty configs', function () {
25
+ const options = maskHelper.getValidatedJsonMask2Configs(
26
+ {},
27
+ Constants.defaultjsonMask2Configs
28
+ );
29
+ // const defaultjsonMask2Configs = {
30
+ // cardMaskOptions: defaultCardMaskOptions,
31
+ // cardFields: [],
32
+ // emailMaskOptions: defaultEmailMask2Options,
33
+ // emailFields: [],
34
+ // passwordMaskOptions: defaultPasswordMaskOptions,
35
+ // passwordFields: [],
36
+ // phoneMaskOptions: defaultPhoneMaskOptions,
37
+ // phoneFields: [],
38
+ // stringMaskOptions: defaultStringMaskOptions,
39
+ // stringFields: [],
40
+ // uuidMaskOptions: defaultUuidMaskOptions,
41
+ // uuidFields: []
42
+ // };
43
+ expect(options['cardMaskOptions']['maskWith']).to.equal('*');
44
+ expect(options['emailMaskOptions']['maskWith']).to.equal('*');
45
+ expect(options['passwordMaskOptions']['maskWith']).to.equal('*');
46
+ expect(options['phoneMaskOptions']['maskWith']).to.equal('*');
47
+ expect(options['stringMaskOptions']['maskWith']).to.equal('*');
48
+ expect(options['uuidMaskOptions']['maskWith']).to.equal('*');
47
49
 
48
- expect(options['cardMaskOptions']['unmaskedStartDigits']).to.equal(4);
49
- expect(options['emailMaskOptions']['unmaskedStartCharactersBeforeAt']).to.equal(3);
50
- expect(options['passwordMaskOptions']['maxMaskedCharacters']).to.equal(16);
51
- expect(options['phoneMaskOptions']['unmaskedStartDigits']).to.equal(4);
52
- expect(options['stringMaskOptions']['maskAll']).to.equal(false);
53
- expect(options['uuidMaskOptions']['unmaskedStartCharacters']).to.equal(0);
50
+ expect(options['cardMaskOptions']['unmaskedStartDigits']).to.equal(4);
51
+ expect(options['emailMaskOptions']['unmaskedStartCharactersBeforeAt']).to.equal(3);
52
+ expect(options['passwordMaskOptions']['maxMaskedCharacters']).to.equal(16);
53
+ expect(options['phoneMaskOptions']['unmaskedStartDigits']).to.equal(4);
54
+ expect(options['stringMaskOptions']['maskAll']).to.equal(false);
55
+ expect(options['uuidMaskOptions']['unmaskedStartCharacters']).to.equal(0);
54
56
  });
55
57
 
56
- it('Test getValidatedJsonMask2Configs function with only the fields list', function() {
57
- const options = maskHelper.getValidatedJsonMask2Configs({cardFields: ["card1"]}, Constants.defaultjsonMask2Configs);
58
- // const defaultjsonMask2Configs = {
59
- // cardMaskOptions: defaultCardMaskOptions,
60
- // cardFields: [],
61
- // emailMaskOptions: defaultEmailMask2Options,
62
- // emailFields: [],
63
- // passwordMaskOptions: defaultPasswordMaskOptions,
64
- // passwordFields: [],
65
- // phoneMaskOptions: defaultPhoneMaskOptions,
66
- // phoneFields: [],
67
- // stringMaskOptions: defaultStringMaskOptions,
68
- // stringFields: [],
69
- // uuidMaskOptions: defaultUuidMaskOptions,
70
- // uuidFields: []
71
- // };
72
- expect(options['cardMaskOptions']['maskWith']).to.equal("*");
73
- expect(options['emailMaskOptions']['maskWith']).to.equal("*");
74
- expect(options['passwordMaskOptions']['maskWith']).to.equal("*");
75
- expect(options['phoneMaskOptions']['maskWith']).to.equal("*");
76
- expect(options['stringMaskOptions']['maskWith']).to.equal("*");
77
- expect(options['uuidMaskOptions']['maskWith']).to.equal("*");
58
+ it('Test getValidatedJsonMask2Configs function with only the fields list', function () {
59
+ const options = maskHelper.getValidatedJsonMask2Configs(
60
+ { cardFields: ['card1'] },
61
+ Constants.defaultjsonMask2Configs
62
+ );
63
+ // const defaultjsonMask2Configs = {
64
+ // cardMaskOptions: defaultCardMaskOptions,
65
+ // cardFields: [],
66
+ // emailMaskOptions: defaultEmailMask2Options,
67
+ // emailFields: [],
68
+ // passwordMaskOptions: defaultPasswordMaskOptions,
69
+ // passwordFields: [],
70
+ // phoneMaskOptions: defaultPhoneMaskOptions,
71
+ // phoneFields: [],
72
+ // stringMaskOptions: defaultStringMaskOptions,
73
+ // stringFields: [],
74
+ // uuidMaskOptions: defaultUuidMaskOptions,
75
+ // uuidFields: []
76
+ // };
77
+ expect(options['cardMaskOptions']['maskWith']).to.equal('*');
78
+ expect(options['emailMaskOptions']['maskWith']).to.equal('*');
79
+ expect(options['passwordMaskOptions']['maskWith']).to.equal('*');
80
+ expect(options['phoneMaskOptions']['maskWith']).to.equal('*');
81
+ expect(options['stringMaskOptions']['maskWith']).to.equal('*');
82
+ expect(options['uuidMaskOptions']['maskWith']).to.equal('*');
78
83
 
79
- expect(options['cardMaskOptions']['unmaskedStartDigits']).to.equal(4);
80
- expect(options['cardFields'][0]).to.equal("card1");
81
- expect(options['emailMaskOptions']['unmaskedStartCharactersBeforeAt']).to.equal(3);
82
- expect(options['passwordMaskOptions']['maxMaskedCharacters']).to.equal(16);
83
- expect(options['phoneMaskOptions']['unmaskedStartDigits']).to.equal(4);
84
- expect(options['stringMaskOptions']['maskAll']).to.equal(false);
85
- expect(options['uuidMaskOptions']['unmaskedStartCharacters']).to.equal(0);
84
+ expect(options['cardMaskOptions']['unmaskedStartDigits']).to.equal(4);
85
+ expect(options['cardFields'][0]).to.equal('card1');
86
+ expect(options['emailMaskOptions']['unmaskedStartCharactersBeforeAt']).to.equal(3);
87
+ expect(options['passwordMaskOptions']['maxMaskedCharacters']).to.equal(16);
88
+ expect(options['phoneMaskOptions']['unmaskedStartDigits']).to.equal(4);
89
+ expect(options['stringMaskOptions']['maskAll']).to.equal(false);
90
+ expect(options['uuidMaskOptions']['unmaskedStartCharacters']).to.equal(0);
86
91
  });
87
92
  });
88
93
 
89
- describe('Test getValidatedJsonMask2Configs function', function() {
90
- it('Test getValidatedJsonMask2Configs function with empty configs', function() {
91
- const options = maskHelper.getValidatedJsonMask2Configs({}, Constants.defaultjsonMask2Configs);
92
- // const defaultjsonMask2Configs = {
93
- // cardMaskOptions: defaultCardMaskOptions,
94
- // cardFields: [],
95
- // emailMaskOptions: defaultEmailMask2Options,
96
- // emailFields: [],
97
- // passwordMaskOptions: defaultPasswordMaskOptions,
98
- // passwordFields: [],
99
- // phoneMaskOptions: defaultPhoneMaskOptions,
100
- // phoneFields: [],
101
- // stringMaskOptions: defaultStringMaskOptions,
102
- // stringFields: [],
103
- // uuidMaskOptions: defaultUuidMaskOptions,
104
- // uuidFields: []
105
- // };
106
- expect(options['cardMaskOptions']['maskWith']).to.equal("*");
107
- expect(options['emailMaskOptions']['maskWith']).to.equal("*");
108
- expect(options['passwordMaskOptions']['maskWith']).to.equal("*");
109
- expect(options['phoneMaskOptions']['maskWith']).to.equal("*");
110
- expect(options['stringMaskOptions']['maskWith']).to.equal("*");
111
- expect(options['uuidMaskOptions']['maskWith']).to.equal("*");
112
-
113
- expect(options['cardMaskOptions']['unmaskedStartDigits']).to.equal(4);
114
- expect(options['emailMaskOptions']['unmaskedStartCharactersBeforeAt']).to.equal(3);
115
- expect(options['passwordMaskOptions']['maxMaskedCharacters']).to.equal(16);
116
- expect(options['phoneMaskOptions']['unmaskedStartDigits']).to.equal(4);
117
- expect(options['stringMaskOptions']['maskAll']).to.equal(false);
118
- expect(options['uuidMaskOptions']['unmaskedStartCharacters']).to.equal(0);
94
+ describe('Test getValidatedJsonMask2Configs function', function () {
95
+ it('Test getValidatedJsonMask2Configs function with empty configs', function () {
96
+ const options = maskHelper.getValidatedJsonMask2Configs(
97
+ {},
98
+ Constants.defaultjsonMask2Configs
99
+ );
100
+ // const defaultjsonMask2Configs = {
101
+ // cardMaskOptions: defaultCardMaskOptions,
102
+ // cardFields: [],
103
+ // emailMaskOptions: defaultEmailMask2Options,
104
+ // emailFields: [],
105
+ // passwordMaskOptions: defaultPasswordMaskOptions,
106
+ // passwordFields: [],
107
+ // phoneMaskOptions: defaultPhoneMaskOptions,
108
+ // phoneFields: [],
109
+ // stringMaskOptions: defaultStringMaskOptions,
110
+ // stringFields: [],
111
+ // uuidMaskOptions: defaultUuidMaskOptions,
112
+ // uuidFields: []
113
+ // };
114
+ expect(options['cardMaskOptions']['maskWith']).to.equal('*');
115
+ expect(options['emailMaskOptions']['maskWith']).to.equal('*');
116
+ expect(options['passwordMaskOptions']['maskWith']).to.equal('*');
117
+ expect(options['phoneMaskOptions']['maskWith']).to.equal('*');
118
+ expect(options['stringMaskOptions']['maskWith']).to.equal('*');
119
+ expect(options['uuidMaskOptions']['maskWith']).to.equal('*');
119
120
 
121
+ expect(options['cardMaskOptions']['unmaskedStartDigits']).to.equal(4);
122
+ expect(options['emailMaskOptions']['unmaskedStartCharactersBeforeAt']).to.equal(3);
123
+ expect(options['passwordMaskOptions']['maxMaskedCharacters']).to.equal(16);
124
+ expect(options['phoneMaskOptions']['unmaskedStartDigits']).to.equal(4);
125
+ expect(options['stringMaskOptions']['maskAll']).to.equal(false);
126
+ expect(options['uuidMaskOptions']['unmaskedStartCharacters']).to.equal(0);
120
127
  });
121
128
  });
122
-
123
- });
129
+ });
@@ -2,10 +2,8 @@
2
2
  const maskData = require('../index');
3
3
  const expect = require('chai').expect;
4
4
 
5
- describe('Masking password', function() {
6
-
7
- describe('Mask with default options', function() {
8
-
5
+ describe('Masking password', function () {
6
+ describe('Mask with default options', function () {
9
7
  // default options are this - let tests fail when defaults change
10
8
  // const defaultPasswordMaskOptions = {
11
9
  // maskWith: "*",
@@ -18,7 +16,7 @@ describe('Masking password', function() {
18
16
  {
19
17
  title: 'test default string',
20
18
  input: '1234-5678-1234-5678',
21
- output: '****************' // equal maxMaskedChars
19
+ output: '****************' // equal maxMaskedChars
22
20
  },
23
21
  {
24
22
  title: 'test string shorter than maxMasked',
@@ -28,24 +26,23 @@ describe('Masking password', function() {
28
26
  {
29
27
  title: 'test longer than maxMasked',
30
28
  input: '1234567890abcdefghijkl',
31
- output: '****************' // equal maxMaskedChars
29
+ output: '****************' // equal maxMaskedChars
32
30
  }
33
- ]
31
+ ];
34
32
 
35
- testData.forEach(({title, input, output}) => {
36
- it(`default mask - ${title}`, function() {
33
+ testData.forEach(({ title, input, output }) => {
34
+ it(`default mask - ${title}`, function () {
37
35
  const masked = maskData.maskPassword(input);
38
36
  expect(masked).to.equal(output, 'masked output does not match expected value');
39
37
  });
40
- })
38
+ });
41
39
  });
42
40
 
43
- describe('Mask with custom options - maskWith, maxMaskedChars', function() {
44
-
41
+ describe('Mask with custom options - maskWith, maxMaskedChars', function () {
45
42
  const maskOptions = {
46
- maskWith: "x",
43
+ maskWith: 'x',
47
44
  maxMaskedCharacters: 6,
48
- unmaskedStartCharacters: 1, // use different numbers for start / end to check correct masking
45
+ unmaskedStartCharacters: 1, // use different numbers for start / end to check correct masking
49
46
  unmaskedEndCharacters: 2
50
47
  };
51
48
 
@@ -65,66 +62,70 @@ describe('Masking password', function() {
65
62
  input: '12',
66
63
  output: '12'
67
64
  }
68
- ]
65
+ ];
69
66
 
70
- testData.forEach(({title, input, output}) => {
71
- it(`custom mask - ${title}`, function() {
67
+ testData.forEach(({ title, input, output }) => {
68
+ it(`custom mask - ${title}`, function () {
72
69
  const masked = maskData.maskPassword(input, maskOptions);
73
70
  expect(masked).to.equal(output, 'masked output does not match expected value');
74
71
  });
75
72
  });
76
73
 
77
- it('custom mask - test with negative unmaskedStartDigits', function() {
74
+ it('custom mask - test with negative unmaskedStartDigits', function () {
78
75
  const negativeStartOption = {
79
76
  maskWith: 'x',
80
77
  maxMaskedCharacters: 6,
81
- unmaskedStartCharacters: -2, // internal set to 0
78
+ unmaskedStartCharacters: -2, // internal set to 0
82
79
  unmaskedEndCharacters: 2
83
- }
84
- const input = '1234-5678-1234-5678'
85
- const output = 'xxxx78'
80
+ };
81
+ const input = '1234-5678-1234-5678';
82
+ const output = 'xxxx78';
86
83
  const masked = maskData.maskPassword(input, negativeStartOption);
87
84
  expect(masked).to.equal(output, 'masked output does not match expected value');
88
85
  });
89
86
 
90
- it('custom mask - test with maxMasked shorter than start + end: No masking done', function() {
87
+ it('custom mask - test with maxMasked shorter than start + end: No masking done', function () {
91
88
  const shortMaxCharsOption = {
92
89
  maskWith: 'x',
93
90
  maxMaskedCharacters: 6,
94
- unmaskedStartCharacters: 4, // 4+4=8 > 6
91
+ unmaskedStartCharacters: 4, // 4+4=8 > 6
95
92
  unmaskedEndCharacters: 4
96
- }
97
- const input = '1234-5678-1234-5678'
98
- const output = '123478'
93
+ };
94
+ const input = '1234-5678-1234-5678';
95
+ const output = '123478';
99
96
  const masked = maskData.maskPassword(input, shortMaxCharsOption);
100
- expect(masked).to.equal(output, 'No masking done because maxMasked(max output characters) shorter than start + end');
97
+ expect(masked).to.equal(
98
+ output,
99
+ 'No masking done because maxMasked(max output characters) shorter than start + end'
100
+ );
101
101
  });
102
102
 
103
- it('custom mask - test with maxMasked equal to start + end: No masking done', function() {
103
+ it('custom mask - test with maxMasked equal to start + end: No masking done', function () {
104
104
  const shortMaxCharsOption = {
105
105
  maskWith: 'x',
106
106
  maxMaskedCharacters: 8,
107
- unmaskedStartCharacters: 4, // 4+4=8
107
+ unmaskedStartCharacters: 4, // 4+4=8
108
108
  unmaskedEndCharacters: 4
109
- }
110
- const input = '1234-abcd-efgh-5678'
111
- const output = '12345678'
109
+ };
110
+ const input = '1234-abcd-efgh-5678';
111
+ const output = '12345678';
112
112
  const masked = maskData.maskPassword(input, shortMaxCharsOption);
113
- expect(masked).to.equal(output, 'No masking done because maxMasked(max output characters) equal to start + end');
113
+ expect(masked).to.equal(
114
+ output,
115
+ 'No masking done because maxMasked(max output characters) equal to start + end'
116
+ );
114
117
  });
115
118
  });
116
119
 
117
- describe('Mask with special input strings', function() {
118
-
120
+ describe('Mask with special input strings', function () {
119
121
  const maskOptions = {
120
- maskWith: "x",
122
+ maskWith: 'x',
121
123
  maxMaskedCharacters: 6,
122
124
  unmaskedStartCharacters: 2,
123
125
  unmaskedEndCharacters: 2
124
126
  };
125
127
 
126
- describe('Mask with special input - input will generate an output', function() {
127
-
128
+ describe('Mask with special input - input will generate an output', function () {
128
129
  // first set with input generating an masked output
129
130
  let testData = [
130
131
  {
@@ -141,19 +142,18 @@ describe('Masking password', function() {
141
142
  title: 'test input as number',
142
143
  input: 12,
143
144
  output: '12'
144
- },
145
- ]
145
+ }
146
+ ];
146
147
 
147
- testData.forEach(({title, input, output}) => {
148
- it(`special input - ${title}`, function() {
148
+ testData.forEach(({ title, input, output }) => {
149
+ it(`special input - ${title}`, function () {
149
150
  const masked = maskData.maskPassword(input, maskOptions);
150
151
  expect(masked).to.equal(output, 'masked output does not match expected value');
151
152
  });
152
153
  });
153
154
  });
154
155
 
155
- describe('Mask with object type input - input won\'t be masked', function() {
156
-
156
+ describe("Mask with object type input - input won't be masked", function () {
157
157
  let testData = [
158
158
  {
159
159
  title: 'test input as array',
@@ -162,15 +162,15 @@ describe('Masking password', function() {
162
162
  },
163
163
  {
164
164
  title: 'test input as object',
165
- input: {a: 'b', x: 'y'},
166
- output: {a: 'b', x: 'y'}
165
+ input: { a: 'b', x: 'y' },
166
+ output: { a: 'b', x: 'y' }
167
167
  }
168
- ]
168
+ ];
169
169
 
170
- testData.forEach(({title, input, output}) => {
171
- it(`special input - ${title}`, function() {
170
+ testData.forEach(({ title, input, output }) => {
171
+ it(`special input - ${title}`, function () {
172
172
  const masked = maskData.maskPassword(input, maskOptions);
173
- expect(masked).to.equal(input, 'input won\'t be masked');
173
+ expect(masked).to.equal(input, "input won't be masked");
174
174
  });
175
175
  });
176
176
  });