import { isObject, isString } from "./helpers.types";
export const parseJSONString = (value) => {
    if (isString(value) && value.length) {
        try {
            console.log(value);
            const parsed = JSON.parse(value);
            if (Array.isArray(parsed) || isObject(parsed)) {
                return parsed;
            }
        }
        catch (e) {
            console.log(e);
            return null;
        }
    }
    return null;
};
export const propsValueToObject = (value) => {
    if (isString(value)) {
        const parsed = parseJSONString(value);
        if (parsed && isObject(parsed)) {
            return parsed;
        }
    }
    else if (isObject(value) && Object.keys(value).length) {
        return value;
    }
    return null;
};
//# sourceMappingURL=object.utils.js.map
