Ensure fp.update does not convert end of path to an object. [closes #2271]

This commit is contained in:
John-David Dalton
2016-04-22 08:46:35 -07:00
parent aebc0650f8
commit e2c86dac63
2 changed files with 15 additions and 1 deletions

View File

@@ -1474,6 +1474,19 @@
/*--------------------------------------------------------------------------*/
QUnit.module('fp.update');
(function() {
QUnit.test('should not convert end of `path` to an object', function(assert) {
assert.expect(1);
var actual = fp.update('a.b')(_.identity)({ 'a': { 'b': 1 } });
assert.strictEqual(typeof actual.a.b, 'number');
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('padChars methods');
_.each(['padChars', 'padCharsStart', 'padCharsEnd'], function(methodName) {