@xuda.io/xuda-get-cast-util-module 1.0.123 → 1.0.125

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/index.mjs +5 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -26,12 +26,12 @@ export const cast = function (
26
26
  case "bool":
27
27
  const true_bool_opt = ["Y", 1, true, "TRUE", "ON", "YES", "1"];
28
28
  const false_bool_opt = ["N", 0, false, "FALSE", "OFF", "NO", "0"];
29
- if (true_bool_opt.includes(_.toUpper(valP))) {
29
+ if (true_bool_opt.includes(String(valP).toUpperCase())) {
30
30
  ret = true;
31
31
  break;
32
32
  }
33
33
 
34
- if (false_bool_opt.includes(_.toUpper(valP)) || !valP) {
34
+ if (false_bool_opt.includes(String(valP).toUpperCase()) || !valP) {
35
35
  ret = false;
36
36
  }
37
37
 
@@ -50,7 +50,7 @@ export const cast = function (
50
50
  if (typeof valP === "boolean") {
51
51
  ret = valP ? 1 : 0;
52
52
  } else {
53
- ret = _.toNumber(valP);
53
+ ret = Number(valP);
54
54
  }
55
55
  // normal behavior studio always store values as string
56
56
  // report_conversion_warn();
@@ -71,7 +71,7 @@ export const cast = function (
71
71
  } else {
72
72
  if (typeof valP !== "string") {
73
73
  try {
74
- ret = _.toString(valP);
74
+ ret = String(valP);
75
75
  report_conversion_warn();
76
76
  } catch (e) {
77
77
  ret = "";
@@ -117,7 +117,7 @@ export const cast = function (
117
117
  } else {
118
118
  if (!Array.isArray(valP)) {
119
119
  try {
120
- ret = _.toArray(eval(valP));
120
+ ret = Array.from(eval(valP));
121
121
  } catch (e) {
122
122
  ret = [];
123
123
  report_conversion_error("[]");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-get-cast-util-module",
3
- "version": "1.0.123",
3
+ "version": "1.0.125",
4
4
  "main": "index.mjs",
5
5
  "type": "module",
6
6
  "description": "Auto-generated build for xuda-get-cast-util-module.mjs",