toJson method

Map<String, dynamic> toJson()

Converts this entry to a Kubo-compatible JSON map.

Implementation

Map<String, dynamic> toJson() {
  final result = <String, dynamic>{
    'Name': name,
    'Type': type,
    'Size': size,
    'Hash': hash,
  };
  if (mode != null) result['Mode'] = mode;
  if (mtime != null) result['Mtime'] = mtime;
  if (mtimeNsecs != null) result['MtimeNsecs'] = mtimeNsecs;
  return result;
}