@nocobase/utils 1.9.5 → 1.9.6

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.
Files changed (2) hide show
  1. package/lib/assign.js +14 -1
  2. package/package.json +2 -2
package/lib/assign.js CHANGED
@@ -45,7 +45,10 @@ var import_deepmerge = __toESM(require("deepmerge"));
45
45
  var import_lodash = __toESM(require("lodash"));
46
46
  var import_common = require("./common");
47
47
  function getEnumerableOwnPropertySymbols(target) {
48
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter((symbol) => target.propertyIsEnumerable(symbol)) : [];
48
+ return Object.getOwnPropertySymbols ? (
49
+ // eslint-disable-next-line no-prototype-builtins
50
+ Object.getOwnPropertySymbols(target).filter((symbol) => target.propertyIsEnumerable(symbol))
51
+ ) : [];
49
52
  }
50
53
  __name(getEnumerableOwnPropertySymbols, "getEnumerableOwnPropertySymbols");
51
54
  function getKeys(target) {
@@ -113,12 +116,22 @@ mergeStrategies.set("union", (x, y) => {
113
116
  mergeStrategies.set(
114
117
  "intersect",
115
118
  (x, y) => (() => {
119
+ console.log("intersect inputs:", x, y);
116
120
  if (typeof x === "string") {
117
121
  x = x.split(",");
118
122
  }
119
123
  if (typeof y === "string") {
120
124
  y = y.split(",");
121
125
  }
126
+ if (typeof x === "object" && !Array.isArray(x)) {
127
+ x = Object.values(x || {});
128
+ }
129
+ if (typeof y === "object" && !Array.isArray(y)) {
130
+ y = Object.values(y || {});
131
+ }
132
+ if (!Array.isArray(x) || x.length === 0) {
133
+ return y || [];
134
+ }
122
135
  if (!Array.isArray(x) || x.length === 0) {
123
136
  return y || [];
124
137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/utils",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "license": "AGPL-3.0",
@@ -16,5 +16,5 @@
16
16
  "multer": "^1.4.5-lts.2",
17
17
  "object-path": "^0.11.8"
18
18
  },
19
- "gitHead": "b65aca61cfcc713b9bee2fec844c00db21cb1f3b"
19
+ "gitHead": "41d65e6f29a10dc73471cc70b0b1c2b6fe9aacfd"
20
20
  }