resolvePath static method

dynamic resolvePath(
  1. String path
)

Implementation

static resolvePath(String path) {
  final regX = RegExp(r'projects/.+/databases/.+/documents/');
  path = path.replaceFirst(regX, './documents/'); // *.......*
  if (path.startsWith('./documents/')) return path; // *.....*
  return './documents/${path.replaceFirst(RegExp(r'\A/'), '')}';
}