Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add jsdocs to tldr and cache #355

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

Open
navarroaxel wants to merge 1 commit into main
base: main
Choose a base branch
Loading
from docs/add-jsdocs
Open

add jsdocs to tldr and cache #355

navarroaxel wants to merge 1 commit into main from docs/add-jsdocs

Conversation

@navarroaxel
Copy link
Contributor

@navarroaxel navarroaxel commented May 25, 2021
edited
Loading

Description

Please explain the changes you made here.

Checklist

Please review this checklist before submitting a pull request.

  • Code compiles correctly
  • Created tests, if possible
  • All tests passing (npm run test:all)
  • Extended the README / documentation, if necessary

Copy link
Member

@blueskyson blueskyson left a comment

Choose a reason for hiding this comment

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

Wow, I wonder why comment enhancements are left so long unmerged.

/**
* Fetch a page from cache using preferred language and preferred platform.
* @param page {} A
* @returns {Promise<unknown>}
Copy link
Member

Choose a reason for hiding this comment

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

What is the difference between Promise<any> and Promise<unknown> ?

Comment on lines 118 to 119
// Return all commands for a given platform.
// P.S. - The platform 'common' is always included.
Copy link
Member

Choose a reason for hiding this comment

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

Should we remove this then? Seems repeated.

}

/**
* Print pages for a given platform..
Copy link
Member

Choose a reason for hiding this comment

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

Multiple periods at the end of the sentence.


/**
* Print a command page.
* @param commands {string[]} A given command to be printed.
Copy link
Member

Choose a reason for hiding this comment

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

"A given command" is incorrect when we are passing an array. Let's change this to plural.


/**
* Update the cache.
* @returns {Promise<any>} A promise with the index.
Copy link
Member

Choose a reason for hiding this comment

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

Should this be "A promise with the cache"?

@kbdharun kbdharun changed the base branch from master to main October 3, 2023 17:12
Copy link
Member

@vitorhcl vitorhcl left a comment

Choose a reason for hiding this comment

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

LGTM after we address the left concerns.

However, we can resolve just some of them and merge it, this PR adds documentation for quite a lot of functions. It's better to have a not ideal documentation than almost no documentation.

}

/**
* Print pages for a given platform..
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Print pages for a given platform..
* Print pages for a given platform.


/**
* Print a command page.
* @param commands {string[]} A given command to be printed.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @param commands {string[]} Agivencommand to be printed.
* @param commands {string[]} Givencommands to be printed.

* Return all commands for a given platform.
*
* The 'common' platform is always included.
* @param platform {string} The platform.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @param platform {string} The platform.
* @param platform {string} The desiredplatform.

}

/**
* Print a random page.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Print a random page.
* Print a random pageexample.

}

/**
* Fetch stats from the cache folder.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Fetch stats from the cache folder.
* Fetch stats from the cache folderforgettingitslastmodifiedtime(mtime).

// There is no need to re-read the index file again.
/**
* Check if a page is in the index.
* @returns {boolean} A boolean that indicates if the page is present.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @returns {boolean} Abooleanthatindicatesifthe page ispresent.
* @returns {boolean} Thepresenceofthe page intheindex.

}

/**
* Update the cache folder and returns the English entries.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Update the cache folder andreturnsthe Englishentries.
* Update the cache folder usingatemporarydirectory,updatethe indexandreturnit.


/**
* Print pages for a given platform..
* @param singleColumn {boolean} A boolean to print one command per line.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @param singleColumn {boolean} Abooleantoprint one command per line.
* @param singleColumn {boolean} Print one command per line.

}

/**
* Print all pages in the cache.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Print all pages in the cache.
* Print thenameofall pages in the index.

}

/**
* Print all pages.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Print all pages.
* Print thenameofall pages.

Copy link
Member

@vitorhcl vitorhcl left a comment
edited
Loading

Choose a reason for hiding this comment

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

#355 (comment):

What is the difference between Promise<any> and Promise<unknown> ?

See https://stackoverflow.com/questions/51439843/unknown-vs-any. In summary:

More verbosely, unknown is I don't know (yet), thus I have to figure it out, any is I don't care, thus I don't care

I think there are too many anys/unknowns here, but we can change them later if we need.

Copy link
Member

@agnivade agnivade left a comment

Choose a reason for hiding this comment

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

I still see my comments not addressed yet. Feel free to request a review once that's done. Thanks.

kbdharun reacted with thumbs up emoji
Copy link
Member

IMO we can take over this PR, since it was opened 2 years ago with no response since then.

kbdharun reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@agnivade agnivade agnivade left review comments

@vitorhcl vitorhcl vitorhcl approved these changes

@MasterOdin MasterOdin Awaiting requested review from MasterOdin

@blueskyson blueskyson Awaiting requested review from blueskyson

@kbdharun kbdharun Awaiting requested review from kbdharun

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /