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

Function transformCLI

dlp/inspectDatastore.js:176–200  ·  view source on GitHub ↗
(infoTypes, customInfoTypes)

Source from the content-addressed store, hash-verified

174});
175
176function transformCLI(infoTypes, customInfoTypes) {
177 infoTypes = infoTypes
178 ? infoTypes.split(',').map(type => {
179 return {name: type};
180 })
181 : undefined;
182
183 if (customInfoTypes) {
184 customInfoTypes = customInfoTypes.includes(',')
185 ? customInfoTypes.split(',').map((dict, idx) => {
186 return {
187 infoType: {name: 'CUSTOM_DICT_'.concat(idx.toString())},
188 dictionary: {wordList: {words: dict.split(',')}},
189 };
190 })
191 : customInfoTypes.split(',').map((rgx, idx) => {
192 return {
193 infoType: {name: 'CUSTOM_REGEX_'.concat(idx.toString())},
194 regex: {pattern: rgx},
195 };
196 });
197 }
198
199 return [infoTypes, customInfoTypes];
200}
201
202module.exports = main;

Callers 1

mainFunction · 0.70

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected