Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ class ApiResponse {
return null;
}

/**
* Bib available in the response if requested via `options.include=bib`. Specialised classes provide extracted meta data depending on context.
* @return {object}
*/
getBib() {
if('bib' in this.raw) {
return this.raw.bib;
}
return null;
}

/**
* Value of the "Last-Modified-Version" header in response if present. Specialised classes provide
version depending on context
Expand Down Expand Up @@ -144,6 +155,14 @@ module:zotero-api-client~MultiReadResponse#getData}
return this.raw.map(r => 'meta' in r && r.meta || null);
}

/**
* @return {Array} a list of formatted references (if requested via `options.include=bib`), indexes of the array match indexes of entities in {@link
module:zotero-api-client~MultiReadResponse#getData}
*/
getBib() {
return this.raw.map(r => 'bib' in r && r.bib || null);
}

/**
* @return {?number} Total number of results
*/
Expand Down