Socket
Socket
Sign inDemoInstall

break-styled-lines

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

break-styled-lines - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

14

dist-src/break-lines.js

@@ -20,3 +20,3 @@ function isArray(text) {

}, { indexToInsertInto: 0, localPosition: 0, lengthOfPreceding: 0 });
return arrayOfStrings
return (arrayOfStrings
.map((string, i) => {

@@ -28,14 +28,18 @@ if (i === indexToInsertInto) {

})
// This is to remove whitespace adjacent to newlines, but to preserve starting or trailing whitespace
.map(string => string
.split("\n")
.map((str, i, strs) => {
if (i === 0 && strs.length > 1) {
if (i < strs.length - 2 && i > 0) {
return str.trim();
}
if (i < strs.length - 2) {
return str.trimRight();
}
else if (i === strs.length - 1) {
else if (i > 0) {
return str.trimLeft();
}
return str.trim();
return str;
})
.join("\n"));
.join("\n")));
}

@@ -42,0 +46,0 @@ function breakLines(text, width, font) {

@@ -20,3 +20,3 @@ function isArray(text) {

}, { indexToInsertInto: 0, localPosition: 0, lengthOfPreceding: 0 });
return arrayOfStrings
return (arrayOfStrings
.map((string, i) => {

@@ -28,14 +28,18 @@ if (i === indexToInsertInto) {

})
// This is to remove whitespace adjacent to newlines, but to preserve starting or trailing whitespace
.map(string => string
.split("\n")
.map((str, i, strs) => {
if (i === 0 && strs.length > 1) {
if (i < strs.length - 2 && i > 0) {
return str.trim();
}
if (i < strs.length - 2) {
return str.trimRight();
}
else if (i === strs.length - 1) {
else if (i > 0) {
return str.trimLeft();
}
return str.trim();
return str;
})
.join("\n"));
.join("\n")));
}

@@ -42,0 +46,0 @@ function breakLines(text, width, font) {

{
"name": "break-styled-lines",
"description": "Add newlines to a string of text given a font style and width",
"version": "1.1.1",
"version": "1.1.2",
"license": "MIT",

@@ -6,0 +6,0 @@ "files": [

Sorry, the diff of this file is not supported yet

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