Factor out generate-head
This commit is contained in:
parent
9a87e7825a
commit
68e20af5d7
3 changed files with 67 additions and 44 deletions
18
lib/Render/Util.rakumod
Normal file
18
lib/Render/Util.rakumod
Normal file
|
@ -0,0 +1,18 @@
|
|||
use v6.e.PREVIEW;
|
||||
unit module Render::Util;
|
||||
|
||||
sub opt($test, $item) is export {
|
||||
if $test {
|
||||
$item
|
||||
} else {
|
||||
[]
|
||||
}
|
||||
}
|
||||
|
||||
sub optl($test, &item) is export {
|
||||
if $test {
|
||||
item
|
||||
} else {
|
||||
[]
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue