Skip to content

Commit

Permalink
Merge pull request #16080 from jenweber/bugfix-tryinvoke-caninvoke-utils
Browse files Browse the repository at this point in the history
[BUGFIX] missing modules docs for tryInvoke, compare, isEqual #16079
  • Loading branch information
toddjordan authored Jan 8, 2018
2 parents 137a3b4 + 689ffc5 commit db34024
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
7 changes: 6 additions & 1 deletion packages/ember-runtime/lib/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ function spaceship(a, b) {
return (diff > 0) - (diff < 0);
}

/**
@module @ember/utils
*/

/**
Compares two javascript values and returns:
Expand Down Expand Up @@ -72,7 +76,8 @@ function spaceship(a, b) {
```
@method compare
@for Ember
@for @ember/utils
@static
@param {Object} v First value to compare
@param {Object} w Second value to compare
@return {Number} -1 if v < w, 0 if v = w and 1 if v > w.
Expand Down
6 changes: 5 additions & 1 deletion packages/ember-runtime/lib/is-equal.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
@module @ember/utils
*/
/**
Compares two objects, returning true if they are equal.
Expand Down Expand Up @@ -30,7 +33,8 @@
```
@method isEqual
@for Ember
@for @ember/utils
@static
@param {Object} a first object to compare
@param {Object} b second object to compare
@return {Boolean}
Expand Down
7 changes: 6 additions & 1 deletion packages/ember-utils/lib/invoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export function canInvoke(obj, methodName) {
return obj !== null && obj !== undefined && typeof obj[methodName] === 'function';
}

/**
@module @ember/utils
*/

/**
Checks to see if the `methodName` exists on the `obj`,
and if it does, invokes it with the arguments passed.
Expand All @@ -35,7 +39,8 @@ export function canInvoke(obj, methodName) {
```
@method tryInvoke
@for Ember
@for @ember/utils
@static
@param {Object} obj The object to check for the method
@param {String} methodName The method name to check for
@param {Array} [args] The arguments to pass to the method
Expand Down

0 comments on commit db34024

Please sign in to comment.