@nokecy/qc-ui 0.2.3 → 0.2.5

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.
@@ -29,17 +29,21 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
29
29
 
30
30
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
31
31
 
32
+ var esc = function esc(v) {
33
+ return v.replace(/([(),|,\\]|\/i)/g, '\\$1');
34
+ };
35
+
32
36
  var getFilter = function getFilter(objectKey, value) {
33
37
  if (typeof value === 'string') {
34
- return value && value != "" ? "".concat(objectKey, " ^ ").concat(value) : "";
38
+ return value && value != "" ? "".concat(objectKey, " ^ ").concat(esc(value)) : "";
35
39
  }
36
40
 
37
41
  if (typeof value === 'number') {
38
- return "".concat(objectKey, " = ").concat(value);
42
+ return "".concat(objectKey, " = ").concat(esc(value));
39
43
  }
40
44
 
41
45
  if (typeof value === 'boolean') {
42
- return "".concat(objectKey, " = ").concat(value);
46
+ return "".concat(objectKey, " = ").concat(esc(value));
43
47
  }
44
48
 
45
49
  if (value instanceof Array) {
@@ -57,15 +61,15 @@ var getObjectFilter = function getObjectFilter(obj, objKey, items) {
57
61
  var objectKey = "".concat(objKey, ".").concat(key);
58
62
 
59
63
  if (typeof value === 'number') {
60
- items.push("".concat(objectKey, " = ").concat(value));
64
+ items.push("".concat(objectKey, " = ").concat(esc(value)));
61
65
  }
62
66
 
63
67
  if (typeof value === 'string') {
64
- value && value != "" && items.push("".concat(objectKey, " ^ ").concat(value));
68
+ value && value != "" && items.push("".concat(objectKey, " ^ ").concat(esc(value)));
65
69
  }
66
70
 
67
71
  if (typeof value === 'boolean') {
68
- items.push("".concat(objectKey, " = ").concat(value));
72
+ items.push("".concat(objectKey, " = ").concat(esc(value)));
69
73
  }
70
74
 
71
75
  if (value instanceof Array) {
@@ -20,17 +20,21 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
20
20
 
21
21
  import dayjs from 'dayjs';
22
22
 
23
+ var esc = function esc(v) {
24
+ return v.replace(/([(),|,\\]|\/i)/g, '\\$1');
25
+ };
26
+
23
27
  var getFilter = function getFilter(objectKey, value) {
24
28
  if (typeof value === 'string') {
25
- return value && value != "" ? "".concat(objectKey, " ^ ").concat(value) : "";
29
+ return value && value != "" ? "".concat(objectKey, " ^ ").concat(esc(value)) : "";
26
30
  }
27
31
 
28
32
  if (typeof value === 'number') {
29
- return "".concat(objectKey, " = ").concat(value);
33
+ return "".concat(objectKey, " = ").concat(esc(value));
30
34
  }
31
35
 
32
36
  if (typeof value === 'boolean') {
33
- return "".concat(objectKey, " = ").concat(value);
37
+ return "".concat(objectKey, " = ").concat(esc(value));
34
38
  }
35
39
 
36
40
  if (value instanceof Array) {
@@ -48,15 +52,15 @@ var getObjectFilter = function getObjectFilter(obj, objKey, items) {
48
52
  var objectKey = "".concat(objKey, ".").concat(key);
49
53
 
50
54
  if (typeof value === 'number') {
51
- items.push("".concat(objectKey, " = ").concat(value));
55
+ items.push("".concat(objectKey, " = ").concat(esc(value)));
52
56
  }
53
57
 
54
58
  if (typeof value === 'string') {
55
- value && value != "" && items.push("".concat(objectKey, " ^ ").concat(value));
59
+ value && value != "" && items.push("".concat(objectKey, " ^ ").concat(esc(value)));
56
60
  }
57
61
 
58
62
  if (typeof value === 'boolean') {
59
- items.push("".concat(objectKey, " = ").concat(value));
63
+ items.push("".concat(objectKey, " = ").concat(esc(value)));
60
64
  }
61
65
 
62
66
  if (value instanceof Array) {