We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Array.prototype.find
1 parent 7212479 commit e332b08Copy full SHA for e332b08
lib/util/variable.js
@@ -4,6 +4,8 @@
4
*/
5
'use strict';
6
7
+var find = require('array.prototype.find');
8
+
9
/**
10
* Search a particular variable in a list
11
* @param {Array} variables The variables list.
@@ -23,7 +25,7 @@ function findVariable(variables, name) {
23
25
* @returns {Object} Variable if the variable was found, null if not.
24
26
27
function getVariable(variables, name) {
- return variables.find(function (variable) {
28
+ return find(variables, function (variable) {
29
return variable.name === name;
30
});
31
}
0 commit comments