mobx 6.0.3 → 6.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # mobx
2
2
 
3
+ ## 6.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`79a09f49`](https://github.com/mobxjs/mobx/commit/79a09f49a9f2baddbab8d89e9a7ac07cffadf624) [#2615](https://github.com/mobxjs/mobx/pull/2615) Thanks [@urugator](https://github.com/urugator)! - Fix [#2614](https://github.com/mobxjs/mobx/issues/2614) - `makeObservable` does not respect `options.name`
8
+
3
9
  ## 6.0.3
4
10
 
5
11
  ### Patch Changes
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var niceErrors = {
4
6
  0: "Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",
5
7
  1: function _(prop) {
@@ -4680,8 +4682,15 @@ function asObservableObject(target, name, defaultEnhancer) {
4680
4682
 
4681
4683
  if (hasProp(target, $mobx)) return target[$mobx];
4682
4684
  if ( !Object.isExtensible(target)) die("Cannot make the designated object observable; it is not extensible");
4683
- if (!isPlainObject(target)) name = (target.constructor.name || "ObservableObject") + "@" + getNextId();
4684
- if (!name) name = "ObservableObject@" + getNextId();
4685
+
4686
+ if (!name) {
4687
+ if (isPlainObject(target)) {
4688
+ name = "ObservableObject@" + getNextId();
4689
+ } else {
4690
+ name = (target.constructor.name || "ObservableObject") + "@" + getNextId();
4691
+ }
4692
+ }
4693
+
4685
4694
  var adm = new ObservableObjectAdministration(target, new Map(), stringifyKey(name), defaultEnhancer);
4686
4695
  addHiddenProp(target, $mobx, adm);
4687
4696
  return adm;