mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-03 07:37:47 +00:00
replace filter
with where
(#1135)
This PR tries to clean up the use of `filter` by replacing it with `where`. I did not test each script. closes #1134 closes #1133
This commit is contained in:
parent
84c25bbc6d
commit
32cdc96414
25 changed files with 66 additions and 66 deletions
|
@ -25,7 +25,7 @@ module cdpath {
|
|||
$env.CDPATH
|
||||
| path expand
|
||||
| uniq
|
||||
| filter {|| $in | path exists }
|
||||
| where {|| $in | path exists }
|
||||
}
|
||||
|
||||
# Children of a path
|
||||
|
@ -59,7 +59,7 @@ module cdpath {
|
|||
let first = $path | first
|
||||
|
||||
complete_from_cdpath
|
||||
| filter {|| $in.value | str contains $first }
|
||||
| where {|| $in.value | str contains $first }
|
||||
| upsert value {|| $"($in.value)/" }
|
||||
# Complete a child of a CDPATH entry
|
||||
} else {
|
||||
|
@ -86,14 +86,14 @@ module cdpath {
|
|||
| each {||
|
||||
$in | path join $prefix
|
||||
}
|
||||
| filter {||
|
||||
| where {||
|
||||
$in | path exists
|
||||
}
|
||||
| first
|
||||
}
|
||||
|
||||
children $chosen_path
|
||||
| filter {||
|
||||
| where {||
|
||||
$in | str contains $last
|
||||
}
|
||||
| each {|child|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue