"use strict";
/*
 * edge-parser
 *
 * (c) Harminder Virk <virk@adonisjs.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
Object.defineProperty(exports, "__esModule", { value: true });
const transformAst_1 = require("../Parser/transformAst");
exports.default = {
    toStatement(statement, filename, parser) {
        statement.object = (0, transformAst_1.transformAst)(statement.object, filename, parser);
        /**
         * Making the following expressions work
         *
         * user[Object.keys(user).find((k) => k === 'id')]
         * [num1, num2, num3].filter((num) => num % 2 === 0)
         */
        if (statement.property.type !== 'Identifier') {
            statement.property = (0, transformAst_1.transformAst)(statement.property, filename, parser);
        }
        return statement;
    },
};
