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

pinpoint

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pinpoint - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

16

lib/pinpoint.js

@@ -6,2 +6,3 @@ module.exports = pinpoint;

var showLines = options.showLines || 9;
var tabSize = options.tabSize || 4;
var indent = options.indent || '';

@@ -13,2 +14,3 @@ var line = options.line - 1;

var length = lines.length;
var tabSpaces = repeat(' ', tabSize);

@@ -30,8 +32,16 @@ var start = line;

var maxDigits = end.toString().length;
var tabCount = 0;
var pointedLine = line - start;
lines = lines.slice(start, end).map(function (line, i) {
if (i === pointedLine) {
var pos = 0;
while (pos = 1 + line.indexOf('\t', pos)) {
if (pos <= column) ++tabCount;
}
}
i += start + 1;
return pad(i, maxDigits) + '| ' + line;
return pad(i, maxDigits) + '| ' + line.replace(/\t/g, tabSpaces);;
});
var arrowLine = repeat('-', maxDigits + 2 + column) + '^';
lines.splice(line - start + 1, 0, arrowLine);
var arrowLine = repeat('-', maxDigits + 2 + column + tabCount * (tabSize - 1)) + '^';
lines.splice(pointedLine + 1, 0, arrowLine);

@@ -38,0 +48,0 @@ return indent + lines.join('\n' + indent)

2

package.json
{
"name": "pinpoint",
"version": "1.0.0",
"version": "1.1.0",
"description": "Display an arrow in a string of code to point to a location",

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

@@ -44,2 +44,3 @@ # pinpoint

* `showLines` - the number of lines to show. The pointed line will try to stay in the middle of the displays lines.
* `indent` - indent string prepend to each line, before the line number.
* `indent` - indent string prepend to each line, before the line number.
* `tabSize` - width of a tab character.

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