Repository: i18next/i18next-parser
Pull request #330 (2021-05-27 05:04:23)

Bump typescript from 4.2.4 to 4.3.2
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.4 to 4.3.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/Microsoft/TypeScript/releases">typescript's releases</a>.</em></p>
<blockquote>
<h2>TypeScript 4.3.2</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-3">release announcement</a>.</p>
<p>For the complete list of fixed issues, check out the</p>
<ul>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+milestone%3A%22TypeScript+4.3.0%22+is%3Aclosed+">fixed issues query for TypeScript v4.3.0 (Beta)</a>.</li>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+milestone%3A%22TypeScript+4.3.1%22+is%3Aclosed+">fixed issues query for TypeScript v4.3.1 (RC)</a>.</li>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+milestone%3A%22TypeScript+4.3.2%22+is%3Aclosed+">fixed issues query for TypeScript v4.3.2</a>.</li>
</ul>
<p>Downloads are available on:</p>
<ul>
<li><a href="https://www.npmjs.com/package/typescript">npm</a></li>
<li><a href="https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-43">Visual Studio 2017/2019</a> (<a href="https://github.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017">Select new version in project options</a>)</li>
<li><a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild">NuGet package</a></li>
</ul>
<h2>TypeScript 4.3 RC</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-3-rc">release announcement</a>.</p>
<p>For the complete list of fixed issues, check out the</p>
<ul>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+milestone%3A%22TypeScript+4.3.0%22+is%3Aclosed+">fixed issues query for TypeScript v4.3.0 (Beta)</a>.</li>
<li><a href="https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&amp;q=is%3Aissue+milestone%3A%22TypeScript+4.3.1%22+is%3Aclosed+">fixed issues query for TypeScript v4.3.1 (RC)</a>.</li>
</ul>
<p>Downloads are available on:</p>
<ul>
<li><a href="https://www.npmjs.com/package/typescript">npm</a></li>
<li><a href="https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-43">Visual Studio 2017/2019</a> (<a href="https://github.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017">Select new version in project options</a>)</li>
<li><a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild">NuGet package</a></li>
</ul>
<h2>TypeScript 4.3 Beta</h2>
<p>For release notes, check out the <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-3-beta/">release announcement</a>.</p>
<p>For the complete list of fixed issues, check out the</p>
<ul>
<li><a href="https://github.com/Microsoft/TypeScript/issues?q=milestone%3A%22TypeScript+4.3.0%22">fixed issues query for Typescript 4.3.0 (Beta)</a>.</li>
</ul>
<p>Downloads are available on:</p>
<ul>
<li><a href="https://www.npmjs.com/package/typescript">npm</a></li>
<li><a href="https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript-43beta">Visual Studio 2017/2019</a> (<a href="https://github.com/Microsoft/TypeScript/wiki/Updating-TypeScript-in-Visual-Studio-2017">Select new version in project options</a>)</li>
<li><a href="https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild">NuGet package</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/microsoft/TypeScript/commit/28e3e6ff2f49f1dbf06d31809ec73dbe42f1aa63"><code>28e3e6f</code></a> 🤖 Pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44219">#44219</a> (Properly remove generic types that ...) into release-4.3 (#...</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/d6e6fa728e1ab34aa46573152d274f067afc9b6f"><code>d6e6fa7</code></a> Cherry-pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44129">#44129</a> into release-4.3 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44240">#44240</a>)</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/27d6e4490d291adc33730d1a5d73ba52d78602d9"><code>27d6e44</code></a> Bump version to 4.3.2 and LKG</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/fed23150621413624df627a4ab667a7fae557dbd"><code>fed2315</code></a> Cherry-pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44186">#44186</a> into release-4.3 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44188">#44188</a>)</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/dec82611743ad357d63dd0999774c98710e5f69a"><code>dec8261</code></a> Revert <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/43460">#43460</a> and <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/40884">#40884</a> (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44175">#44175</a>) (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44177">#44177</a>)</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/22c3c24cf0676219c93b7a16964d4c453ad4f064"><code>22c3c24</code></a> Cherry-pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44125">#44125</a> into release-4.3 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44136">#44136</a>)</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/1d850c0927107d0f0f1efdfc3c160436ed010c92"><code>1d850c0</code></a> Cherry-pick PR <a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44008">#44008</a> into release-4.3 (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44029">#44029</a>)</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/d805ce877ae6235565ee697c3c0ce8a95a9c58f6"><code>d805ce8</code></a> Bump version to 4.3.1-rc and LKG</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/bab601b5e60d47a8b345872643fcb51699ae6edd"><code>bab601b</code></a> Merge remote-tracking branch 'origin/master' into release-4.3</li>
<li><a href="https://github.com/microsoft/TypeScript/commit/5b1e873b031f7c82cef0bc837c3656a4474fdb35"><code>5b1e873</code></a> Update diagnostic message and quickfix for parameter property (<a href="https://github-redirect.dependabot.com/Microsoft/TypeScript/issues/44010">#44010</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/Microsoft/TypeScript/compare/v4.2.4...v4.3.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=typescript&package-manager=npm_and_yarn&previous-version=4.2.4&new-version=4.3.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

codecov-commenter: # [Codecov](https://codecov.io/gh/i18next/i18next-parser/pull/330?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next) Report
> Merging [#330](https://codecov.io/gh/i18next/i18next-parser/pull/330?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next) (7db658c) into [master](https://codecov.io/gh/i18next/i18next-parser/commit/a7075bcbe19b4f7925b2324bed029e503f00d535?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next) (a7075bc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/i18next/i18next-parser/pull/330/graphs/tree.svg?width=650&height=150&src=pr&token=CJ74Vps41L&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next)](https://codecov.io/gh/i18next/i18next-parser/pull/330?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next)

```diff
@@           Coverage Diff           @@
##           master     #330   +/-   ##
=======================================
  Coverage   93.20%   93.20%           
=======================================
  Files           9        9           
  Lines         589      589           
=======================================
  Hits          549      549           
  Misses         40       40           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/i18next/i18next-parser/pull/330?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/i18next/i18next-parser/pull/330?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next). Last update [a7075bc...7db658c](https://codecov.io/gh/i18next/i18next-parser/pull/330?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next).


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a452166..963b730 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,9 @@
 # Changelog
 
-# 4.1.1 - latest
+# 4.2.0 - latest
+
+- Improve warning for missing defaults #332
+# 4.1.1
 
 - Improve support for spread operator in JS #199
 # 4.0.1
diff --git a/README.md b/README.md
index b24072d..0d9016e 100644
--- a/README.md
+++ b/README.md
@@ -346,7 +346,14 @@ The transform emits a `error:json` event if the JSON.parse on json files fail:
 
 The transform emits a `warning` event if the file has a key that is not a string litteral or an option object with a spread operator:
 
-`.pipe( i18next().on('warning:variable', (path, key) => {}) )`
+`.pipe( i18next().on('warning', (path, key) => {}) )`
+
+Here is a list of the warnings:
+
+- **Key is not a string literal**: the parser cannot parse variables, only literals. If your code contains something like `t(variable)`, the parser will throw a warning.
+- **Found same keys with different values**: if you use different default values for the same key, you'll get this error. For example, having `t('key', {defaultValue: 'foo'})` and `t('key', {defaultValue: bar'})`. The parser will select the latest one.
+- **Found translation key already mapped to a map or parent of new key already mapped to a string**: happens in this kind of situation: `t('parent', {defaultValue: 'foo'})` and `t('parent.child', {defaultValue: 'bar'})`. `parent` is both a translation and an object for `child`.
+
 
 ## Contribute
 
diff --git a/dist/helpers.js b/dist/helpers.js
index 16ac7e9..0777c21 100644
--- a/dist/helpers.js
+++ b/dist/helpers.js
@@ -8,7 +8,7 @@
  * is `"key"` if a parent of the key was already mapped to a string (e.g. when
  * merging entry {one: {two: "bla"}} with target {one: "bla"}) or the key was
  * already mapped to a map (e.g. when merging entry {one: "bla"} with target
- * {one: {two: "bla"}}), `"value"` if the same key already exists swith a
+ * {one: {two: "bla"}}), `"value"` if the same key already exists with a
  * different value, or `false`.
  */
 function dotPathToHash(entry) {var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
@@ -83,7 +83,15 @@ function dotPathToHash(entry) {var target = arguments.length > 1 && arguments[1]
   var lastSegment = segments[segments.length - 1];
   var oldValue = inner[lastSegment];
   if (oldValue !== undefined && oldValue !== newValue) {
-    conflict = (0, _typeof2["default"])(oldValue) !== (0, _typeof2["default"])(newValue) ? 'key' : 'value';
+    if ((0, _typeof2["default"])(oldValue) !== (0, _typeof2["default"])(newValue)) {
+      conflict = 'key';
+    } else if (oldValue !== '') {
+      if (newValue === '') {
+        newValue = oldValue;
+      } else {
+        conflict = 'value';
+      }
+    }
   }
   duplicate = oldValue !== undefined || conflict !== false;
 
diff --git a/package.json b/package.json
index 23ffb58..62be4e7 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
   "author": "Karel Ledru",
   "description": "Command Line tool for i18next",
   "name": "i18next-parser",
-  "version": "4.1.1",
+  "version": "4.2.0",
   "license": "MIT",
   "main": "dist/index.js",
   "bin": {
@@ -64,7 +64,7 @@
     "mocha": "^8.3.2",
     "nyc": "^15.1.0",
     "prettier": "2.3.0",
-    "sinon": "^10.0.0"
+    "sinon": "^11.1.1"
   },
   "keywords": [
     "gulpplugin",
diff --git a/src/helpers.js b/src/helpers.js
index dc8184d..2743120 100644
--- a/src/helpers.js
+++ b/src/helpers.js
@@ -8,7 +8,7 @@
  * is `"key"` if a parent of the key was already mapped to a string (e.g. when
  * merging entry {one: {two: "bla"}} with target {one: "bla"}) or the key was
  * already mapped to a map (e.g. when merging entry {one: "bla"} with target
- * {one: {two: "bla"}}), `"value"` if the same key already exists swith a
+ * {one: {two: "bla"}}), `"value"` if the same key already exists with a
  * different value, or `false`.
  */
 function dotPathToHash(entry, target = {}, options = {}) {
@@ -83,7 +83,15 @@ function dotPathToHash(entry, target = {}, options = {}) {
   const lastSegment = segments[segments.length - 1]
   const oldValue = inner[lastSegment]
   if (oldValue !== undefined && oldValue !== newValue) {
-    conflict = typeof oldValue !== typeof newValue ? 'key' : 'value'
+    if (typeof oldValue !== typeof newValue) {
+      conflict = 'key'
+    } else if (oldValue !== '') {
+      if (newValue === '') {
+        newValue = oldValue
+      } else {
+        conflict = 'value'
+      }
+    }
   }
   duplicate = oldValue !== undefined || conflict !== false
 
diff --git a/yarn.lock b/yarn.lock
index b03a863..a502077 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -980,24 +980,24 @@
     readdirp "^2.2.1"
     upath "^1.1.1"
 
-"@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.1":
+"@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.3":
   version "1.8.3"
   resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d"
   integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==
   dependencies:
     type-detect "4.0.8"
 
-"@sinonjs/fake-timers@^6.0.0", "@sinonjs/fake-timers@^6.0.1":
-  version "6.0.1"
-  resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz#293674fccb3262ac782c7aadfdeca86b10c75c40"
-  integrity sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==
+"@sinonjs/fake-timers@^7.0.4", "@sinonjs/fake-timers@^7.1.0":
+  version "7.1.0"
+  resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.0.tgz#8f13af27d842cbf51ad4502e05562fe9391d084e"
+  integrity sha512-hAEzXi6Wbvlb67NnGMGSNOeAflLVnMa4yliPU/ty1qjgW/vAletH15/v/esJwASSIA0YlIyjnloenFbEZc9q9A==
   dependencies:
     "@sinonjs/commons" "^1.7.0"
 
-"@sinonjs/samsam@^5.3.1":
-  version "5.3.1"
-  resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-5.3.1.tgz#375a45fe6ed4e92fca2fb920e007c48232a6507f"
-  integrity sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==
+"@sinonjs/samsam@^6.0.2":
+  version "6.0.2"
+  resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-6.0.2.tgz#a0117d823260f282c04bff5f8704bdc2ac6910bb"
+  integrity sha512-jxPRPp9n93ci7b8hMfJOFDPRLFYadN6FSpeROFTR4UNF4i5b+EK6m4QXPO46BDhFgRy1JuS87zAnFOzCUwMJcQ==
   dependencies:
     "@sinonjs/commons" "^1.6.0"
     lodash.get "^4.4.2"
@@ -1411,11 +1411,6 @@ bindings@^1.5.0:
   dependencies:
     file-uri-to-path "1.0.0"
 
-blank-object@^1.0.1:
-  version "1.0.2"
-  resolved "https://registry.yarnpkg.com/blank-object/-/blank-object-1.0.2.tgz#f990793fbe9a8c8dd013fb3219420bec81d5f4b9"
-  integrity sha1-+ZB5P76ajI3QE/syGUIL7IHV9Lk=
-
 boolbase@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
@@ -1453,19 +1448,16 @@ braces@^3.0.1, braces@~3.0.2:
     fill-range "^7.0.1"
 
 broccoli-funnel@^3.0.4:
-  version "3.0.5"
-  resolved "https://registry.yarnpkg.com/broccoli-funnel/-/broccoli-funnel-3.0.5.tgz#60da33d060fae2936b3d78217bd4008a6eea5e41"
-  integrity sha512-fcjvQIWq4lpKyzQ7FWRo/V8/nOALjIrAoRMFCLgFeO2xhOC1+i7QWbMndLTwpnLCoXpTa+luBu3WSFoxQ3VPlw==
+  version "3.0.7"
+  resolved "https://registry.yarnpkg.com/broccoli-funnel/-/broccoli-funnel-3.0.7.tgz#003c1e90e15f2416ccaad7a12667bfeaed843123"
+  integrity sha512-DuiMqbR3eHY/c5ctOd0d/aqiGcY3r8Ynoz12vxTsEp5vRkFaIRuMhz5w7UHJbMcoC9nMNnY9hGrvVFODngPRXw==
   dependencies:
     array-equal "^1.0.0"
-    blank-object "^1.0.1"
     broccoli-plugin "^4.0.7"
     debug "^4.1.1"
-    fast-ordered-set "^1.0.0"
     fs-tree-diff "^2.0.1"
     heimdalljs "^0.2.0"
     minimatch "^3.0.0"
-    path-posix "^1.0.0"
     walk-sync "^2.0.2"
 
 broccoli-node-api@^1.6.0, broccoli-node-api@^1.7.0:
@@ -2033,9 +2025,9 @@ css-select@^4.1.2:
     nth-check "^2.0.0"
 
 css-what@^5.0.0:
-  version "5.0.0"
-  resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.0.0.tgz#f0bf4f8bac07582722346ab243f6a35b512cfc47"
-  integrity sha512-qxyKHQvgKwzwDWC/rGbT821eJalfupxYW2qbSJSAtdSTimsr/MlaGONoNLllaUPZWf8QnbcKM/kPVYUQuEKAFA==
+  version "5.0.1"
+  resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.0.1.tgz#3efa820131f4669a8ac2408f9c32e7c7de9f4cad"
+  integrity sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==
 
 d@1, d@^1.0.1:
   version "1.0.1"
@@ -2151,16 +2143,11 @@ detect-file@^1.0.0:
   resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7"
   integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=
 
-diff@5.0.0:
+diff@5.0.0, diff@^5.0.0:
   version "5.0.0"
   resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b"
   integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==
 
-diff@^4.0.2:
-  version "4.0.2"
-  resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
-  integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
-
 dom-serializer@^1.0.1, dom-serializer@^1.3.1:
   version "1.3.1"
   resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.1.tgz#d845a1565d7c041a95e5dab62184ab41e3a519be"
@@ -2437,13 +2424,6 @@ fancy-log@^1.3.2:
     parse-node-version "^1.0.0"
     time-stamp "^1.0.0"
 
-fast-ordered-set@^1.0.0:
-  version "1.0.3"
-  resolved "https://registry.yarnpkg.com/fast-ordered-set/-/fast-ordered-set-1.0.3.tgz#3fbb36634f7be79e4f7edbdb4a357dee25d184eb"
-  integrity sha1-P7s2Y097555PftvbSjV97iXRhOs=
-  dependencies:
-    blank-object "^1.0.1"
-
 fb-watchman@^2.0.0:
   version "2.0.1"
   resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85"
@@ -3048,9 +3028,9 @@ https@^1.0.0:
   integrity sha1-PDfHrhqO65ZpBKKtHpdaGUt+06Q=
 
 i18next@^20.2.1:
-  version "20.3.0"
-  resolved "https://registry.yarnpkg.com/i18next/-/i18next-20.3.0.tgz#9558b431241fb1dbbd445174391ede65d0a68ed9"
-  integrity sha512-eFv4aQvaGykp48mI4JEaCcoD/j4zoYjFnDYhChe3ukwvbHx3q4mKZlB8YnmhYrHQR5FopLlCrzcSuY0ZWfiakA==
+  version "20.3.1"
+  resolved "https://registry.yarnpkg.com/i18next/-/i18next-20.3.1.tgz#b51dd281a2eec8087753edf1727e160dac8a5554"
+  integrity sha512-WTY07KreR5z2LBSzAIKs05zpR5tgUT98C4fD96e7Risbc/HZePwF6AEnb9VkjdeSeRn9PDqQBay7ZkphuXt0Xw==
   dependencies:
     "@babel/runtime" "^7.12.0"
 
@@ -3883,13 +3863,13 @@ nice-try@^1.0.4:
   resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
   integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==
 
-nise@^4.1.0:
-  version "4.1.0"
-  resolved "https://registry.yarnpkg.com/nise/-/nise-4.1.0.tgz#8fb75a26e90b99202fa1e63f448f58efbcdedaf6"
-  integrity sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==
+nise@^5.1.0:
+  version "5.1.0"
+  resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.0.tgz#713ef3ed138252daef20ec035ab62b7a28be645c"
+  integrity sha512-W5WlHu+wvo3PaKLsJJkgPup2LrsXCcm7AWwyNZkUnn5rwPkuPBi3Iwk5SQtN0mv+K65k7nKKjwNQ30wg3wLAQQ==
   dependencies:
     "@sinonjs/commons" "^1.7.0"
-    "@sinonjs/fake-timers" "^6.0.0"
+    "@sinonjs/fake-timers" "^7.0.4"
     "@sinonjs/text-encoding" "^0.7.1"
     just-extend "^4.0.2"
     path-to-regexp "^1.7.0"
@@ -4841,17 +4821,17 @@ silent-error@^1.1.1:
   dependencies:
     debug "^2.2.0"
 
-sinon@^10.0.0:
-  version "10.0.0"
-  resolved "https://registry.yarnpkg.com/sinon/-/sinon-10.0.0.tgz#52279f97e35646ff73d23207d0307977c9b81430"
-  integrity sha512-XAn5DxtGVJBlBWYrcYKEhWCz7FLwZGdyvANRyK06419hyEpdT0dMc5A8Vcxg5SCGHc40CsqoKsc1bt1CbJPfNw==
-  dependencies:
-    "@sinonjs/commons" "^1.8.1"
-    "@sinonjs/fake-timers" "^6.0.1"
-    "@sinonjs/samsam" "^5.3.1"
-    diff "^4.0.2"
-    nise "^4.1.0"
-    supports-color "^7.1.0"
+sinon@^11.1.1:
+  version "11.1.1"
+  resolved "https://registry.yarnpkg.com/sinon/-/sinon-11.1.1.tgz#99a295a8b6f0fadbbb7e004076f3ae54fc6eab91"
+  integrity sha512-ZSSmlkSyhUWbkF01Z9tEbxZLF/5tRC9eojCdFh33gtQaP7ITQVaMWQHGuFM7Cuf/KEfihuh1tTl3/ABju3AQMg==
+  dependencies:
+    "@sinonjs/commons" "^1.8.3"
+    "@sinonjs/fake-timers" "^7.1.0"
+    "@sinonjs/samsam" "^6.0.2"
+    diff "^5.0.0"
+    nise "^5.1.0"
+    supports-color "^7.2.0"
 
 slash@^2.0.0:
   version "2.0.0"
@@ -5114,7 +5094,7 @@ supports-color@^5.3.0:
   dependencies:
     has-flag "^3.0.0"
 
-supports-color@^7.1.0:
+supports-color@^7.1.0, supports-color@^7.2.0:
   version "7.2.0"
   resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
   integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
@@ -5309,9 +5289,9 @@ typedarray@^0.0.6:
   integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
 
 typescript@^4.2.4:
-  version "4.2.4"
-  resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961"
-  integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==
+  version "4.3.2"
+  resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805"
+  integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==
 
 uglify-js@^3.1.4:
   version "3.9.1"


Test patch:
diff --git a/test/helpers/dotPathToHash.test.js b/test/helpers/dotPathToHash.test.js
index 198c9a0..1dc8620 100644
--- a/test/helpers/dotPathToHash.test.js
+++ b/test/helpers/dotPathToHash.test.js
@@ -128,4 +128,26 @@ describe('dotPathToHash helper function', () => {
     assert.equal(conflict, 'key')
     done()
   })
+
+  it('uses old value when there is no new value and does not conflict', (done) => {
+    const { target, duplicate, conflict } = dotPathToHash(
+      { keyWithNamespace: 'one.two.three' },
+      { one: { two: { three: 'old' } } }
+    )
+    assert.deepEqual(target, { one: { two: { three: 'old' } } })
+    assert.equal(duplicate, true)
+    assert.equal(conflict, false)
+    done()
+  })
+
+  it('uses new value when there is no old value and does not conflict', (done) => {
+    const { target, duplicate, conflict } = dotPathToHash(
+      { keyWithNamespace: 'one.two.three', defaultValue: 'new' },
+      { one: { two: { three: '' } } }
+    )
+    assert.deepEqual(target, { one: { two: { three: 'new' } } })
+    assert.equal(duplicate, true)
+    assert.equal(conflict, false)
+    done()
+  })
 })