From f29944ba298208d5b5b20c3a8f95108aef4b8ee2 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Wed, 20 Jul 2016 10:19:51 +0800 Subject: [PATCH] add jsdoc for global_dependencies inner function names are renamed to keep consistency with exported names Change-Id: I2f03d160f19ef57dc99d1aff9d1422ca983fb459 --- generators/app/lib/global_dependencies.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/generators/app/lib/global_dependencies.js b/generators/app/lib/global_dependencies.js index ce148cb..2f68575 100644 --- a/generators/app/lib/global_dependencies.js +++ b/generators/app/lib/global_dependencies.js @@ -17,6 +17,11 @@ * Access to the global-dependencies.json file. */ +/** + * Global dependency module + * @module + */ + 'use strict'; var globalDependencies = require('../../../global-dependencies.json'); @@ -27,7 +32,7 @@ var globalDependencies = require('../../../global-dependencies.json'); * @param {String} name The name of the dependency. * @returns {Boolean} True if the dependency exists, otherwise false. */ -function containsDependency (name) { +function contains (name) { return globalDependencies.hasOwnProperty(name); } @@ -37,7 +42,7 @@ function containsDependency (name) { * @param {String} name The dependency name. * @returns {String|undefined} The version, or undefined. */ -function getVersion (name) { +function read (name) { return globalDependencies[name] || undefined; } @@ -48,7 +53,7 @@ function getVersion (name) { * @param {{}} dependencies The list of dependencies. * @returns {{}} The above list of dependencies, with only the appropriate versions updated. */ -function synchronizeDependencies (dependencies) { +function synchronize (dependencies) { var results = {}; for (var key in dependencies) { if (globalDependencies.hasOwnProperty(key)) { @@ -61,7 +66,10 @@ function synchronizeDependencies (dependencies) { } module.exports = { - contains: containsDependency, - read: getVersion, - synchronize: synchronizeDependencies + /** @see {@link module:global_dependencies~contains} */ + contains: contains, + /** @see {@link module:global_dependencies~read} */ + read: read, + /** @see {@link module:global_dependencies~synchronize} */ + synchronize: synchronize };