Files
parsshop-back/dist/common/utils/json-transform.util.js
2026-03-26 12:25:46 +03:00

21 lines
541 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseJsonValue = parseJsonValue;
function parseJsonValue({ value }) {
if (value === undefined || value === null || value === '') {
return undefined;
}
if (typeof value === 'object') {
return value;
}
if (typeof value === 'string') {
try {
return JSON.parse(value);
}
catch {
return value;
}
}
return value;
}
//# sourceMappingURL=json-transform.util.js.map