mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Ensure _.pick supports path arrays. [closes #2809]
This commit is contained in:
11
test/test.js
11
test/test.js
@@ -17597,6 +17597,15 @@
|
||||
assert.deepEqual(_.pick(nested, 'b.c'), { 'b': { 'c': 2 } });
|
||||
});
|
||||
|
||||
QUnit.test('should support path arrays', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var object = { 'a.b.c': 1 },
|
||||
actual = _.pick(object, [['a.b.c']]);
|
||||
|
||||
assert.deepEqual(actual, { 'a.b.c': 1 });
|
||||
});
|
||||
|
||||
QUnit.test('should coerce property names to strings', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
@@ -23585,7 +23594,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test('should a new path array', function(assert) {
|
||||
QUnit.test('should return new path array', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
assert.notStrictEqual(_.toPath('a.b.c'), _.toPath('a.b.c'));
|
||||
|
||||
Reference in New Issue
Block a user