New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@react-pdf/textkit

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-pdf/textkit - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

39

layout/typesetter.js

@@ -26,2 +26,38 @@ "use strict";

/**
* Slice block at given height
*
* @param {number} height
* @param {Object} paragraph block
* @return {number} sliced paragraph block
*/
var sliceBlockAtHeight = function sliceBlockAtHeight(height, block) {
var newBlock = [];
var counter = 0;
for (var _iterator = block, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var line = _ref;
counter += line.box.height;
if (counter < height) {
newBlock.push(line);
} else {
break;
}
}
return newBlock;
};
/**
* Layout paragraphs inside container until it does not

@@ -37,2 +73,3 @@ * fit anymore, performing line wrapping in the process.

var typesetter = function typesetter(engines, options, container, attributedStrings) {

@@ -53,3 +90,3 @@ var blocks = [];

} else {
paragraphs.unshift(nextParagraph);
blocks.push(sliceBlockAtHeight(paragraphRect.height, block));
break;

@@ -56,0 +93,0 @@ }

2

package.json
{
"name": "@react-pdf/textkit",
"version": "0.3.2",
"version": "0.3.3",
"description": "An advanced text layout framework",

@@ -5,0 +5,0 @@ "main": "./index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc