"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractPackageFile = extractPackageFile;
const regex_1 = require("../../../util/regex");
const line_parser_1 = require("./line-parser");
function extractPackageFile(content) {
    const deps = [];
    const lines = content.split(regex_1.newlineRegex);
    for (let lineNumber = 0; lineNumber < lines.length; lineNumber += 1) {
        const line = lines[lineNumber];
        const dep = (0, line_parser_1.parseLine)(line);
        if (!dep) {
            continue;
        }
        dep.managerData ??= {};
        dep.managerData.lineNumber = lineNumber;
        deps.push(dep);
    }
    if (!deps.length) {
        return null;
    }
    return { deps };
}
//# sourceMappingURL=extract.js.map