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

Function transformCLI

dlp/inspectGCSFile.js:165–189  ·  view source on GitHub ↗
(infoTypes, customInfoTypes)

Source from the content-addressed store, hash-verified

163});
164
165function transformCLI(infoTypes, customInfoTypes) {
166 infoTypes = infoTypes
167 ? infoTypes.split(',').map(type => {
168 return {name: type};
169 })
170 : undefined;
171
172 if (customInfoTypes) {
173 customInfoTypes = customInfoTypes.includes(',')
174 ? customInfoTypes.split(',').map((dict, idx) => {
175 return {
176 infoType: {name: 'CUSTOM_DICT_'.concat(idx.toString())},
177 dictionary: {wordList: {words: dict.split(',')}},
178 };
179 })
180 : customInfoTypes.split(',').map((rgx, idx) => {
181 return {
182 infoType: {name: 'CUSTOM_REGEX_'.concat(idx.toString())},
183 regex: {pattern: rgx},
184 };
185 });
186 }
187
188 return [infoTypes, customInfoTypes];
189}
190
191module.exports = main;

Callers 1

mainFunction · 0.70

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected