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

Function transformCLI

dlp/inspectBigQuery.js:173–197  ·  view source on GitHub ↗
(infoTypes, customInfoTypes)

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected