Skip to content

Commit 7c2fdfa

Browse files
author
Scott Switzer
committed
updated test case for wankdanker#37
1 parent 174d869 commit 7c2fdfa

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

test/test.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,3 +2077,32 @@ test('Multi-level array issue #29', function (t) {
20772077
});
20782078

20792079

2080+
test('Ensure that boolean values work for both arrays and objects #37', function (t) {
2081+
var to_obj = {
2082+
test: 1
2083+
};
2084+
2085+
var from_obj = {
2086+
"foo": {
2087+
"bar": false,
2088+
"baz": [1,2,'three',false]
2089+
}
2090+
};
2091+
2092+
var map = {
2093+
'foo.bar': { key: 'baz' },
2094+
'foo.baz': 'biff'
2095+
};
2096+
2097+
var expect = {
2098+
test: 1,
2099+
baz: false,
2100+
biff: [1,2,'three',false]
2101+
};
2102+
2103+
2104+
var result = om(from_obj, to_obj, map);
2105+
2106+
t.deepEqual(result, expect);
2107+
t.end();
2108+
});

0 commit comments

Comments
 (0)