Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lua]: Add annotations to the core codebase. #1265

Merged
merged 15 commits into from
Jan 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore(neorg/core/lib): fix errors with lib.mod
vhyrro committed Jan 6, 2024
commit 81558c0ceba932b90bdc5c6c34ef15a1b5b8d8c2
4 changes: 4 additions & 0 deletions lua/neorg/core/lib.lua
Original file line number Diff line number Diff line change
@@ -467,6 +467,8 @@ function lib.lazy_copy(to_copy)
})
end

lib.mod = {}

--- Wrapper function to add two values.
--- This function only takes in one argument because the second value to add is provided as a parameter in the callback.
--- @param amount number The number to add.
@@ -487,6 +489,8 @@ function lib.mod.modify(to)
end
end

lib.mod.exclude = {}

function lib.mod.exclude.first(func, alt)
return function(i, val)
return i == 1 and (alt and alt(i, val) or val) or func(i, val)