nodeName.Rd
Check whether a prospective node name is valid, sanitize it, and return it
nodeName(
x,
entityName = NULL,
thisEntityText = "this entity (with temporary name '%s')"
)
The prospective node name
The original name of the entity before renaming
Text to insert with the the current name of this entity, in case it's about to be renamed.
The (sanitized) node name
metabefor::nodeName("this_is_valid");
#> [1] "this_is_valid"
metabefor::nodeName("this is sanitized");
#> [1] "thisissanitized"
if (FALSE) {
metabefor::nodeName(
"_thisThrowsAnError:first character can't be _"
);
### This also throws an error: a reserved name by data.tree
metabefor::nodeName(
"parent"
);
}