@commercelayer/cli-core
Advanced tools
Comparing version 4.5.1 to 4.5.2
@@ -20,3 +20,3 @@ /** Copy command flags excluding a subset */ | ||
} | undefined; | ||
declare const fixDashedFlagValue: (argv: string[], flag: any, name?: string) => string[]; | ||
declare const fixDashedFlagValue: (argv: string[], flag: any, name?: string, parsed?: any) => string[]; | ||
export { fixValueType, findLongStringFlag, fixDashedFlagValue }; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.fixDashedFlagValue=exports.findLongStringFlag=exports.fixValueType=exports.commandFlags=void 0;const commandFlags=(t,e)=>{const f=Object.assign({},t);if(e)for(const i of e)delete f[i];return f};exports.commandFlags=commandFlags;const fixValueType=t=>{let e=t;return e==="null"?e=null:Number(e)==e?e=Number(e):e=e==="true"?!0:e==="false"?!1:e,e};exports.fixValueType=fixValueType;const findLongStringFlag=(t,e)=>{const f=e.startsWith("--")?e:`--${e}`;let i;const l=t.findIndex(n=>n.startsWith(f));let a=!1;if(l>-1){const n=t[l];if(n.includes("=")){const r=n.split("=");i=r.length===2?r[1]:"",a=!0}else i=t[l+1];return{value:i,index:l,single:a}}else return};exports.findLongStringFlag=findLongStringFlag;const fixDashedFlagValue=(t,e,f)=>{const i="____",l=e.name||f,a=e.char;if(!l&&!a)return t;const n=l?l.startsWith("--")?l:`--${l}`:void 0,r=a?e.char.startsWith("-")?a:`-${a}`:void 0;let c=t.findIndex(u=>r&&u.startsWith(r)||n&&u.startsWith(n));if(c<0)return t;let o=t[c],s="",d="";if(r&&o.startsWith(r))s=o.replace(r,"").trim(),o=r;else if(n&&o.startsWith(n))s=o.replace(n,"").trim(),o=n;else return t;if(s.startsWith("=")?(s=s.slice(1),d=o+"="):s||(s=t[++c]),s.startsWith("-")||s.startsWith(i)){const u=s.startsWith(`${i}-`)?s.replace(`${i}-`,"-"):s.replace("-",`${i}-`);t[c]=d+u}return t};exports.fixDashedFlagValue=fixDashedFlagValue; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.fixDashedFlagValue=exports.findLongStringFlag=exports.fixValueType=exports.commandFlags=void 0;const commandFlags=(t,e)=>{const o=Object.assign({},t);if(e)for(const n of e)delete o[n];return o};exports.commandFlags=commandFlags;const fixValueType=t=>{let e=t;return e==="null"?e=null:Number(e)==e?e=Number(e):e=e==="true"?!0:e==="false"?!1:e,e};exports.fixValueType=fixValueType;const findLongStringFlag=(t,e)=>{const o=e.startsWith("--")?e:`--${e}`;let n;const i=t.findIndex(r=>r.startsWith(o));let l=!1;if(i>-1){const r=t[i];if(r.includes("=")){const a=r.split("=");n=a.length===2?a[1]:"",l=!0}else n=t[i+1];return{value:n,index:i,single:l}}else return};exports.findLongStringFlag=findLongStringFlag;const fixDashedFlagValue=(t,e,o,n)=>{const i="____",l=e.name||o,r=e.char;if(!l&&!r)return t;const a=l?l.startsWith("--")?l:`--${l}`:void 0,c=r?e.char.startsWith("-")?r:`-${r}`:void 0;let d=t.findIndex(u=>c&&u.startsWith(c)||a&&u.startsWith(a));if(d<0)return t;let f=t[d],s="",F="";if(c&&f.startsWith(c))s=f.replace(c,"").trim(),f=c;else if(a&&f.startsWith(a))s=f.replace(a,"").trim(),f=a;else return t;if(s.startsWith("=")?(s=s.slice(1),F=f+"="):s||(s=t[++d]),s.startsWith("-")||s.startsWith(i)){const u=s.startsWith(`${i}`)?s.replace(`${i}`,""):s.replace("-",`${i}-`);if(t[d]=F+u,s.startsWith(i)&&n){const p=l?l.replace("--",""):void 0,h=Object.entries(n.flags).find(([g,W])=>W===s);h&&(!p||p===h[0])&&(n.flags[h[0]]=u);const x=Object.values(n.raw).find(g=>g.type==="flag"&&g.input===s);x&&(!p||p===x.flag)&&(x.input=u)}}return t};exports.fixDashedFlagValue=fixDashedFlagValue; |
@@ -20,3 +20,3 @@ /** Copy command flags excluding a subset */ | ||
} | undefined; | ||
declare const fixDashedFlagValue: (argv: string[], flag: any, name?: string) => string[]; | ||
declare const fixDashedFlagValue: (argv: string[], flag: any, name?: string, parsed?: any) => string[]; | ||
export { fixValueType, findLongStringFlag, fixDashedFlagValue }; |
@@ -1,1 +0,1 @@ | ||
const h=(e,t)=>{const a=Object.assign({},e);if(t)for(const i of t)delete a[i];return a};export{h as commandFlags};const W=e=>{let t=e;return t==="null"?t=null:Number(t)==t?t=Number(t):t=t==="true"?!0:t==="false"?!1:t,t},p=(e,t)=>{const a=t.startsWith("--")?t:`--${t}`;let i;const l=e.findIndex(n=>n.startsWith(a));let c=!1;if(l>-1){const n=e[l];if(n.includes("=")){const r=n.split("=");i=r.length===2?r[1]:"",c=!0}else i=e[l+1];return{value:i,index:l,single:c}}else return},x=(e,t,a)=>{const i="____",l=t.name||a,c=t.char;if(!l&&!c)return e;const n=l?l.startsWith("--")?l:`--${l}`:void 0,r=c?t.char.startsWith("-")?c:`-${c}`:void 0;let u=e.findIndex(o=>r&&o.startsWith(r)||n&&o.startsWith(n));if(u<0)return e;let f=e[u],s="",d="";if(r&&f.startsWith(r))s=f.replace(r,"").trim(),f=r;else if(n&&f.startsWith(n))s=f.replace(n,"").trim(),f=n;else return e;if(s.startsWith("=")?(s=s.slice(1),d=f+"="):s||(s=e[++u]),s.startsWith("-")||s.startsWith(i)){const o=s.startsWith(`${i}-`)?s.replace(`${i}-`,"-"):s.replace("-",`${i}-`);e[u]=d+o}return e};export{W as fixValueType,p as findLongStringFlag,x as fixDashedFlagValue}; | ||
const F=(e,t)=>{const c=Object.assign({},e);if(t)for(const n of t)delete c[n];return c};export{F as commandFlags};const _=e=>{let t=e;return t==="null"?t=null:Number(t)==t?t=Number(t):t=t==="true"?!0:t==="false"?!1:t,t},$=(e,t)=>{const c=t.startsWith("--")?t:`--${t}`;let n;const i=e.findIndex(r=>r.startsWith(c));let l=!1;if(i>-1){const r=e[i];if(r.includes("=")){const a=r.split("=");n=a.length===2?a[1]:"",l=!0}else n=e[i+1];return{value:n,index:i,single:l}}else return},b=(e,t,c,n)=>{const i="____",l=t.name||c,r=t.char;if(!l&&!r)return e;const a=l?l.startsWith("--")?l:`--${l}`:void 0,u=r?t.char.startsWith("-")?r:`-${r}`:void 0;let d=e.findIndex(o=>u&&o.startsWith(u)||a&&o.startsWith(a));if(d<0)return e;let f=e[d],s="",g="";if(u&&f.startsWith(u))s=f.replace(u,"").trim(),f=u;else if(a&&f.startsWith(a))s=f.replace(a,"").trim(),f=a;else return e;if(s.startsWith("=")?(s=s.slice(1),g=f+"="):s||(s=e[++d]),s.startsWith("-")||s.startsWith(i)){const o=s.startsWith(`${i}`)?s.replace(`${i}`,""):s.replace("-",`${i}-`);if(e[d]=g+o,s.startsWith(i)&&n){const h=l?l.replace("--",""):void 0,W=Object.entries(n.flags).find(([x,m])=>m===s);W&&(!h||h===W[0])&&(n.flags[W[0]]=o);const p=Object.values(n.raw).find(x=>x.type==="flag"&&x.input===s);p&&(!h||h===p.flag)&&(p.input=o)}}return e};export{_ as fixValueType,$ as findLongStringFlag,b as fixDashedFlagValue}; |
{ | ||
"name": "@commercelayer/cli-core", | ||
"version": "4.5.1", | ||
"version": "4.5.2", | ||
"main": "lib/cjs/index.js", | ||
@@ -15,3 +15,3 @@ "types": "lib/cjs/index.d.ts", | ||
"test": "jest --passWithNoTests", | ||
"test-local": "ts-node test/token.ts", | ||
"test-local": "ts-node test/spot.ts", | ||
"coverage": "jest --coverage", | ||
@@ -18,0 +18,0 @@ "size": "size-limit", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
194531