isReadOnlyRedisCommand function

bool isReadOnlyRedisCommand(
  1. List<String> args
)

Whether args only reads.

Implementation

bool isReadOnlyRedisCommand(List<String> args) {
  if (args.isEmpty) {
    return false;
  }
  final name = args.first.toUpperCase();
  if (redisReadCommands.contains(name)) {
    return true;
  }
  final subcommands = _readSubcommands[name];
  return subcommands != null &&
      args.length > 1 &&
      subcommands.contains(args[1].toUpperCase());
}