|
|
@ -2,10 +2,8 @@ import widgets from "widgets/widgets";
|
|
|
|
|
|
|
|
|
|
|
|
export default function validateWidgetData(widget, endpoint, data) {
|
|
|
|
export default function validateWidgetData(widget, endpoint, data) {
|
|
|
|
let valid = true;
|
|
|
|
let valid = true;
|
|
|
|
let dataParsed;
|
|
|
|
let dataParsed = data;
|
|
|
|
if (typeof data === 'object') {
|
|
|
|
if (Buffer.isBuffer(data)) {
|
|
|
|
dataParsed = data;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
dataParsed = JSON.parse(data);
|
|
|
|
dataParsed = JSON.parse(data);
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|