HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/ehboledensysteem.komma.pro/node_modules/bin-version-check/index.js
'use strict';
var semver = require('semver');
var binVersion = require('bin-version');
var semverTruncate = require('semver-truncate');

module.exports = function (bin, versionRange, cb) {
	if (typeof bin !== 'string' || typeof versionRange !== 'string') {
		throw new Error('`binary` and `versionRange` required');
	}

	if (!semver.validRange(versionRange)) {
		return cb(new Error('Invalid version range'));
	}

	binVersion(bin, function (err, binVersion) {
		if (err) {
			return cb(err);
		}

		if (!semver.satisfies(semverTruncate(binVersion, 'patch'), versionRange)) {
			err = new Error(bin + ' ' + binVersion + ' does not satisfy the version requirement of ' + versionRange);
			err.name = 'InvalidBinVersion';
			return cb(err);
		}

		cb();
	});
};