toJson method

Map<String, dynamic> toJson()

Serializes dependency metadata to a JSON-encodable map.

Implementation

Map<String, dynamic> toJson() => {
      'name': name,
      'version': version,
      'specifier': specifier,
      'url': url,
      if (integrity != null) 'integrity': integrity,
      if (subPath != null) 'subPath': subPath,
    };