Skip to content

Commit bf66cb3

Browse files
authored
Merge pull request #639 from guolin/master
refactor: use Array#forEach instead of _.each
2 parents 8519185 + 6bb05db commit bf66cb3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ module.exports = function(AV) {
213213
if (_.has(this, 'id')) {
214214
json.objectId = this.id;
215215
}
216-
_(['createdAt', 'updatedAt']).each(key => {
216+
['createdAt', 'updatedAt'].forEach(key => {
217217
if (_.has(this, key)) {
218218
const val = this[key];
219219
json[key] = _.isDate(val) ? val.toJSON() : val;

src/object.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ module.exports = function(AV) {
272272
if (_.has(this, 'id')) {
273273
json.objectId = this.id;
274274
}
275-
_(['createdAt', 'updatedAt']).each(key => {
275+
['createdAt', 'updatedAt'].forEach(key => {
276276
if (_.has(this, key)) {
277277
const val = this[key];
278278
json[key] = _.isDate(val) ? val.toJSON() : val;
@@ -1164,7 +1164,7 @@ module.exports = function(AV) {
11641164
*/
11651165
parse: function(resp) {
11661166
var output = _.clone(resp);
1167-
_(['createdAt', 'updatedAt']).each(function(key) {
1167+
['createdAt', 'updatedAt'].forEach(function(key) {
11681168
if (output[key]) {
11691169
output[key] = AV._parseDate(output[key]);
11701170
}

0 commit comments

Comments
 (0)