Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function main(opts) {
var t = require('babel-core').types;
// main function declaration
var expr = t.functionDeclaration(t.identifier(opts.main), [t.identifier(ELEM)], t.blockStatement([t.returnStatement(t.callExpression(t.memberExpression(t.memberExpression(t.identifier(opts.templates), t.callExpression(t.memberExpression(t.memberExpression(t.identifier(ELEM), t.identifier(TAG_NAME)), t.identifier(TO_LOWER_CASE)), []), true), t.identifier('call')), [t.identifier(ELEM), t.identifier(ELEM)]))]));
return t.program([expr]);
}
function main(opts) {
var t = require('babel-core').types;
opts = opts || {};
opts.main = opts.main || MAIN;
opts.templates = opts.templates || TEMPLATES;
// main function declaration
var expr = t.functionDeclaration(t.identifier(opts.main), [t.identifier(ELEM)], t.blockStatement([t.returnStatement(t.callExpression(t.memberExpression(t.memberExpression(t.identifier(opts.templates), t.callExpression(t.memberExpression(t.memberExpression(t.identifier(ELEM), t.identifier(TAG_NAME)), t.identifier(TO_LOWER_CASE)), []), true), t.identifier('call')), [t.identifier(ELEM), t.identifier(ELEM)]))]));
return t.program([expr]);
}
const t = require('babel-core').types;
opts = options(opts);
// main function declaration
let expr = t.functionDeclaration(
t.identifier(opts.main),
[t.identifier(ELEM)],
t.blockStatement(
[
t.returnStatement(
t.callExpression(
t.memberExpression(
t.memberExpression(
t.identifier(opts.templates),
t.callExpression(
t.memberExpression(
t.memberExpression(
t.identifier(ELEM),
t.identifier(TAG_NAME)
),
t.identifier(TO_LOWER_CASE)
),
[]
),
true
),
t.identifier('call')
),
[t.identifier(ELEM), t.identifier(ELEM)]
)
)
]
export default function compile(quasi, node) {
t.assertTemplateLiteral(node)
const strings = node.quasis.map((child) => child.value.raw)
const source = concat(strings)
const ast = parse(source)
const replacement = transformer.run(ast, {
arguments: node.expressions,
})
return t.functionExpression(null, [t.identifier('params')], t.blockStatement([
t.variableDeclaration('const', [
t.variableDeclarator(t.identifier('GraphQL'), t.memberExpression(quasi, t.identifier('GraphQL'))),
]),
t.returnStatement(replacement),
]))
}
function createMapLookup(dependencyMapIdentifier, propertyIdentifier) {
return types.memberExpression(
dependencyMapIdentifier,
propertyIdentifier,
true,
);
}
function createMapLookup(dependencyMapIdentifier, propertyIdentifier) {
return types.memberExpression(
dependencyMapIdentifier,
propertyIdentifier,
true,
);
}
function createMapLookup(dependencyMapIdentifier, propertyIdentifier) {
return types.memberExpression(
dependencyMapIdentifier,
propertyIdentifier,
true,
);
}