Skip to content

Commit d4947f6

Browse files
committed
feat: add type annotations for plenary.fun
1 parent d6f74a9 commit d4947f6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lua/plenary/fun.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
---@class PlenaryFun
12
local M = {}
23

34
M.bind = require("plenary.functional").partial
45

6+
---@param fn fun(...)
7+
---@param argc integer
8+
---@return fun(...)
59
function M.arify(fn, argc)
610
return function(...)
711
if select("#", ...) ~= argc then
@@ -12,6 +16,8 @@ function M.arify(fn, argc)
1216
end
1317
end
1418

19+
---@param map fun(...)
20+
---@return fun(to_wrap: fun(...)): fun(...)
1521
function M.create_wrapper(map)
1622
return function(to_wrap)
1723
return function(...)

lua/plenary/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
---@field curl PlenaryCurl
77
---@field enum PlenaryEnum
88
---@field filetype PlenaryFiletype
9+
---@field fun PlenaryFun
910
---@field functional PlenaryFunctional
1011
---@field job PlenaryJob
1112
---@field json PlenaryJson

0 commit comments

Comments
 (0)