@commercelayer/cli-core
Advanced tools
Comparing version 4.4.0 to 4.5.0
@@ -20,2 +20,3 @@ /** Copy command flags excluding a subset */ | ||
} | undefined; | ||
export { fixValueType, findLongStringFlag }; | ||
declare const fixDashedFlagValue: (argv: string[], flag: any, name?: string) => string[]; | ||
export { fixValueType, findLongStringFlag, fixDashedFlagValue }; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.findLongStringFlag=exports.fixValueType=exports.commandFlags=void 0;const commandFlags=(t,e)=>{const l=Object.assign({},t);if(e)for(const s of e)delete l[s];return l};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 l=e.startsWith("--")?e:`--${e}`;let s;const n=t.findIndex(r=>r.startsWith(l));let i=!1;if(n>-1){const r=t[n];if(r.includes("=")){const o=r.split("=");s=o.length===2?o[1]:"",i=!0}else s=t[n+1];return{value:s,index:n,single:i}}else return};exports.findLongStringFlag=findLongStringFlag; | ||
"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 l of e)delete f[l];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 l;const n=t.findIndex(s=>s.startsWith(f));let a=!1;if(n>-1){const s=t[n];if(s.includes("=")){const r=s.split("=");l=r.length===2?r[1]:"",a=!0}else l=t[n+1];return{value:l,index:n,single:a}}else return};exports.findLongStringFlag=findLongStringFlag;const fixDashedFlagValue=(t,e,f)=>{const l="____",n=e.name||f,a=e.char;if(!n&&!a)return t;const s=n?n.startsWith("--")?n:`--${n}`:void 0,r=a?e.char.startsWith("-")?a:`-${a}`:void 0;let c=t.findIndex(d=>r&&d.startsWith(r)||s&&d.startsWith(s));if(c<0)return t;let o=t[c],i="",u="";if(r&&o.startsWith(r))i=o.replace(r,"").trim(),o=r;else if(s&&o.startsWith(s))i=o.replace(s,"").trim(),o=s;else return t;i.startsWith("=")?(i=i.slice(1),u=o+"="):i=t[++c];const p=i.startsWith(`${l}-`)?i.replace(`${l}-`,"-"):i.replace("-",`${l}-`);return t[c]=u+p,t};exports.fixDashedFlagValue=fixDashedFlagValue; |
@@ -20,2 +20,3 @@ /** Copy command flags excluding a subset */ | ||
} | undefined; | ||
export { fixValueType, findLongStringFlag }; | ||
declare const fixDashedFlagValue: (argv: string[], flag: any, name?: string) => string[]; | ||
export { fixValueType, findLongStringFlag, fixDashedFlagValue }; |
@@ -1,1 +0,1 @@ | ||
const o=(t,e)=>{const n=Object.assign({},t);if(e)for(const l of e)delete n[l];return n};export{o as commandFlags};const u=t=>{let e=t;return e==="null"?e=null:Number(e)==e?e=Number(e):e=e==="true"?!0:e==="false"?!1:e,e},a=(t,e)=>{const n=e.startsWith("--")?e:`--${e}`;let l;const s=t.findIndex(i=>i.startsWith(n));let r=!1;if(s>-1){const i=t[s];if(i.includes("=")){const f=i.split("=");l=f.length===2?f[1]:"",r=!0}else l=t[s+1];return{value:l,index:s,single:r}}else return};export{u as fixValueType,a as findLongStringFlag}; | ||
const W=(e,t)=>{const a=Object.assign({},e);if(t)for(const l of t)delete a[l];return a};export{W as commandFlags};const p=e=>{let t=e;return t==="null"?t=null:Number(t)==t?t=Number(t):t=t==="true"?!0:t==="false"?!1:t,t},x=(e,t)=>{const a=t.startsWith("--")?t:`--${t}`;let l;const n=e.findIndex(s=>s.startsWith(a));let c=!1;if(n>-1){const s=e[n];if(s.includes("=")){const i=s.split("=");l=i.length===2?i[1]:"",c=!0}else l=e[n+1];return{value:l,index:n,single:c}}else return},_=(e,t,a)=>{const l="____",n=t.name||a,c=t.char;if(!n&&!c)return e;const s=n?n.startsWith("--")?n:`--${n}`:void 0,i=c?t.char.startsWith("-")?c:`-${c}`:void 0;let u=e.findIndex(d=>i&&d.startsWith(i)||s&&d.startsWith(s));if(u<0)return e;let f=e[u],r="",o="";if(i&&f.startsWith(i))r=f.replace(i,"").trim(),f=i;else if(s&&f.startsWith(s))r=f.replace(s,"").trim(),f=s;else return e;r.startsWith("=")?(r=r.slice(1),o=f+"="):r=e[++u];const h=r.startsWith(`${l}-`)?r.replace(`${l}-`,"-"):r.replace("-",`${l}-`);return e[u]=o+h,e};export{p as fixValueType,x as findLongStringFlag,_ as fixDashedFlagValue}; |
{ | ||
"name": "@commercelayer/cli-core", | ||
"version": "4.4.0", | ||
"version": "4.5.0", | ||
"main": "lib/cjs/index.js", | ||
@@ -5,0 +5,0 @@ "types": "lib/cjs/index.d.ts", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
193930
983
2