roboto-js 1.4.45 → 1.4.46
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.
- package/dist/cjs/rbt_user.cjs +8 -2
- package/dist/esm/rbt_user.js +8 -2
- package/package.json +1 -1
- package/src/rbt_user.js +9 -2
package/dist/cjs/rbt_user.cjs
CHANGED
|
@@ -151,8 +151,14 @@ var RbtUser = exports["default"] = /*#__PURE__*/function () {
|
|
|
151
151
|
value: function _deepUnpackJson(value) {
|
|
152
152
|
if (typeof value === 'string') {
|
|
153
153
|
try {
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
// Only parse as JSON if it's not a large number
|
|
155
|
+
// https://chatgpt.com/c/6745902c-edf4-800c-ab52-31bf27dde2bd
|
|
156
|
+
//
|
|
157
|
+
if (!/^\d{16,}$/.test(value)) {
|
|
158
|
+
var parsed = JSON.parse(value);
|
|
159
|
+
// Recursively parse if the result is a string, object, or array
|
|
160
|
+
return this._deepUnpackJson(parsed);
|
|
161
|
+
}
|
|
156
162
|
} catch (e) {
|
|
157
163
|
return value; // Return the original string if parsing fails
|
|
158
164
|
}
|
package/dist/esm/rbt_user.js
CHANGED
|
@@ -92,8 +92,14 @@ export default class RbtUser {
|
|
|
92
92
|
_deepUnpackJson(value) {
|
|
93
93
|
if (typeof value === 'string') {
|
|
94
94
|
try {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
// Only parse as JSON if it's not a large number
|
|
96
|
+
// https://chatgpt.com/c/6745902c-edf4-800c-ab52-31bf27dde2bd
|
|
97
|
+
//
|
|
98
|
+
if (!/^\d{16,}$/.test(value)) {
|
|
99
|
+
const parsed = JSON.parse(value);
|
|
100
|
+
// Recursively parse if the result is a string, object, or array
|
|
101
|
+
return this._deepUnpackJson(parsed);
|
|
102
|
+
}
|
|
97
103
|
} catch (e) {
|
|
98
104
|
return value; // Return the original string if parsing fails
|
|
99
105
|
}
|
package/package.json
CHANGED
package/src/rbt_user.js
CHANGED
|
@@ -112,8 +112,15 @@ export default class RbtUser {
|
|
|
112
112
|
_deepUnpackJson(value){
|
|
113
113
|
if (typeof value === 'string') {
|
|
114
114
|
try {
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
|
|
116
|
+
// Only parse as JSON if it's not a large number
|
|
117
|
+
// https://chatgpt.com/c/6745902c-edf4-800c-ab52-31bf27dde2bd
|
|
118
|
+
//
|
|
119
|
+
if (!/^\d{16,}$/.test(value)) {
|
|
120
|
+
const parsed = JSON.parse(value);
|
|
121
|
+
// Recursively parse if the result is a string, object, or array
|
|
122
|
+
return this._deepUnpackJson(parsed);
|
|
123
|
+
}
|
|
117
124
|
} catch (e) {
|
|
118
125
|
return value; // Return the original string if parsing fails
|
|
119
126
|
}
|