mirror of
https://github.com/xfarrow/blink
synced 2025-06-27 09:03:02 +02:00
Change endpoint from persons to people
This commit is contained in:
22
backend/apis/nodejs/node_modules/prompts/lib/util/clear.js
generated
vendored
Normal file
22
backend/apis/nodejs/node_modules/prompts/lib/util/clear.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
const strip = require('./strip');
|
||||
const { erase, cursor } = require('sisteransi');
|
||||
|
||||
const width = str => [...strip(str)].length;
|
||||
|
||||
/**
|
||||
* @param {string} prompt
|
||||
* @param {number} perLine
|
||||
*/
|
||||
module.exports = function(prompt, perLine) {
|
||||
if (!perLine) return erase.line + cursor.to(0);
|
||||
|
||||
let rows = 0;
|
||||
const lines = prompt.split(/\r?\n/);
|
||||
for (let line of lines) {
|
||||
rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);
|
||||
}
|
||||
|
||||
return erase.lines(rows);
|
||||
};
|
Reference in New Issue
Block a user