CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
style.js51 linesDownload Raw Back to util
1'use strict';2 3const c = require('kleur');4 5const figures = require('./figures'); // rendering user input.6 7 8const styles = Object.freeze({9  password: {10    scale: 1,11    render: input => '*'.repeat(input.length)12  },13  emoji: {14    scale: 2,15    render: input => '๐Ÿ˜ƒ'.repeat(input.length)16  },17  invisible: {18    scale: 0,19    render: input => ''20  },21  default: {22    scale: 1,23    render: input => `${input}`24  }25});26 27const render = type => styles[type] || styles.default; // icon to signalize a prompt.28 29 30const symbols = Object.freeze({31  aborted: c.red(figures.cross),32  done: c.green(figures.tick),33  exited: c.yellow(figures.cross),34  default: c.cyan('?')35});36 37const symbol = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default; // between the question and the user's input.38 39 40const delimiter = completing => c.gray(completing ? figures.ellipsis : figures.pointerSmall);41 42const item = (expandable, expanded) => c.gray(expandable ? expanded ? figures.pointerSmall : '+' : figures.line);43 44module.exports = {45  styles,46  render,47  symbols,48  symbol,49  delimiter,50  item51};
basant307/AI_Governance_Project ยท CoolFace