isValidPackageName = function(packageName) {
  try {
    return [validPackageName(packageName), null];
  } catch (error) {
    if (error instanceof ValidationError) return [false, error];
    throw error;
  }
}
Utils that shared both server and client.