function is_vec_like_of_strings()

in src/TypeAssert.hack [44:52]


function is_vec_like_of_strings(mixed $value, string $field): vec<string> {
  invariant($value is Traversable<_>, '%s should be a vec<string>', $field);
  $out = vec[];
  foreach ($value as $el) {
    invariant($el is string, '%s should be a vec<string>', $field);
    $out[] = $el;
  }
  return $out;
}