Skip to content

Commit

Permalink
- Use standard jsdoc tags and casing, denoting optional items (and …
Browse files Browse the repository at this point in the history
…add some types/return values)
  • Loading branch information
brettz9 committed Oct 6, 2019
1 parent b7b60cb commit 90f06bb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
14 changes: 8 additions & 6 deletions lib/package-managers/npm.js
Expand Up @@ -37,7 +37,7 @@ function parseJson(result, data) {
/**
* @param packageName Name of the package
* @param field Field such as "versions" or "dist-tags.latest" are parsed from the pacote result (https://www.npmjs.com/package/pacote#packument)
* @Returns Promised result
* @returns Promised result
*/
function view(packageName, field, currentVersion) {
if (currentVersion && (!semver.validRange(currentVersion) || versionUtil.isWildCard(currentVersion))) {
Expand All @@ -62,15 +62,15 @@ function view(packageName, field, currentVersion) {

/**
* @param versions Array of all available versions
* @Returns An array of versions with the release versions filtered out
* @returns An array of versions with the release versions filtered out
*/
function filterOutPrereleaseVersions(versions) {
return _.filter(versions, _.negate(isPre));
}

/**
* @param version
* @Returns True if the version is any kind of prerelease: alpha, beta, rc, pre
* @returns {boolean} True if the version is any kind of prerelease: alpha, beta, rc, pre
*/
function isPre(version) {
return versionUtil.getPrecision(version) === 'release';
Expand Down Expand Up @@ -119,9 +119,11 @@ function defaultPrefix(options) {
module.exports = {

/**
* @options.cwd (optional)
* @options.global (optional)
* @options.prefix (optional)
* @param [options]
* @param [options.cwd]
* @param [options.global]
* @param [options.prefix]
* @returns {Promise<Object>}
*/
list(options={}) {

Expand Down
2 changes: 1 addition & 1 deletion lib/version-util.js
Expand Up @@ -152,7 +152,7 @@ function colorizeDiff(from, to) {
* @param versions Array of all available versions
* @param current Current version
* @param level major/minor
* @Returns String representation of the suggested version. If the current version
* @returns {string} String representation of the suggested version. If the current version
* is not direct then returns null
*/
function findGreatestByLevel(versions, current, level) {
Expand Down
13 changes: 7 additions & 6 deletions lib/versionmanager.js
Expand Up @@ -307,12 +307,13 @@ function getCurrentDependencies(pkgData = {}, options = {}) {
}

/**
* @options.cwd
* @options.filter
* @options.global
* @options.packageManager
* @options.prefix
* @options.reject
* @param [options]
* @param options.cwd
* @param options.filter
* @param options.global
* @param options.packageManager
* @param options.prefix
* @param options.reject
*/
function getInstalledPackages(options = {}) {
return getPackageManager(options.packageManager).list({cwd: options.cwd, prefix: options.prefix, global: options.global}).then(pkgInfoObj => {
Expand Down

0 comments on commit 90f06bb

Please sign in to comment.