Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function createLocationSetWrapper (value: Expression, wrapWithSequence: boolean): Expression {
const tempIdentifier = createTempVarIdentifier();
const locationIdentifier: Identifier = {
type: Syntax.Identifier,
name: 'location'
};
let wrapper: Expression = {
type: Syntax.CallExpression,
callee: {
type: Syntax.MemberExpression,
computed: false,
object: {
type: Syntax.FunctionExpression,
id: null,
params: [],
body: {
type: Syntax.BlockStatement,
body: [
createVarDeclaration(tempIdentifier, value),
{
type: Syntax.ReturnStatement,
argument: {
type: Syntax.LogicalExpression,
operator: '||',
left: {
type: Syntax.CallExpression,