Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class Isbn {
/**
* @type {Providers}
*/
#providers = DEFAULT_PROVIDERS;
providers = DEFAULT_PROVIDERS;

constructor() {
this.PROVIDER_NAMES = PROVIDER_NAMES;
Expand Down Expand Up @@ -62,7 +62,7 @@ export default class Isbn {
);
}

this.#providers = [...new Set(providers)];
this.providers = [...new Set(providers)];
return this;
}

Expand All @@ -75,7 +75,7 @@ export default class Isbn {
*/
async resolve(isbn, options = {}) {
const messages = [];
for (const provider of this.#providers) {
for (const provider of this.providers) {
try {
return await PROVIDER_RESOLVERS[provider](isbn, options);
} catch (error) {
Expand Down
5 changes: 4 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
* @typedef {import('axios').AxiosRequestConfig} AxiosRequestConfig
*/
export default class Isbn {
/**
* @type {Providers}
*/
providers: Providers;
PROVIDER_NAMES: {
GOOGLE: string;
OPENLIBRARY: string;
Expand All @@ -41,7 +45,6 @@ export default class Isbn {
* @throws {Error} - If an error occurs while resolving the book information.
*/
resolve(isbn: string, options?: AxiosRequestConfig): Promise<Book>;
#private;
}
export type Book = {
/**
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading