Skip to content

Commit

Permalink
Care about old browsers more
Browse files Browse the repository at this point in the history
Stop using Object.entries and an arrow function
  • Loading branch information
hmsk committed Mar 9, 2020
1 parent 29bc3b6 commit ae4020e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions index.js
Expand Up @@ -95,7 +95,7 @@ module.exports = function (source) {
};

const compiled = compileVueTemplate(compileOptions);
addPrepend(`const extractVueFunctions = () => {\n${compiled.code}\nreturn { render, staticRenderFns }\n}\nconst vueFunctions = extractVueFunctions()`);
addPrepend(`function extractVueFunctions () {\n${compiled.code}\nreturn { render, staticRenderFns }\n}\nconst vueFunctions = extractVueFunctions()`);

let vueOutput = '';

Expand Down Expand Up @@ -156,13 +156,11 @@ module.exports = function (source) {

const reactComponent = `
function (props) {
Object.entries(props).forEach(function (prop) {
const key = prop[0]
const value = prop[1]
this[key] = value;
});
Object.keys(props).forEach(function (key) {
this[key] = props[key]
})
${compiled.code}
return markdown;
return markdown
}
`
addProperty('react', reactComponent);
Expand Down

0 comments on commit ae4020e

Please sign in to comment.