"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.dockerDependency = void 0;
const tslib_1 = require("tslib");
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
const docker_1 = require("../../../datasource/docker");
const docker_2 = require("../../../versioning/docker");
function dockerDependency({ rule: depType, name: depName, tag: currentValue, digest: currentDigest, repository: packageName, registry, }) {
    let dep = null;
    if (depType === 'container_pull' &&
        is_1.default.string(depName) &&
        is_1.default.string(currentValue) &&
        is_1.default.string(currentDigest) &&
        is_1.default.string(packageName) &&
        is_1.default.string(registry)) {
        dep = {
            datasource: docker_1.DockerDatasource.id,
            versioning: docker_2.id,
            depType,
            depName,
            packageName,
            currentValue,
            currentDigest,
            registryUrls: [registry],
        };
    }
    return dep;
}
exports.dockerDependency = dockerDependency;
//# sourceMappingURL=docker.js.map