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

Function redactText

dlp/redactText.js:40–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 };
39
40 async function redactText() {
41 // Construct redaction request
42 const request = {
43 parent: `projects/${projectId}/locations/global`,
44 item: {
45 value: string,
46 },
47 deidentifyConfig: {
48 infoTypeTransformations: {
49 transformations: [replaceWithInfoTypeTransformation],
50 },
51 },
52 inspectConfig: {
53 minLikelihood: minLikelihood,
54 infoTypes: infoTypes,
55 },
56 };
57
58 // Run string redaction
59 const [response] = await dlp.deidentifyContent(request);
60 const resultString = response.item.value;
61 console.log(`Redacted text: ${resultString}`);
62 }
63 redactText();
64 // [END dlp_redact_text]
65}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected