MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / maskData

Function maskData

lib/utils/mask_data.js:12–29  ·  view source on GitHub ↗
(input, config)

Source from the content-addressed store, hash-verified

10 * @returns {string} - Masked string
11 */
12export function maskData(input, config) {
13 if (!config) {
14 return input
15 }
16
17 // Handle boolean config (backward compatibility)
18 if (typeof config === 'boolean' && config === true) {
19 return maskSensitiveData(input)
20 }
21
22 // Handle object config with custom patterns
23 if (typeof config === 'object' && config.enabled === true) {
24 const customPatterns = config.patterns || []
25 return maskSensitiveData(input, customPatterns)
26 }
27
28 return input
29}
30
31/**
32 * Check if masking is enabled based on global configuration

Callers 6

debugFunction · 0.90
logFunction · 0.90
errorFunction · 0.90
successFunction · 0.90
stepFunction · 0.90
mask_data_test.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected