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

Method documentIsProcessed

vision/textDetection.js:109–120  ·  view source on GitHub ↗

* Check to see if a Document is already stored in redis. * @param {string} filename * @returns {Promise }

(filename)

Source from the content-addressed store, hash-verified

107 * @returns {Promise<boolean>}
108 */
109 async documentIsProcessed(filename) {
110 const value = await this.docsClient.get(filename);
111 if (value) {
112 console.log(`${filename} already added to index.`);
113 return true;
114 }
115 if (value === '') {
116 console.log(`${filename} was already checked, and contains no text.`);
117 return true;
118 }
119 return false;
120 }
121
122 /**
123 * Updates a given doc to have no text in redis.

Callers 1

mainFunction · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected