@clerc/utils
Advanced tools
Comparing version 0.10.4 to 0.10.5
@@ -28,4 +28,4 @@ import * as _clerc_core from '@clerc/core'; | ||
declare const gracefulVersion: (v: string) => string; | ||
declare const arrayEquals: <T>(arr1: T[], arr2: T[]) => boolean; | ||
declare const arrayStartsWith: <T>(arr: T[], start: T[]) => boolean; | ||
declare const arrayEquals: <T>(arr1: T[], arr2: T[]) => boolean; | ||
declare const generateCommandRecordFromCommandArray: <C extends Command<string, _clerc_core.CommandOptions<string[], MaybeArray<string>, Dict<_clerc_core.FlagOptions>>>>(commands: C[]) => Dict<C>; | ||
@@ -32,0 +32,0 @@ declare const semanticArray: (arr: string[]) => string; |
@@ -6,8 +6,2 @@ const mustArray = (a) => Array.isArray(a) ? a : [a]; | ||
const gracefulVersion = (v) => v.length === 0 ? "" : v.startsWith("v") ? v : `v${v}`; | ||
const arrayStartsWith = (arr, start) => { | ||
if (start.length > arr.length) { | ||
return false; | ||
} | ||
return arr.slice(0, start.length).every((item, i) => item === start[i]); | ||
}; | ||
const arrayEquals = (arr1, arr2) => { | ||
@@ -19,2 +13,8 @@ if (arr2.length !== arr1.length) { | ||
}; | ||
const arrayStartsWith = (arr, start) => { | ||
if (start.length > arr.length) { | ||
return false; | ||
} | ||
return arrayEquals(arr.slice(0, start.length), start); | ||
}; | ||
const generateCommandRecordFromCommandArray = (commands) => { | ||
@@ -21,0 +21,0 @@ const record = {}; |
{ | ||
"name": "@clerc/utils", | ||
"version": "0.10.4", | ||
"version": "0.10.5", | ||
"author": "Ray <nn_201312@163.com> (https://github.com/so1ve)", | ||
@@ -5,0 +5,0 @@ "description": "Clerc utils", |
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
6596