diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 627dda565..ddf6aceda 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1105,8 +1105,9 @@ result = _.pick({ 'name': 'moe', '_userid': 'moe1' }, function (value, return key.charAt(0) != '_'; }); - +// _.set result = <{ a: { b: { c: number; }}[]}>_.set({ 'a': [{ 'b': { 'c': 3 } }] }, 'a[0].b.c', 4); +result = <{ a: { b: { c: number; }}[]}>_({ 'a': [{ 'b': { 'c': 3 } }] }).set('a[0].b.c', 4).value(); result = _.transform([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function (r: number[], num: number) { num *= num; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 7bc1df648..8fcb79bf2 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -6300,6 +6300,14 @@ declare module _ { value: any): T; } + interface LoDashObjectWrapper { + /** + * @see _.set + **/ + set(path: string|string[], + value: any): LoDashObjectWrapper; + } + //_.transform interface LoDashStatic { /**