toJson method

Map<String, dynamic> toJson()

Serializes to the header JSON line (without the trailing newline).

Implementation

Map<String, dynamic> toJson() => {
  'type': 'session',
  'version': version,
  'id': id,
  'timestamp': timestamp.toIso8601String(),
  'cwd': cwd,
  if (parentSessionPath != null) 'parentSession': parentSessionPath,
  if (metadata != null) 'metadata': metadata,
};