@cocreate/utils 1.33.7 → 1.34.1

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,25 @@
1
+ ## [1.34.1](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.34.0...v1.34.1) (2024-06-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update dependencies ([e9dc689](https://github.com/CoCreate-app/CoCreate-utils/commit/e9dc6898ed20f61829805676a23ca912a09c1697))
7
+
8
+ # [1.34.0](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.33.7...v1.34.0) (2024-06-12)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * bump cocreate dependencies ([08a6820](https://github.com/CoCreate-app/CoCreate-utils/commit/08a68208699370ba5bef8fce082d9d038837f28d))
14
+ * continue if property is $options ([ea10a5a](https://github.com/CoCreate-app/CoCreate-utils/commit/ea10a5a2dce77390cf3aced0f881e66ad8b5df16))
15
+ * handling $inc operator update ([2260162](https://github.com/CoCreate-app/CoCreate-utils/commit/22601620df4a2aaaa0f16b00e907bbe6b164b315))
16
+ * svg icon class ([edef3c2](https://github.com/CoCreate-app/CoCreate-utils/commit/edef3c2bc9cd98f9c60c60b7a783d83473f3dd9a))
17
+
18
+
19
+ ### Features
20
+
21
+ * suport options for regex operator ([78a3c4d](https://github.com/CoCreate-app/CoCreate-utils/commit/78a3c4d33e7e6d8ec957d94e92a1b740865e0307))
22
+
1
23
  ## [1.33.7](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.33.6...v1.33.7) (2024-04-29)
2
24
 
3
25
 
package/docs/index.html CHANGED
@@ -81,43 +81,33 @@
81
81
  class="margin-right:15px"
82
82
  share-network="twitter"
83
83
  title="Share on twitter"
84
- ><i
85
- class="height:20px fill:#505050"
86
- src="/assets/svg/twitter.svg"></i
84
+ ><i src="/assets/svg/twitter.svg"></i
87
85
  ></a>
88
86
  <a
89
87
  class="margin-right:15px"
90
88
  share-network="facebook"
91
89
  title="Share on Facebook"
92
- ><i
93
- class="height:20px fill:#505050"
94
- src="/assets/svg/facebook.svg"></i
90
+ ><i src="/assets/svg/facebook.svg"></i
95
91
  ></a>
96
92
  <a
97
93
  class="margin-right:15px"
98
94
  share-network="instagram"
99
95
  title="Share on instagram"
100
- ><i
101
- class="height:20px fill:#505050"
102
- src="/assets/svg/instagram.svg"></i
96
+ ><i src="/assets/svg/instagram.svg"></i
103
97
  ></a>
104
98
  </div>
105
99
  <a
106
100
  class="margin-right:15px"
107
101
  share-network="share"
108
102
  title="Share on share"
109
- ><i
110
- class="height:20px fill:#505050"
111
- src="/assets/svg/share-alt.svg"></i
103
+ ><i src="/assets/svg/share-alt.svg"></i
112
104
  ></a>
113
105
  </div>
114
106
  <a
115
107
  href="https://github.com/CoCreate-app/CoCreate-utils"
116
108
  target="_blank"
117
109
  class="margin-right:15px"
118
- ><i
119
- class="height:20px fill:#505050"
120
- src="/assets/svg/github.svg"></i
110
+ ><i src="/assets/svg/github.svg"></i
121
111
  ></a>
122
112
  </div>
123
113
  </div>
@@ -143,9 +133,7 @@
143
133
  <a
144
134
  class="margin-left:10px display:none"
145
135
  href="#utils-install"
146
- ><i
147
- class="height:20px fill:#505050"
148
- src="/assets/svg/link.svg"></i
136
+ ><i src="/assets/svg/link.svg"></i
149
137
  ></a>
150
138
  </span>
151
139
  </div>
@@ -170,9 +158,7 @@
170
158
  <a
171
159
  class="margin-left:10px display:none"
172
160
  href="#utils-usage"
173
- ><i
174
- class="height:20px fill:#505050"
175
- src="/assets/svg/link.svg"></i
161
+ ><i src="/assets/svg/link.svg"></i
176
162
  ></a>
177
163
  </span>
178
164
  </div>
@@ -195,9 +181,7 @@
195
181
  <a
196
182
  class="margin-left:10px display:none"
197
183
  href="#utils-attributes"
198
- ><i
199
- class="height:20px fill:#505050"
200
- src="/assets/svg/link.svg"></i
184
+ ><i src="/assets/svg/link.svg"></i
201
185
  ></a>
202
186
  </span>
203
187
  </div>
@@ -248,9 +232,7 @@
248
232
  <a
249
233
  class="margin-left:10px display:none"
250
234
  href="#utils-demo"
251
- ><i
252
- class="height:20px fill:#505050"
253
- src="/assets/svg/link.svg"></i
235
+ ><i src="/assets/svg/link.svg"></i
254
236
  ></a>
255
237
  </span>
256
238
  </div>
@@ -297,7 +279,7 @@
297
279
  toggle="code-height"
298
280
  toggle-selector="#demo-code"
299
281
  ><i
300
- class="height:18px fill:#505050"
282
+ class="height:18px"
301
283
  src="/assets/svg/eye.svg"></i
302
284
  ></a>
303
285
  <a
@@ -308,18 +290,14 @@
308
290
  hide="#eye-slash"
309
291
  toggle="code-height"
310
292
  toggle-selector="#demo-code"
311
- ><i
312
- class="height:20px fill:#505050"
313
- src="/assets/svg/eye-slash.svg"></i
293
+ ><i src="/assets/svg/eye-slash.svg"></i
314
294
  ></a>
315
295
  <a
316
296
  class="margin-right:10px"
317
297
  id="code"
318
298
  show="#code-slash"
319
299
  hide="#code, #demo-code"
320
- ><i
321
- class="height:20px fill:#505050"
322
- src="/assets/svg/code.svg"></i
300
+ ><i src="/assets/svg/code.svg"></i
323
301
  ></a>
324
302
  <a
325
303
  class="margin-right:10px"
@@ -328,7 +306,7 @@
328
306
  show="#code, #demo-code"
329
307
  hide="#code-slash"
330
308
  ><i
331
- class="display:flex height:18px fill:#505050"
309
+ class="height:18px"
332
310
  src="/assets/svg/code.svg"></i
333
311
  ></a>
334
312
  <a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/utils",
3
- "version": "1.33.7",
3
+ "version": "1.34.1",
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
@@ -279,7 +279,10 @@
279
279
  else
280
280
  newObject[keys[i]].push(...value);
281
281
  } else if (operator === '$inc') {
282
- newObject[keys[i]] += value
282
+ if (!newObject[keys[i]] || typeof newObject[keys[i]] !== "number")
283
+ newObject[keys[i]] = value
284
+ else
285
+ newObject[keys[i]] += value
283
286
  }
284
287
  } else if (value === undefined) {
285
288
  if (typeof keys[i] === 'number')
@@ -611,6 +614,8 @@
611
614
  }
612
615
  } else {
613
616
  for (let property of Object.keys(query[key])) {
617
+ if (property === '$options')
618
+ continue
614
619
  if (!property.startsWith('$')) {
615
620
  if (typeof dataValue !== 'object') {
616
621
  return false;
@@ -687,7 +692,8 @@
687
692
  break;
688
693
  case '$regex':
689
694
  if (typeof dataValue === 'string') {
690
- let regex = new RegExp(queryValue);
695
+ let regexFlag = query[key]['$options'] || ''
696
+ let regex = new RegExp(queryValue, regexFlag)
691
697
  queryStatus = regex.test(dataValue);
692
698
  }
693
699
  break;