Socket
Socket
Sign inDemoInstall

gcp_cloud_vision_lines

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.5 to 1.0.6

7

package.json
{
"name": "gcp_cloud_vision_lines",
"version": "1.0.5",
"version": "1.0.6",
"description": "This utility breaks down a full text annotation response from the Google cloud vision API into a neatly parsed Array with each element representing a single line of text, with coords and height and width dimensions.",

@@ -28,3 +28,6 @@ "main": "src/index.js",

},
"homepage": "https://github.com/craig-coles/GCP_cloud_vision_lines#readme"
"homepage": "https://github.com/craig-coles/GCP_cloud_vision_lines#readme",
"dependencies": {
"array-flatten": "^2.1.2"
}
}

@@ -7,14 +7,31 @@ const arrayFlatten = require("array-flatten");

function pipe(...fns) {
return x => {
return fns.reduce((v, f) => {
return f(v);
}, x);
};
}
exports = module.exports = { cloudVisionLines };
function cloudVisionLines(fullTextAnnotation) {
const wordsObjects = buildWordObjectsFromSymbols(
getWordsFromParagraphs(
getParagraphsFromTextBlocks(getBlocksFromTextObj(fullTextAnnotation))
)
// const wordsObjects = buildWordObjectsFromSymbols(
// getWordsFromParagraphs(
// getParagraphsFromTextBlocks(getBlocksFromTextObj(fullTextAnnotation))
// )
// );
// const lines = buildLinesFromWordObjects(wordsObjects);
const lineObjects = pipe(
getBlocksFromTextObj,
getParagraphsFromTextBlocks,
getWordsFromParagraphs,
buildWordObjectsFromSymbols,
buildLinesFromWordObjects
);
const lines = buildLinesFromWordObjects(wordsObjects);
return lines;
//return lines;
return lineObjects(fullTextAnnotation);
}

@@ -21,0 +38,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc