mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-01-04 00:01:57 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
18 lines
379 B
Nu
18 lines
379 B
Nu
# Convert a Nushell value to a list
|
|
#
|
|
# Primary useful for range-to-list,
|
|
# but other types are accepted as well.
|
|
#
|
|
# Example:
|
|
#
|
|
# 1..10 | into list
|
|
export def "into list" []: any -> list {
|
|
let input = $in
|
|
let type = ($input | describe --detailed | get type)
|
|
match $type {
|
|
range => {$input | each {||}}
|
|
list => $input
|
|
table => $input
|
|
_ => [ $input ]
|
|
}
|
|
} |