Update src/standalone.tsx

This commit is contained in:
Roman Hotsiy 2021-04-15 10:09:20 +03:00 committed by GitHub
parent 419dbc71f0
commit 8c2f6cf11c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,8 +32,8 @@ function parseOptionsFromElement(element: Element) {
const res = {};
for (const attrName in attrMap) {
const optionName = attrName.replace(/-(.)/g, (_, $1) => $1.toUpperCase());
const attr = attrMap[attrName];
res[optionName] = attrName === 'theme' ? JSON.parse(attr) : attr;
const optionValue = attrMap[attrName];
res[optionName] = attrName === 'theme' ? JSON.parse(optionValue) : optionValue;
// TODO: normalize options
}
return res;