@sap/generator-fiori
Version:
Create an SAPUI5 application using SAP Fiori elements or a freestyle approach
3 lines (2 loc) • 1.31 kB
JavaScript
const __esmImportMetaUrl = require('node:url').pathToFileURL(__filename).href;
;var y=Object.defineProperty;var u=(f,t)=>y(f,"name",{value:t,configurable:!0});var g=u((f,t)=>f.some(s=>s instanceof RegExp?s.test(t):s===t),"match"),A=u((f,t)=>{let s=[],c=[],n=[];t={useEquals:!0,shortFlag:!0,...t};let l=u((e,r)=>{let a=t.shortFlag&&e.length===1?"-":"--",i=t.allowCamelCase?e:e.replace(/[A-Z]/g,"-$&").toLowerCase();e=a+i,t.useEquals?s.push(e+(r?`=${r}`:"")):(s.push(e),r&&s.push(r))},"makeArguments"),o=u((e,r)=>{s.push(`-${e}`),r&&s.push(r)},"makeAliasArg");for(let[e,r]of Object.entries(f)){let a=l;if(!(Array.isArray(t.excludes)&&g(t.excludes,e))&&!(Array.isArray(t.includes)&&!g(t.includes,e))){if(typeof t.aliases=="object"&&t.aliases[e]&&(e=t.aliases[e],a=o),e==="--"){if(!Array.isArray(r))throw new TypeError(`Expected key \`--\` to be Array, got ${typeof r}`);n=r;continue}if(e==="_"){if(!Array.isArray(r))throw new TypeError(`Expected key \`_\` to be Array, got ${typeof r}`);c=r;continue}if(r===!0&&a(e,""),r===!1&&!t.ignoreFalse&&a(`no-${e}`),typeof r=="string"&&a(e,r),typeof r=="number"&&!Number.isNaN(r)&&a(e,String(r)),Array.isArray(r))for(let i of r)a(e,i)}}for(let e of c)s.push(String(e));n.length>0&&s.push("--");for(let e of n)s.push(String(e));return s},"dargs");module.exports=A;