"use strict";
/**
 * Copyright: (c) Myia SAS 2026.
 * This file and its contents are licensed under the AGPLv3 License.
 * Please see the LICENSE file at the root of this repository
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.createForHeadDeclarationDetector = createForHeadDeclarationDetector;
function createForHeadDeclarationDetector(t) {
    return function isForHeadDeclaration(declaration, parent) {
        if (t.isForStatement(parent) && parent.init === declaration)
            return true;
        if ((t.isForInStatement(parent) || t.isForOfStatement(parent)) && parent.left === declaration) {
            return true;
        }
        return false;
    };
}
