"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 });
exports.collectArrayExpressionProperties = exports.collectObjectExpressionProperties = void 0;
function collectObjectExpressionProperties(expression) {
    return expression.properties.map((prop) => {
        if (prop.value.type !== 'Identifier') {
            throw new Error('Object destructuring should not reference dynamic properties');
        }
        return prop.value.name;
    });
}
exports.collectObjectExpressionProperties = collectObjectExpressionProperties;
function collectArrayExpressionProperties(expression) {
    return expression.elements.map((prop) => {
        if (prop.type !== 'Identifier') {
            throw new Error('Array destructuring should not reference dynamic properties');
        }
        return prop.name;
    });
}
exports.collectArrayExpressionProperties = collectArrayExpressionProperties;
