Skip to content

Commit

Permalink
[Fix] node < 4 lacks Array.prototype.find
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 29, 2017
1 parent 7212479 commit e332b08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/util/variable.js
Expand Up @@ -4,6 +4,8 @@
*/
'use strict';

var find = require('array.prototype.find');

/**
* Search a particular variable in a list
* @param {Array} variables The variables list.
Expand All @@ -23,7 +25,7 @@ function findVariable(variables, name) {
* @returns {Object} Variable if the variable was found, null if not.
*/
function getVariable(variables, name) {
return variables.find(function (variable) {
return find(variables, function (variable) {
return variable.name === name;
});
}
Expand Down

0 comments on commit e332b08

Please sign in to comment.