MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / transformCLI

Function transformCLI

dlp/inspectStringRep.js:113–137  ·  view source on GitHub ↗
(infoTypes, customInfoTypes)

Source from the content-addressed store, hash-verified

111});
112
113function transformCLI(infoTypes, customInfoTypes) {
114 infoTypes = infoTypes
115 ? infoTypes.split(',').map(type => {
116 return {name: type};
117 })
118 : undefined;
119
120 if (customInfoTypes) {
121 customInfoTypes = customInfoTypes.includes(',')
122 ? customInfoTypes.split(',').map((dict, idx) => {
123 return {
124 infoType: {name: 'CUSTOM_DICT_'.concat(idx.toString())},
125 dictionary: {wordList: {words: dict.split(',')}},
126 };
127 })
128 : customInfoTypes.split(',').map((rgx, idx) => {
129 return {
130 infoType: {name: 'CUSTOM_REGEX_'.concat(idx.toString())},
131 regex: {pattern: rgx},
132 };
133 });
134 }
135
136 return [infoTypes, customInfoTypes];
137}

Callers 1

mainFunction · 0.70

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected