UNPKG

@sap/generator-fiori

Version:

Create an SAPUI5 application using SAP Fiori elements or a freestyle approach

3 lines (2 loc) 2.08 kB
const __esmImportMetaUrl = require('node:url').pathToFileURL(__filename).href; "use strict";var f=Object.defineProperty;var a=(e,n)=>f(e,"name",{value:n,configurable:!0});var r=module.exports;module.exports.default=r;var t="\x1B[",o="\x1B]",s="\x07",c=";",d=process.env.TERM_PROGRAM==="Apple_Terminal";r.cursorTo=(e,n)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof n!="number"?t+(e+1)+"G":t+(n+1)+";"+(e+1)+"H"};r.cursorMove=(e,n)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let i="";return e<0?i+=t+-e+"D":e>0&&(i+=t+e+"C"),n<0?i+=t+-n+"A":n>0&&(i+=t+n+"B"),i};r.cursorUp=(e=1)=>t+e+"A";r.cursorDown=(e=1)=>t+e+"B";r.cursorForward=(e=1)=>t+e+"C";r.cursorBackward=(e=1)=>t+e+"D";r.cursorLeft=t+"G";r.cursorSavePosition=d?"\x1B7":t+"s";r.cursorRestorePosition=d?"\x1B8":t+"u";r.cursorGetPosition=t+"6n";r.cursorNextLine=t+"E";r.cursorPrevLine=t+"F";r.cursorHide=t+"?25l";r.cursorShow=t+"?25h";r.eraseLines=e=>{let n="";for(let i=0;i<e;i++)n+=r.eraseLine+(i<e-1?r.cursorUp():"");return e&&(n+=r.cursorLeft),n};r.eraseEndLine=t+"K";r.eraseStartLine=t+"1K";r.eraseLine=t+"2K";r.eraseDown=t+"J";r.eraseUp=t+"1J";r.eraseScreen=t+"2J";r.scrollUp=t+"S";r.scrollDown=t+"T";r.clearScreen="\x1Bc";r.clearTerminal=process.platform==="win32"?`${r.eraseScreen}${t}0f`:`${r.eraseScreen}${t}3J${t}H`;r.beep=s;r.link=(e,n)=>[o,"8",c,c,n,s,e,o,"8",c,c,s].join("");r.image=(e,n={})=>{let i=`${o}1337;File=inline=1`;return n.width&&(i+=`;width=${n.width}`),n.height&&(i+=`;height=${n.height}`),n.preserveAspectRatio===!1&&(i+=";preserveAspectRatio=0"),i+":"+e.toString("base64")+s};r.iTerm={setCwd:a((e=process.cwd())=>`${o}50;CurrentDir=${e}${s}`,"setCwd"),annotation:a((e,n={})=>{let i=`${o}1337;`,u=typeof n.x<"u",l=typeof n.y<"u";if((u||l)&&!(u&&l&&typeof n.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),i+=n.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",n.length>0?i+=(u?[e,n.length,n.x,n.y]:[n.length,e]).join("|"):i+=e,i+s},"annotation")};