Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

terminal-paginator

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terminal-paginator - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

18

index.js

@@ -16,3 +16,6 @@ 'use strict';

this.options = options || {};
this.footer = this.options.footer || '(Move up and down to reveal more choices)';
this.footer = this.options.footer;
if (typeof this.footer !== 'string') {
this.footer = '(Move up and down to reveal more choices)';
}
this.firstRender = true;

@@ -39,3 +42,3 @@ this.lastIndex = 0;

// Return if we don't have enough visible lines to paginate
if (lines.length <= limit) {
if (lines.length <= limit || opts.paginate === false) {
return output;

@@ -56,14 +59,13 @@ }

this.lastIndex = pos;
if (opts.filterList === true) {
lines = lines.filter(Boolean);
}
// Duplicate lines to create the illusion of an infinite list
var infinite = lines.concat(lines).concat(lines);
if (opts.filterList !== false) {
infinite = infinite.filter(Boolean);
}
var topIndex = Math.max(0, pos + lines.length - this.position);
// Create the visible list based on the limit and current cursor position
var visible = infinite.splice(topIndex, limit);
visible = visible.join('\n');
var visible = infinite.splice(topIndex, limit).join('\n');
if (this.footer) {

@@ -70,0 +72,0 @@ visible += '\n';

{
"name": "terminal-paginator",
"description": "Paginator used for rendering lists or choices for prompts in the terminal.",
"version": "2.0.0",
"version": "2.0.1",
"homepage": "https://github.com/enquirer/terminal-paginator",

@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

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