Skip to content

Commit 355f7a9

Browse files
committed
Remove .find for old Node support
1 parent 906516f commit 355f7a9

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

tasks/versioners/abstractVersioner.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,18 +236,18 @@ AbstractVersioner.prototype.createPreVersioningSurrogateTask = function (task) {
236236

237237
}.bind(this));
238238

239-
// make sure there are no desinations that are also sources
239+
// make sure there are no desinations that are also sources
240240
var destinations = this.versionsMap.map(function (versionMap) {
241241
return versionMap.versionedPath;
242242
});
243243
this.versionsMap = this.versionsMap.filter(function (item) {
244-
return !destinations.find(
244+
return !_.find(destinations,
245245
function (destination) {
246246
return destination === item.originalPath;
247247
});
248248
});
249249

250-
if (filesMapSkipCount === filesMapLength) {
250+
if (filesMapSkipCount === filesMapLength) {
251251
grunt.fail.warn("File configuration for Task '" + task.taskName + "' is incorrect. Missing valid source files and/or destination files!");
252252
}
253253

@@ -310,7 +310,7 @@ AbstractVersioner.prototype.saveVersionsMap = function () {
310310
grunt.config.set(originalTask + '.versionsMap', this.versionsMap);
311311
}
312312

313-
if (typeof this.isPostVersioningTask === 'string') {
313+
if (typeof this.isPostVersioningTask === 'string') {
314314
grunt.config.set(this.isPostVersioningTask + '.versionsMap', this.versionsMap);
315315
}
316316

test/assets_versioning_test.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -182,27 +182,27 @@ exports.assets_versioning = {
182182
test.done();
183183
},
184184

185-
options_versionsMapTemplateFunction: function (test) {
186-
test.expect(1);
185+
options_versionsMapTemplateFunction: function (test) {
186+
test.expect(1);
187187

188-
var actual = grunt.util.normalizelf(grunt.file.read('tmp/options_versionsMapTemplateFunction.php'));
189-
var expected = grunt.util.normalizelf(grunt.file.read('test/expected/output/dict.php'));
190-
test.equal(actual, expected, 'should create a file using a template returned by the function and the versions map data');
188+
var actual = grunt.util.normalizelf(grunt.file.read('tmp/options_versionsMapTemplateFunction.php'));
189+
var expected = grunt.util.normalizelf(grunt.file.read('test/expected/output/dict.php'));
190+
test.equal(actual, expected, 'should create a file using a template returned by the function and the versions map data');
191191

192-
test.done();
193-
},
192+
test.done();
193+
},
194194

195-
options_versionsMapDataFile: function (test) {
196-
test.expect(1);
195+
options_versionsMapDataFile: function (test) {
196+
test.expect(1);
197197

198-
var actual = grunt.util.normalizelf(grunt.file.read('tmp/options_versionsMapDataFile.json'));
199-
var expected = grunt.util.normalizelf(grunt.file.read('test/expected/output/options_output_trim.json'));
200-
test.equal(actual, expected, 'should create a file data file representing the currently mapped files');
198+
var actual = grunt.util.normalizelf(grunt.file.read('tmp/options_versionsMapDataFile.json'));
199+
var expected = grunt.util.normalizelf(grunt.file.read('test/expected/output/options_output_trim.json'));
200+
test.equal(actual, expected, 'should create a file data file representing the currently mapped files');
201201

202-
test.done();
203-
},
202+
test.done();
203+
},
204204

205-
files_compact_format: function(test) {
205+
files_compact_format: function(test) {
206206
test.expect(2);
207207

208208
test.ok(!grunt.file.exists('tmp/js/files_compact_format.js'), 'should not create an un-versioned file');

0 commit comments

Comments
 (0)