diginext-utils 1.2.0 → 1.2.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.
Files changed (2) hide show
  1. package/dist/object.js +14 -4
  2. package/package.json +3 -2
package/dist/object.js CHANGED
@@ -5,7 +5,7 @@ require("core-js/modules/es.promise.js");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.toInt = exports.toFloat = exports.toBool = exports.toArray = exports.isNull = void 0;
8
+ exports.toInt = exports.toFloat = exports.toBool = exports.toArray = exports.objectToArray = exports.isNull = void 0;
9
9
 
10
10
  require("core-js/modules/es.regexp.to-string.js");
11
11
 
@@ -43,6 +43,16 @@ const toFloat = object => {
43
43
  object = object.toString();
44
44
  return parseFloat(object);
45
45
  };
46
+
47
+ exports.toFloat = toFloat;
48
+
49
+ const toArray = obj => {
50
+ if (!Array.isArray(obj)) {
51
+ obj = [obj];
52
+ }
53
+
54
+ return obj;
55
+ };
46
56
  /**
47
57
  * Convert value in object to array
48
58
  * @param {object} obj
@@ -50,9 +60,9 @@ const toFloat = object => {
50
60
  */
51
61
 
52
62
 
53
- exports.toFloat = toFloat;
63
+ exports.toArray = toArray;
54
64
 
55
- const toArray = obj => {
65
+ const objectToArray = obj => {
56
66
  const array = [];
57
67
 
58
68
  for (const key in obj) {
@@ -62,4 +72,4 @@ const toArray = obj => {
62
72
  return array;
63
73
  };
64
74
 
65
- exports.toArray = toArray;
75
+ exports.objectToArray = objectToArray;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diginext-utils",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "author": {
5
5
  "name": "TOP GROUP (a.k.a Digitop)",
6
6
  "email": "dev@wearetopgroup.com"
@@ -34,6 +34,7 @@
34
34
  "@babel/polyfill": "^7.12.1",
35
35
  "@babel/preset-react": "^7.18.6",
36
36
  "@babel/runtime": "^7.18.9",
37
+ "babel-plugin-module-resolver": "^4.1.0",
37
38
  "core-js": "^3.24.1",
38
39
  "esm": "^3.2.25",
39
40
  "gsap": "^3.10.4",
@@ -51,4 +52,4 @@
51
52
  "esm": "^3.2.25",
52
53
  "mocha": "^10.0.0"
53
54
  }
54
- }
55
+ }