@clerc/utils 0.18.0 → 0.20.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.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const toArray = (a) => Array.isArray(a) ? a : [a];
|
|
2
2
|
const camelCase = (s) => s.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
3
3
|
const kebabCase = (s) => s.replace(/([A-Z])/g, (_, c) => `-${c.toLowerCase()}`);
|
|
4
|
-
const gracefulFlagName = (n) => n.length <= 1 ? `-${n}` : `--${n}`;
|
|
4
|
+
const gracefulFlagName = (n) => n.length <= 1 ? `-${n}` : `--${kebabCase(n)}`;
|
|
5
5
|
const gracefulVersion = (v) => v.length === 0 ? "" : v.startsWith("v") ? v : `v${v}`;
|
|
6
6
|
const arrayEquals = (arr1, arr2) => {
|
|
7
7
|
if (arr2.length !== arr1.length) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const toArray = (a) => Array.isArray(a) ? a : [a];
|
|
2
2
|
const camelCase = (s) => s.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
3
3
|
const kebabCase = (s) => s.replace(/([A-Z])/g, (_, c) => `-${c.toLowerCase()}`);
|
|
4
|
-
const gracefulFlagName = (n) => n.length <= 1 ? `-${n}` : `--${n}`;
|
|
4
|
+
const gracefulFlagName = (n) => n.length <= 1 ? `-${n}` : `--${kebabCase(n)}`;
|
|
5
5
|
const gracefulVersion = (v) => v.length === 0 ? "" : v.startsWith("v") ? v : `v${v}`;
|
|
6
6
|
const arrayEquals = (arr1, arr2) => {
|
|
7
7
|
if (arr2.length !== arr1.length) {
|