@usertour/helpers 0.0.34 → 0.0.36

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 (36) hide show
  1. package/dist/__tests__/attribute.test.cjs +10 -1
  2. package/dist/__tests__/attribute.test.js +2 -1
  3. package/dist/__tests__/condition.test.cjs +1008 -21
  4. package/dist/__tests__/condition.test.js +902 -4
  5. package/dist/__tests__/get-attribute-type.test.cjs +195 -0
  6. package/dist/__tests__/get-attribute-type.test.d.cts +2 -0
  7. package/dist/__tests__/get-attribute-type.test.d.ts +2 -0
  8. package/dist/__tests__/get-attribute-type.test.js +133 -0
  9. package/dist/__tests__/time.test.cjs +482 -42
  10. package/dist/__tests__/time.test.js +349 -28
  11. package/dist/attribute.cjs +111 -0
  12. package/dist/attribute.d.cts +5 -0
  13. package/dist/attribute.d.ts +5 -0
  14. package/dist/attribute.js +12 -0
  15. package/dist/{chunk-A4KMGXB3.js → chunk-3UOSPZEP.js} +4 -4
  16. package/dist/chunk-EEYZG4JJ.js +78 -0
  17. package/dist/chunk-JQWKLXW6.js +147 -0
  18. package/dist/{chunk-7JXEY4A2.js → chunk-KYDXF7SU.js} +5 -1
  19. package/dist/conditions/attribute.cjs +10 -1
  20. package/dist/conditions/attribute.js +2 -1
  21. package/dist/conditions/condition.cjs +110 -20
  22. package/dist/conditions/condition.js +4 -3
  23. package/dist/conditions/index.cjs +152 -19
  24. package/dist/conditions/index.d.cts +1 -1
  25. package/dist/conditions/index.d.ts +1 -1
  26. package/dist/conditions/index.js +14 -5
  27. package/dist/conditions/time.cjs +150 -18
  28. package/dist/conditions/time.d.cts +29 -2
  29. package/dist/conditions/time.d.ts +29 -2
  30. package/dist/conditions/time.js +12 -3
  31. package/dist/index.cjs +209 -19
  32. package/dist/index.d.cts +2 -1
  33. package/dist/index.d.ts +2 -1
  34. package/dist/index.js +20 -4
  35. package/package.json +2 -2
  36. package/dist/chunk-CEK3SCQO.js +0 -31
@@ -6,6 +6,15 @@ var import_types2 = require("@usertour/types");
6
6
  // src/conditions/attribute.ts
7
7
  var import_types = require("@usertour/types");
8
8
  var import_date_fns = require("date-fns");
9
+
10
+ // src/type-utils.ts
11
+ var nativeIsArray = Array.isArray;
12
+ var ObjProto = Object.prototype;
13
+ var objToString = ObjProto.toString;
14
+ var objHasOwn = ObjProto.hasOwnProperty;
15
+ var isArray = nativeIsArray || ((obj) => objToString.call(obj) === "[object Array]");
16
+
17
+ // src/conditions/attribute.ts
9
18
  function evaluateFilterConditions(conditions, options) {
10
19
  if (!conditions || !conditions.length) {
11
20
  return true;
@@ -154,7 +163,7 @@ function evaluateBooleanCondition(logic, actualValue) {
154
163
  }
155
164
  }
156
165
  function evaluateListCondition(logic, actualValue, expectedValues) {
157
- const arrayValue = Array.isArray(actualValue) ? actualValue : [];
166
+ const arrayValue = isArray(actualValue) ? actualValue : [];
158
167
  if (logic === "empty" || logic === "any") {
159
168
  switch (logic) {
160
169
  case "empty":
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  evaluateAttributeCondition,
3
3
  evaluateFilterConditions
4
- } from "../chunk-7JXEY4A2.js";
4
+ } from "../chunk-KYDXF7SU.js";
5
+ import "../chunk-GFH3VWOC.js";
5
6
  import "../chunk-XEO3YXBM.js";
6
7
 
7
8
  // src/__tests__/attribute.test.ts