Skip to content

Migration Guide

Joe Siu edited this page Apr 25, 2024 · 1 revision

v1.0.x → v1.1.x

Search function

v1.0.x

const result = await XenoCanto.search("Owl", { grp: "birds", cnt: "United States" }, 1, { baseUrl: "" }); // query: string, options: XCQueryOption, page: number, additionalOptions: AdditionalWrapperOption

v1.1.x

const result = await XenoCanto.search({ query: "Owl", grp: "birds", cnt: "United States", page: 1 }, { baseUrl: "" }); // options: XCQueryOption, additionalOptions: AdditionalSearchOption

Misc

v1.0.x

const result = await XenoCanto.search(...);
const file = result.xcResponse.recordings[0].file;

v1.1.x

const result = await XenoCanto.search(...);
const file = result.xcResponse.recordings[0].file; // Will not be auto completed in IDE however
// or
const file = result.xcResponse[XCResponseKey.recordings][0][XCRecordingKey.file]; // IDE should show type hint via this method
Clone this wiki locally