"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const most = require("most");
const formatWarn_1 = require("./utils/formatWarn");
const zooming_1 = require("./utils/zooming");
exports.default = (installCheck$, opts) => {
    return installCheck$
        .map(formatInstallCheck.bind(null, opts.cwd))
        .filter(Boolean)
        .map((msg) => ({ msg }))
        .map(most.of);
};
function formatInstallCheck(currentPrefix, logObj, opts) {
    switch (logObj.code) {
        case 'EBADPLATFORM':
            return zooming_1.autozoom(currentPrefix, logObj['prefix'], formatWarn_1.default(`Unsupported system. Skipping dependency ${logObj.pkgId}`), opts);
        case 'ENOTSUP':
            return zooming_1.autozoom(currentPrefix, logObj['prefix'], logObj.toString(), opts);
        default:
            return;
    }
}
