mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
lint: fix inconsistent callback function parameter names (#730)
* Fix linting * Use is.ElementsMatch This will ignore the ordering of the final intersection. Especially important when checking old versions of go that do not guarantee an order when iterating through maps. * lint: fix inconsistent callback function parameter names * lint: rename "iteratee" to "transform" for *Map helpers * lint: rename "project" parameters to "transform" * lint: rename "cb" parameters to "callback" * lint: rename "iteratee" to "callback" for ForEach helpers --------- Co-authored-by: Franky W. <frankywahl@users.noreply.github.com> Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
This commit is contained in:
@@ -16,7 +16,7 @@ export default function HelperCard({
|
||||
// Extract function name from signature for godoc link
|
||||
const functionName = useMemo(() => {
|
||||
if (!helper.signatures) return '';
|
||||
// Extract function name from signature like "func Map[T any, R any](collection []T, iteratee func(T, int) R) []R"
|
||||
// Extract function name from signature like "func Map[T any, R any](collection []T, transform func(T, int) R) []R"
|
||||
const match = helper.signatures.find(signature => signature.match(/func\s+(\w+)/))?.match(/func\s+(\w+)/);
|
||||
return match ? match[1] : '';
|
||||
}, [helper.signatures]);
|
||||
|
||||
Reference in New Issue
Block a user