File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -414,10 +414,15 @@ select_decorators <- function(decorators, scope) {
414
414
# ' @keywords internal
415
415
normalize_decorators <- function (decorators ) {
416
416
if (checkmate :: test_list(decorators , " teal_transform_module" )) {
417
- if (checkmate :: test_names(names(decorators ))) {
417
+ decorators_names <- names(decorators )[! names(decorators ) %in% " " ]
418
+ # Above is equivalent to decorators_names <- setdiff(names(decorators), "")
419
+ # but can return non-unique values. Non-unique values are checked in assert_decorators.
420
+ if (length(decorators_names ) == 0 ) {
421
+ list (default = decorators )
422
+ } else if (length(decorators_names ) == length(decorators )) {
418
423
lapply(decorators , list )
419
424
} else {
420
- list ( default = decorators )
425
+ stop( " All decorators should either be named or unnamed. " )
421
426
}
422
427
} else {
423
428
decorators
You can’t perform that action at this time.
0 commit comments