Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes parse function public #150

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions sitemapper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
* @param url URL to the sitemap.xml file
*/
fetch(url?: string): Promise<SitemapperResponse>;

/**
* Requests the URL and uses parseStringPromise to parse through and find the data
*
* @param url URL to the sitemap.xml file
*/
parse(url?: string): Promise<ParseData>;

Check failure on line 43 in sitemapper.d.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Cannot find name 'ParseData'.

Check failure on line 43 in sitemapper.d.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Cannot find name 'ParseData'.

Check failure on line 43 in sitemapper.d.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Cannot find name 'ParseData'.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like ParseData is throwing some errors

}

export default Sitemapper;
2 changes: 1 addition & 1 deletion src/assets/sitemapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default class Sitemapper {
/**
* Requests the URL and uses parseStringPromise to parse through and find the data
*
* @private
* @public
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does changing this comment change any functionality? Or is it more of a formal way of defining it public. I believe in JS the comment doesn't actually prevent anything from being accessed.

I don't see any issues with defining it as public.

* @param {string} [url] - the Sitemaps url (e.g https://wp.seantburke.com/sitemap.xml)
* @returns {Promise<ParseData>}
*/
Expand Down
Loading