ReferenceAsk
?

MapObject

Type
One raw object handed to map: its key and metadata, with bytes, text, and json readers.

One raw object handed to map: its key, size, content type, and any origin metadata, with bytes(), text(), and json() to read its content on demand. Read only what you need; a mapper that inspects a key may never touch the body.

MapObject.ts
interface MapObject {
  key: string
  size: number | null
  contentType: string | null
  metadata: DocumentMetadata | null
  bytes(): Promise<Uint8Array>
  text(): Promise<string>
  json<T = unknown>(): Promise<T>
}
Fields
key
string
The key the object is known by: a store key, a bucket key, a URL, a filename.
metadata
DocumentMetadata | null
Metadata the origin supplied (a manifest line's metadata), or null.
bytes / text / json
() => Promise
Read the object's content on demand, as bytes, text, or parsed JSON.
Read only what you need
if (!object.key.endsWith('.json')) return skip('not json');
const record = await object.json();