Skip to content

V- Modal AI: Visual Video / Image Search - Flutter Video SDK

366 B
Raw Blame
final _validLibraryScope = RegExp(r'^[A-Za-z0-9_]+$');

String validateLibraryScope(Object? scope) {
  if (scope is! String ||
      scope.isEmpty ||
      scope.length > 80 ||
      !_validLibraryScope.hasMatch(scope)) {
    throw const InvalidLibraryScope();
  }
  return scope;
}

class InvalidLibraryScope implements Exception {
  const InvalidLibraryScope();
}