@clerc/utils 0.28.1 → 0.29.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 +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _clerc_core from '@clerc/core';
|
|
2
|
-
import { Command } from '@clerc/core';
|
|
2
|
+
import { Command, I18N } from '@clerc/core';
|
|
3
3
|
|
|
4
4
|
type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;
|
|
5
5
|
type Dict<T> = Record<string, T>;
|
|
@@ -21,6 +21,6 @@ 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
23
|
declare const generateCommandRecordFromCommandArray: <C extends Command<string, _clerc_core.CommandOptions<string[], MaybeArray<string | typeof _clerc_core.Root>, _clerc_core.Flags>>>(commands: C[]) => Dict<C>;
|
|
24
|
-
declare const semanticArray: (arr: string[]) => string;
|
|
24
|
+
declare const semanticArray: (arr: string[], { add, t }: I18N) => string;
|
|
25
25
|
|
|
26
26
|
export { CamelCase, Dict, Enhance, Equals, GetLength, GetTail, KebabCase, MaybeArray, ToArray, arrayEquals, arrayStartsWith, camelCase, generateCommandRecordFromCommandArray, gracefulFlagName, gracefulVersion, kebabCase, semanticArray, toArray };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a=e=>Array.isArray(e)?e:[e],c=e=>e.replace(/[-_ ](\w)/g,(t
|
|
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 generateCommandRecordFromCommandArray,g as gracefulFlagName,i as gracefulVersion,s as kebabCase,m as semanticArray,l as toArray};
|