Socket
Socket
Sign inDemoInstall

loupe

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loupe - npm Package Compare versions

Comparing version 3.1.0 to 3.1.1

9

lib/helpers.js

@@ -71,2 +71,5 @@ const ansiColors = {

}
function isHighSurrogate(char) {
return char >= '\ud800' && char <= '\udbff';
}
export function truncate(string, length, tail = truncator) {

@@ -80,3 +83,7 @@ string = String(string);

if (stringLength > length && stringLength > tailLength) {
return `${string.slice(0, length - tailLength)}${tail}`;
let end = length - tailLength;
if (end > 0 && isHighSurrogate(string[end - 1])) {
end = end - 1;
}
return `${string.slice(0, end)}${tail}`;
}

@@ -83,0 +90,0 @@ return string;

@@ -121,2 +121,5 @@ "use strict";

}
function isHighSurrogate(char) {
return char >= "\uD800" && char <= "\uDBFF";
}
function truncate(string, length, tail = truncator) {

@@ -130,3 +133,7 @@ string = String(string);

if (stringLength > length && stringLength > tailLength) {
return `${string.slice(0, length - tailLength)}${tail}`;
let end = length - tailLength;
if (end > 0 && isHighSurrogate(string[end - 1])) {
end = end - 1;
}
return `${string.slice(0, end)}${tail}`;
}

@@ -133,0 +140,0 @@ return string;

2

package.json
{
"name": "loupe",
"version": "3.1.0",
"version": "3.1.1",
"description": "Inspect utility for Node.js and browsers",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/chaijs/loupe",

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