Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function compileVueToRn(resource) {
var code = resource.toString();
var cparsed = compiler.parseComponent(code, { pad: 'line' });
var output = '';
var mappings = '';
// add react-vue import
output += "import " + (constants.VUE) + ", { observer as " + (constants.OBSERVER) + " } from 'vue-native-core'";
output += '\n';
// // add react import
// output += `import ${constants.REACT} from 'react'`
// output += '\n';
// add react-native import
output += "import " + (constants.REACT_NATIVE) + " from 'react-native'";
output += '\n';
export function compileVueToRn(resource) {
const code = resource.toString();
const cparsed = compiler.parseComponent(code, { pad: 'line' });
let output = '';
let mappings = '';
// add react-vue import
output += `import ${constants.VUE}, { observer as ${
constants.OBSERVER
} } from 'vue-native-core'`;
output += '\n';
// // add react import
// output += `import ${constants.REACT} from 'react'`
// output += '\n';
// add react-native import
output += `import ${constants.REACT_NATIVE} from 'react-native'`;
function parseTemplate(code) {
const obj = compiler.nativeCompiler(code);
return {
import: obj.importCode,
render: `const ${constants.TEMPLATE_RENDER} = ${obj.renderCode}`
};
}
function parseTemplate(code) {
var obj = compiler.nativeCompiler(code);
return {
import: obj.importCode,
render: ("const " + (constants.TEMPLATE_RENDER) + " = " + (obj.renderCode))
};
}
function parseTemplate(template) {
if (!template) {
return defaultTemplate;
}
const { content, lang } = template;
const trimmedContent = content.replace(/\/\/\n/g, '');
const transpiledContent = transpileTemplateContent(trimmedContent, lang);
if (transpiledContent) {
const obj = compiler.nativeCompiler(transpiledContent);
return {
import: obj.importCode,
render: `const ${constants.TEMPLATE_RENDER} = ${obj.renderCode}`,
};
}
}