toDockerKey static method

  1. @visibleForTesting
String toDockerKey(
  1. String dartKey
)

Converts a Dart-style camelCase or snake_case key to the Docker API's PascalCase convention.

Known special cases (privileged, auto_remove, autoRemove, platform) are mapped explicitly. All other keys have their first character upper-cased.

Throws ArgumentError when dartKey is empty.

Exposed for unit testing via DockerClient.toDockerKey.

Implementation

@visibleForTesting
static String toDockerKey(String dartKey) => _toDockerKey(dartKey);