Skip to content

Commit e332b08

Browse files
committed
[Fix] node < 4 lacks Array.prototype.find
1 parent 7212479 commit e332b08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/util/variable.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
'use strict';
66

7+
var find = require('array.prototype.find');
8+
79
/**
810
* Search a particular variable in a list
911
* @param {Array} variables The variables list.
@@ -23,7 +25,7 @@ function findVariable(variables, name) {
2325
* @returns {Object} Variable if the variable was found, null if not.
2426
*/
2527
function getVariable(variables, name) {
26-
return variables.find(function (variable) {
28+
return find(variables, function (variable) {
2729
return variable.name === name;
2830
});
2931
}

0 commit comments

Comments
 (0)