cachedPubspec function

Pubspec cachedPubspec({
  1. String? path,
})

Implementation

Pubspec cachedPubspec({String? path}) {
  final sourceUrl = p.join(path ?? p.current, 'pubspec.yaml');
  return _cachedPubspecs.putIfAbsent(
      sourceUrl,
      () => Pubspec.parse(File(sourceUrl).readAsStringSync(),
          sourceUrl: Uri.parse(sourceUrl)));
}