Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function setupOptions({ that, defaultState, props }) {
const editorDemoState = getCurrentParamsFromUrl(props.history.location);
// localStorage.editorDemoState = props.history.location.search;
const massagedEditorDemoState = Object.keys(editorDemoState).reduce(
(acc, key) => {
if (editorDemoState[key] === "false") {
acc[key] = false;
} else if (editorDemoState[key] === "true") {
acc[key] = true;
} else {
acc[key] = editorDemoState[key];
}
return acc;
},
{}
);
try {
that.state = {