From f39b62637350d594ca199f1a32847c699d39adb1 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 18 Jan 2019 09:12:05 +0000 Subject: [PATCH] Added `set` to available types Added `set` which does exist (https://github.com/rhalff/dot-object/blob/master/index.js#L358) but is undocumented. Used for replacing an object -> https://github.com/rhalff/dot-object/issues/8. --- types/dot-object/index.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/types/dot-object/index.d.ts b/types/dot-object/index.d.ts index 8bb7d0657c..965fe8171b 100644 --- a/types/dot-object/index.d.ts +++ b/types/dot-object/index.d.ts @@ -120,12 +120,25 @@ declare namespace DotObject { */ remove(path: string, obj: any): any; /** + * + * Replace/create with a string + * * @param {String} path dotted path * @param {String} v value to be set * @param {Object} obj object to be modified * @param {Function|Array} mods optional modifier */ str(path: string, v: any, obj: Object, mods?: ModifierFunctionWrapper | Array): void; + /** + * + * Replace/merge an object to an existing object property + * + * @param {String} path dotted path + * @param {Object} v object to be set + * @param {Object} obj object to be modified + * @param {Boolean} merge optional merge + */ + set(path: string, v: any, obj: Object, merge?: Boolean): void; /** * * Transfer a property from one object to another object.