Skip to content

Commit

Permalink
feat(globals): add orderBy method
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Nov 27, 2017
1 parent 5db5710 commit 6ad7190
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Globals/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,19 @@ const urlEncode = function (url) {
return encodeurl(url)
}

/**
* Order an array using a given property.
*
* @method orderBy
*
* @param {Array} collection
* @param {String|Array} property
* @param {String|Array} order
*/
const orderBy = function (collection, property, order) {
return _.orderBy(collection, property, order)
}

module.exports = {
range,
batch,
Expand All @@ -307,5 +320,6 @@ module.exports = {
capitalize,
truncate,
toAnchor,
urlEncode
urlEncode,
orderBy
}

0 comments on commit 6ad7190

Please sign in to comment.