resolveNestedAliases = def =>
    def.update("aliases", aliases => {
      const resolve = value =>
        value.update("value", v =>
          allMatches(v, ALIAS_PATTERN).reduce(
            (v, [alias, key]) =>
              aliases.has(key)
                ? v.replace(alias, resolve(aliases.get(key)).get("value"))
                : v,
            v
          )
        );
      return aliases.map(resolve);
    })
Resolve aliases that refer to other aliases