File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 13529
13529
* // => { 'a': 1, 'c': 3 }
13530
13530
*/
13531
13531
var pick = flatRest(function(object, paths) {
13532
- return object == null ? {} : basePick(object, arrayMap( paths, toKey) );
13532
+ return object == null ? {} : basePick(object, paths);
13533
13533
});
13534
13534
13535
13535
/**
Original file line number Diff line number Diff line change 17597
17597
assert.deepEqual(_.pick(nested, 'b.c'), { 'b': { 'c': 2 } });
17598
17598
});
17599
17599
17600
+ QUnit.test('should support path arrays', function(assert) {
17601
+ assert.expect(1);
17602
+
17603
+ var object = { 'a.b.c': 1 },
17604
+ actual = _.pick(object, [['a.b.c']]);
17605
+
17606
+ assert.deepEqual(actual, { 'a.b.c': 1 });
17607
+ });
17608
+
17600
17609
QUnit.test('should coerce property names to strings', function(assert) {
17601
17610
assert.expect(1);
17602
17611
23585
23594
});
23586
23595
});
23587
23596
23588
- QUnit.test('should a new path array', function(assert) {
23597
+ QUnit.test('should return new path array', function(assert) {
23589
23598
assert.expect(1);
23590
23599
23591
23600
assert.notStrictEqual(_.toPath('a.b.c'), _.toPath('a.b.c'));
You can’t perform that action at this time.
0 commit comments