@box/metadata-editor 0.60.3 → 0.60.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.
@@ -1,4 +1,4 @@
1
- import v from "lodash/isEmpty";
1
+ import h from "lodash/isEmpty";
2
2
  import O from "lodash/isArray";
3
3
  import { TEMPLATE_CUSTOM_PROPERTIES as f } from "../../../../constants.js";
4
4
  const n = {
@@ -6,19 +6,19 @@ const n = {
6
6
  REMOVE: "remove",
7
7
  REPLACE: "replace",
8
8
  TEST: "test"
9
- }, o = (e) => e.value === null || e.value === "" || O(e.value) && v(e.value), S = (e, s) => {
10
- const p = [], c = e.metadata.fields, r = s.templateKey === f, m = new Map(s.fields.map((t) => [t.key, t])), h = new Map(c.map((t) => [t.key, t]));
9
+ }, p = (e) => e.value === void 0 || e.value === null || e.value === "" || O(e.value) && h(e.value), S = (e, s) => {
10
+ const o = [], c = e.metadata.fields, r = s.templateKey === f, v = new Map(s.fields.map((t) => [t.key, t])), m = new Map(c.map((t) => [t.key, t]));
11
11
  return c.forEach((t) => {
12
- const a = m.get(t.key);
13
- a ? JSON.stringify(t) === JSON.stringify(a) || (!r && o(a) && !o(t) ? p.push(y(t.key, u(t))) : (
12
+ const a = v.get(t.key);
13
+ a ? JSON.stringify(t) === JSON.stringify(a) || (!r && p(a) && !p(t) ? o.push(y(t.key, u(t))) : (
14
14
  // template instance
15
- (!r && t.value !== a.value && a.value !== null && !o(t) || // custom instance
16
- r && t.value !== a.value) && (p.push(E(a.key, u(a))), p.push(M(t.key, u(t))))
17
- )) : p.push(y(t.key, t.value));
15
+ (!r && t.value !== a.value && a.value !== null && !p(t) || // custom instance
16
+ r && t.value !== a.value) && (o.push(E(a.key, u(a))), o.push(M(t.key, u(t))))
17
+ )) : o.push(y(t.key, t.value));
18
18
  }), s.fields.forEach((t) => {
19
- const a = h.get(t.key);
20
- (!a || !r && o(a) && !o(t)) && (p.push(E(t.key, u(t))), p.push(k(t.key)));
21
- }), p;
19
+ const a = m.get(t.key);
20
+ (!a || !r && p(a) && !p(t)) && (o.push(E(t.key, u(t))), o.push(k(t.key)));
21
+ }), o;
22
22
  }, u = (e) => e.type === "float" ? Number(e.value) : e.value, E = (e, s) => ({
23
23
  op: n.TEST,
24
24
  path: `/${e}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/metadata-editor",
3
- "version": "0.60.3",
3
+ "version": "0.60.4",
4
4
  "peerDependencies": {
5
5
  "@ariakit/react": "0.4.5",
6
6
  "@box/blueprint-web": "^7.30.3",
@@ -53,5 +53,5 @@
53
53
  "**/*.css"
54
54
  ],
55
55
  "license": "SEE LICENSE IN LICENSE",
56
- "gitHead": "4853233b3f41ca53ca43c8d67896328a8905a9d5"
56
+ "gitHead": "cc88fe6001296a03f1dfce7edec7b6cd1b0ed9f0"
57
57
  }