@abtnode/util 1.16.23-beta-f85576a6 → 1.16.23-beta-aeb9f5bd

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.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Parses boolean strings in an object and converts them to boolean values.
3
+ * @param {Object} obj - The object to parse.
4
+ * @param {Array} [keys] - Optional array of keys to parse. If not provided, all keys in the object will be parsed.
5
+ * @returns {Object} - The object with boolean values parsed from boolean strings.
6
+ * @throws {Error} - If the input is not an object.
7
+ */
8
+ function parseBooleanString(obj, keys) {
9
+ if (typeof obj !== 'object') {
10
+ throw new Error('parseBooleanString should be an object');
11
+ }
12
+
13
+ const newObj = { ...obj };
14
+
15
+ (keys || Object.keys(newObj)).forEach((key) => {
16
+ if (newObj[key] === 'true') {
17
+ newObj[key] = true;
18
+ } else if (newObj[key] === 'false') {
19
+ newObj[key] = false;
20
+ }
21
+ });
22
+
23
+ return newObj;
24
+ }
25
+
26
+ module.exports = parseBooleanString;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.23-beta-f85576a6",
6
+ "version": "1.16.23-beta-aeb9f5bd",
7
7
  "description": "ArcBlock's JavaScript utility",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,10 +18,10 @@
18
18
  "author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
19
19
  "license": "Apache-2.0",
20
20
  "dependencies": {
21
- "@abtnode/constant": "1.16.23-beta-f85576a6",
22
- "@abtnode/logger": "1.16.23-beta-f85576a6",
23
- "@blocklet/constant": "1.16.23-beta-f85576a6",
24
- "@blocklet/meta": "1.16.23-beta-f85576a6",
21
+ "@abtnode/constant": "1.16.23-beta-aeb9f5bd",
22
+ "@abtnode/logger": "1.16.23-beta-aeb9f5bd",
23
+ "@blocklet/constant": "1.16.23-beta-aeb9f5bd",
24
+ "@blocklet/meta": "1.16.23-beta-aeb9f5bd",
25
25
  "@ocap/client": "1.18.108",
26
26
  "@ocap/mcrypto": "1.18.108",
27
27
  "@ocap/util": "1.18.108",
@@ -53,7 +53,7 @@
53
53
  "npm-packlist": "^7.0.4",
54
54
  "p-retry": "4.6.1",
55
55
  "parallel-transform": "^1.2.0",
56
- "pm2": "^5.3.0",
56
+ "pm2": "^5.3.1",
57
57
  "public-ip": "^4.0.4",
58
58
  "pump": "^3.0.0",
59
59
  "semver-sort": "^1.0.0",
@@ -74,7 +74,7 @@
74
74
  "detect-port": "^1.5.1",
75
75
  "express": "^4.18.2",
76
76
  "fs-extra": "^10.1.0",
77
- "jest": "^27.5.1"
77
+ "jest": "^29.7.0"
78
78
  },
79
- "gitHead": "bac83a74944b4cef3ccb386277023caf0e1d5cd4"
79
+ "gitHead": "418cacd970d373aecc8706f8992e57369d394577"
80
80
  }