withModuleAliases method
Returns a new Session with the specified module aliases.
The aliases
parameter is merged with any existing module aliases
defined on the current Session.
If the alias name
is 'module'
this is equivalent to using the
set module
command, otherwise it is equivalent to the set alias
command.
Implementation
Session withModuleAliases(Map<String, String> aliases) {
return Session(
module: aliases['module'] ?? module,
moduleAliases: {...moduleAliases, ...aliases}..remove('module'),
config: config,
globals: globals);
}