不要怂,就是干,撸起袖子干!

Commit f4f620e0 by Thomas Watson Steen

Use ES5 `obj.some` and `obj.every` instead of Underscore.js `any` and `all`

1 parent 5759c5b3
Showing with 5 additions and 5 deletions
......@@ -90,9 +90,9 @@ module.exports = (function() {
.error(function(err){ customEventEmitter.emit('error', err)})
.success(function(associatedObjects) {
customEventEmitter.emit('success',
Utils._.all(objects, function(o) {
return Utils._.any(associatedObjects, function(associatedObject) {
return Utils._.all(associatedObject.identifiers, function(key, identifier) {
objects.every(function(o) {
return associatedObjects.some(function(associatedObject) {
return associatedObject.identifiers.every(function(key, identifier) {
return o[identifier] == associatedObject[identifier];
});
})
......@@ -110,8 +110,8 @@ module.exports = (function() {
.error(function(err){ customEventEmitter.emit('error', err)})
.success(function(associatedObjects) {
customEventEmitter.emit('success',
Utils._.any(associatedObjects, function(associatedObject) {
return Utils._.all(associatedObject.identifiers, function(key, identifier) {
associatedObjects.some(function(associatedObject) {
return associatedObject.identifiers.every(function(key, identifier) {
return o[identifier] == associatedObject[identifier];
});
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!