loadJson static method

Future loadJson(
  1. Iterable<String> globs
)

Implementation

static Future loadJson(
  Iterable<String> globs,
) async {
  final cache = <String, String>{};
  for (final pattern in globs) {
    final jsonPath = '${Directory.current.path}/$pattern';
    await for (final path in Glob(jsonPath).list()) {
      if (path is File) {
        final file = await (path as File).readAsString();
        cache[pattern] = file;
      }
    }
  }
  final manifest = <String, List<String>>{};
  cache.forEach((key, _) {
    manifest[key] = [key];
  });

  return cache;
}