"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.minimalRequiredRuntimeCheck = minimalRequiredRuntimeCheck;
var _satisfies = _interopRequireDefault(require("semver/functions/satisfies"));
function minimalRequiredRuntimeCheck({
  packageJson,
  required,
  requiredBy = 'WixPatterns'
}) {
  const {
    version: actual,
    name: packageName
  } = packageJson;
  const satisfies = actual.startsWith('0.0.0') || (0, _satisfies.default)(actual, required);
  if (!satisfies) {
    throw new Error(`[@wix/patterns]: ${packageName}@${actual} does not satisfy ${requiredBy} minimal requirement: ${required}`);
  }
}
//# sourceMappingURL=minimalRequiredRuntimeCheck.js.map