@clerc/utils 0.30.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare const gracefulFlagName: (n: string) => string;
|
|
|
20
20
|
declare const gracefulVersion: (v: string) => string;
|
|
21
21
|
declare const arrayEquals: <T>(arr1: T[], arr2: T[]) => boolean;
|
|
22
22
|
declare const arrayStartsWith: <T>(arr: T[], start: T[]) => boolean;
|
|
23
|
-
declare const
|
|
23
|
+
declare const generateCommandsFromCommandArray: <C extends Command<string, _clerc_core.CommandOptions<string[], MaybeArray<string | typeof _clerc_core.Root>, _clerc_core.Flags>>>(commands: C[]) => Dict<C>;
|
|
24
24
|
declare const semanticArray: (arr: string[], { add, t }: I18N) => string;
|
|
25
25
|
|
|
26
|
-
export { CamelCase, Dict, Enhance, Equals, GetLength, GetTail, KebabCase, MaybeArray, ToArray, arrayEquals, arrayStartsWith, camelCase,
|
|
26
|
+
export { CamelCase, Dict, Enhance, Equals, GetLength, GetTail, KebabCase, MaybeArray, ToArray, arrayEquals, arrayStartsWith, camelCase, generateCommandsFromCommandArray, gracefulFlagName, gracefulVersion, kebabCase, semanticArray, toArray };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},l=e=>Array.isArray(e)?e:[e],c=e=>e.replace(/[-_ ](\w)/g,(n,t)=>t.toUpperCase()),s=e=>e.replace(/([A-Z])/g,(n,t)=>`-${t.toLowerCase()}`),g=e=>e.length<=1?`-${e}`:`--${s(e)}`,i=e=>e.length===0?"":e.startsWith("v")?e:`v${e}`,r=(e,n)=>n.length!==e.length?!1:e.every((t,o)=>t===n[o]),u=(e,n)=>n.length>e.length?!1:r(e.slice(0,n.length),n),h=e=>{const n={};for(const t of e)n[t.name]=t;return n},m=(e,{add:n,t})=>(n(a),e.length<=1?e[0]:t("utils.and",e.slice(0,-1).join(", "),e[e.length-1]));export{r as arrayEquals,u as arrayStartsWith,c as camelCase,h as
|
|
1
|
+
const a={en:{"utils.and":"%s and %s"},"zh-CN":{"utils.and":"%s \u548C %s"}},l=e=>Array.isArray(e)?e:[e],c=e=>e.replace(/[-_ ](\w)/g,(n,t)=>t.toUpperCase()),s=e=>e.replace(/([A-Z])/g,(n,t)=>`-${t.toLowerCase()}`),g=e=>e.length<=1?`-${e}`:`--${s(e)}`,i=e=>e.length===0?"":e.startsWith("v")?e:`v${e}`,r=(e,n)=>n.length!==e.length?!1:e.every((t,o)=>t===n[o]),u=(e,n)=>n.length>e.length?!1:r(e.slice(0,n.length),n),h=e=>{const n={};for(const t of e)n[t.name]=t;return n},m=(e,{add:n,t})=>(n(a),e.length<=1?e[0]:t("utils.and",e.slice(0,-1).join(", "),e[e.length-1]));export{r as arrayEquals,u as arrayStartsWith,c as camelCase,h as generateCommandsFromCommandArray,g as gracefulFlagName,i as gracefulVersion,s as kebabCase,m as semanticArray,l as toArray};
|
package/package.json
CHANGED