-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed matching nested array fields. #19
- Loading branch information
Showing
8 changed files
with
70 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "mingo", | ||
"main": "mingo.js", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"homepage": "https://github.com/kofrasa/mingo", | ||
"authors": [ | ||
"Francis Asante <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Mingo.js 0.6.0 | ||
// Mingo.js 0.6.1 | ||
// Copyright (c) 2015 Francis Asante <[email protected]> | ||
// MIT | ||
|
||
|
@@ -11,6 +11,8 @@ | |
var Mingo = {}, previousMingo; | ||
var _; | ||
|
||
Mingo.VERSION = '0.6.1'; | ||
|
||
// backup previous Mingo | ||
if (root != null) { | ||
previousMingo = root.Mingo; | ||
|
@@ -486,9 +488,7 @@ | |
if (isText && _.isArray(value)) { | ||
var res = []; | ||
_.each(value, function (item) { | ||
if (_.isObject(item)) { | ||
res.push(resolve(item, names[i])); | ||
} | ||
res.push(resolve(item, names[i])); | ||
}); | ||
value = res; | ||
} else { | ||
|
@@ -1007,7 +1007,8 @@ | |
* @returns {*} | ||
*/ | ||
$eq: function (a, b) { | ||
a = _.isArray(a) ? a : [a]; | ||
// flatten to reach nested values. fix for https://github.com/kofrasa/mingo/issues/19 | ||
a = _.flatten(_.isArray(a) ? a : [a]); | ||
a = _.find(a, function (val) { | ||
return _.isEqual(val, b); | ||
}); | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters