@cocreate/utils 1.33.3 → 1.33.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,3 +1,10 @@
1
+ ## [1.33.4](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.33.3...v1.33.4) (2024-02-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * $addToSet creates array if undefined ([64d02f9](https://github.com/CoCreate-app/CoCreate-utils/commit/64d02f9d3ee01011ee3701e781850b5e21a16ba6))
7
+
1
8
  ## [1.33.3](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.33.2...v1.33.3) (2024-02-14)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/utils",
3
- "version": "1.33.3",
3
+ "version": "1.33.4",
4
4
  "description": "A simple utils component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "utils",
package/src/index.js CHANGED
@@ -244,6 +244,8 @@
244
244
  } else if (operator === '$pop') {
245
245
  newObject[keys[i]].pop();
246
246
  } else if (operator === '$addToSet') {
247
+ if (!newObject[keys[i]])
248
+ newObject[keys[i]] = []
247
249
  let exists
248
250
  if (Array.isArray(value)) {
249
251
  exists = newObject[keys[i]].some(item => Array.isArray(item) && isEqualArray(item, value));