Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function naming(node) {
switch (node.type) {
case Syntax.FunctionExpression:
return build.functionExpression(node.id,
[addresses.shift()].concat(node.params),
node.body);
// add a gensym onto the address variable
case Syntax.CallExpression:
if (isPrimitive(node.callee)) {
return node;
} else {
return build.callExpression(node.callee,
[makeAddressExtension(addresses[0])].concat(node.arguments));
}
default:
}
}
return inProgram(function(node) {
return build.callExpression(driver, [replace(node, {
enter: skip,
leave: trampoline
})]);
})(node, fail('trampoline', node));
}
function generateRelayReferenceField(reference) {
return generateField({
name: reference.field,
description: reference.description || opts.defaultDescription + ' (reference)',
resolve: b.callExpression(
b.identifier('getConnectionResolver'),
[b.literal(reference.model.name)]
),
args: b.property('init', b.identifier('args'), b.identifier('connectionArgs'))
}, b.callExpression(
b.identifier('getConnection'),
[b.literal(reference.model.name)]
));
}
value() {
return b.callExpression(b.identifier('require'), [b.literal(filepath)]);
},
});
b.variableDeclaration('var',
[b.variableDeclarator(
b.identifier('getEntityResolver'),
b.callExpression(
b.identifier('require'),
[b.literal('./util/entity-resolver')]
)
)]
)
];
if (graphql.length) {
declarations.push(b.variableDeclaration('var',
[b.variableDeclarator(
b.identifier('GraphQL'),
b.callExpression(
b.identifier('require'),
[b.literal('graphql')]
)
)]
));
}
if (opts.relay) {
declarations.push(b.variableDeclaration('var',
[b.variableDeclarator(
b.identifier('Node'),
b.callExpression(
b.identifier('require'),
[b.literal('./types/Node')]
)
)]
function mapSlice(node: CRange, meta: Object) {
return b.callExpression(
b.identifier('slice'),
[
mapExpression(node.range.from, meta),
mapExpression(node.range.to, meta),
]
);
}
module.exports = function buildResolver(model) {
return b.callExpression(
b.identifier('getEntityResolver'),
[b.literal(model.name)]
);
};
if (bufferPath === undefined) {
return Promise.resolve();
}
const bufferModulePath = await getModulePath('.', 'buffer', context);
const bufferIndex = getModuleIndex(bufferModulePath, state);
const body = bufferPath.get('body');
body.get(body.value.length - 1).insertBefore(
b.variableDeclaration(
'var',
[
b.variableDeclarator(
b.identifier('Buffer'),
b.memberExpression(
b.memberExpression(
b.callExpression(
b.identifier('__paeckchen_require__'),
[
b.literal(bufferIndex)
]
),
b.identifier('exports'),
false
),
b.identifier('Buffer'),
false
)
)
]
)
);
enqueueModule(bufferModulePath, state, context);