ReferenceAsk
?

MapOutcome

Type
What a mapper's map returns for one object: documents, passthrough, skip, or deletes.

What a mapper's map returns for one object: the result of documents, passthrough, skip, or deletes. Throwing from map is the object's error outcome, which the platform quarantines.

MapOutcome.ts
type MapOutcome =
  | { kind: 'documents'; documents: MappedDocument[] }
  | { kind: 'passthrough' }
  | { kind: 'skip'; reason: string }
  | { kind: 'deletes'; externalIds: string[] }
Return an outcome
async map(object): Promise<MapOutcome> {
  const record = await object.json();
  return record.deleted ? deletes([record.id]) : documents([toDoc(record)]);
}