data-matching
Advanced tools
Comparing version 1.35.0 to 1.35.1
{ | ||
"name": "data-matching", | ||
"version": "1.35.0", | ||
"version": "1.35.1", | ||
"description": "Matches a data object against a reference value Edit", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -285,3 +285,3 @@ const _ = require("lodash"); | ||
return true; | ||
} else if (!Array.isArray(myVariable)) { | ||
} else if (!Array.isArray(dict[var_name])) { | ||
var reason = `'${var_name}' is not an Array`; | ||
@@ -288,0 +288,0 @@ if (throw_maching_error) throw new MatchingError(path, reason); |
@@ -917,4 +917,20 @@ const dm = require("../src/index"); | ||
expect(dict).toEqual({ids: [10]}); | ||
var received2 = { | ||
name: 'bob', | ||
id: 20, | ||
}; | ||
res = dm.partial_match(expected)( | ||
received2, | ||
dict, | ||
!THROW_MATCHING_ERROR, | ||
"root", | ||
); | ||
expect(res).toEqual("object matched"); | ||
expect(dict).toEqual({ids: [10, 20]}); | ||
}); | ||
46863
1554