Repository: i18next/i18next-parser
Pull request #331 (2021-05-27 05:04:52)

Bump sinon from 10.0.0 to 11.1.1
Bumps [sinon](https://github.com/sinonjs/sinon) from 10.0.0 to 11.1.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md">sinon's changelog</a>.</em></p>
<blockquote>
<h1>11.1.1 / 2021-05-26</h1>
<ul>
<li>Fix <a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2379">#2379</a> by using v7 of supports-color</li>
</ul>
<h1>11.1.0 / 2021-05-25</h1>
<ul>
<li>Add sinon.promise() implementation (<a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2369">#2369</a>)</li>
<li>Set wrappedMethod on getters/setters (<a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2378">#2378</a>)</li>
<li>[Docs] Update fake-server usage &amp; descriptions (<a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2365">#2365</a>)</li>
<li>Fake docs improvement (<a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2360">#2360</a>)</li>
<li>Update nise to 5.1.0 (fixed <a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2318">#2318</a>)</li>
</ul>
<h1>11.0.0 / 2021-05-24</h1>
<ul>
<li>Explicitly use samsam 6.0.2 with fix for <a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2345">#2345</a></li>
<li>Update most packages (<a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2371">#2371</a>)</li>
<li>Update compatibility docs (<a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2366">#2366</a>)</li>
<li>Update packages (includes breaking fake-timers change, see <a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2352">#2352</a>)</li>
<li>Warn of potential memory leaks (<a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2357">#2357</a>)</li>
<li>Fix clock test errors</li>
</ul>
<h1>10.0.1 / 2021-04-08</h1>
<ul>
<li>Upgrade sinon components (bumps y18n to 4.0.1)</li>
<li>Bump y18n from 4.0.0 to 4.0.1</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/sinonjs/sinon/commit/a9801c933b11fab6c929c06385b9055f852e983e"><code>a9801c9</code></a> 11.1.1</li>
<li><a href="https://github.com/sinonjs/sinon/commit/03a5ca0fc9be2e2f5d35cc754b05784db7fb78db"><code>03a5ca0</code></a> Update CHANGELOG.md and AUTHORS for new release</li>
<li><a href="https://github.com/sinonjs/sinon/commit/b18193ef38e433fcb8299546bf9c80c4f5ba053b"><code>b18193e</code></a> Fix <a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2379">#2379</a> by using v7 of supports-color</li>
<li><a href="https://github.com/sinonjs/sinon/commit/31be9a5d5a4762ef01cb195f29024616dfee9ce8"><code>31be9a5</code></a> Update docs/changelog.md and set new release id in docs/_config.yml</li>
<li><a href="https://github.com/sinonjs/sinon/commit/b901a0225571fe30734a0d752a60bcb3a7c315f8"><code>b901a02</code></a> Add release documentation for v11.1.0</li>
<li><a href="https://github.com/sinonjs/sinon/commit/b91c9551d78b85a7052e87300349e1f06f79d352"><code>b91c955</code></a> 11.1.0</li>
<li><a href="https://github.com/sinonjs/sinon/commit/9581e27a7923d82a006404f05d93273f65ad7042"><code>9581e27</code></a> Update CHANGELOG.md and AUTHORS for new release</li>
<li><a href="https://github.com/sinonjs/sinon/commit/0e1ed1290c0904f077e5a7ec4b7da0bc5b0fdc90"><code>0e1ed12</code></a> Make sure to link to the right folder ...</li>
<li><a href="https://github.com/sinonjs/sinon/commit/8f787c6b312a9e774d3a824c7e81b59ec118bb4f"><code>8f787c6</code></a> Exit on errors</li>
<li><a href="https://github.com/sinonjs/sinon/commit/7f271ffdab20574d5f0bb4b39053068138c8d655"><code>7f271ff</code></a> Add sinon.promise() implementation (<a href="https://github-redirect.dependabot.com/sinonjs/sinon/issues/2369">#2369</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/sinonjs/sinon/compare/v10.0.0...v11.1.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=sinon&package-manager=npm_and_yarn&previous-version=10.0.0&new-version=11.1.1)](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/331?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next) Report
> Merging [#331](https://codecov.io/gh/i18next/i18next-parser/pull/331?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next) (14637bb) 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/331/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/331?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next)

```diff
@@           Coverage Diff           @@
##           master     #331   +/-   ##
=======================================
  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/331?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/331?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=i18next). Last update [a7075bc...14637bb](https://codecov.io/gh/i18next/i18next-parser/pull/331?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..d32db88 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==


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()
+  })
 })