@dartech/arsenal-ui 1.4.34 → 1.4.35
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +4 -2
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1189,12 +1189,14 @@ const ControlAceEditor = /*#__PURE__*/forwardRef((_a, ref) => {
|
|
1189
1189
|
python: [langs.python()]
|
1190
1190
|
}), []);
|
1191
1191
|
const safeValue = useMemo(() => {
|
1192
|
-
if (mode === 'text' && typeof value !== 'string')
|
1192
|
+
if (mode === 'text' && typeof value !== 'string') {
|
1193
|
+
return JSON.stringify(value, null, 2);
|
1194
|
+
}
|
1193
1195
|
if (mode === 'json' && typeof value !== 'string') {
|
1194
1196
|
if (value === null) return '';
|
1195
1197
|
return useCleanValue ? JSON.stringify(value, null, 2).replace(/\\"/g, '') : JSON.stringify(value, null, 2);
|
1196
1198
|
}
|
1197
|
-
if (typeof value === 'string') {
|
1199
|
+
if (typeof value === 'string' && mode !== 'text') {
|
1198
1200
|
return useCleanValue ? value.replace(/\\"/g, '') : value;
|
1199
1201
|
}
|
1200
1202
|
return value;
|