"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isDefined = isDefined;
exports.isDockerMessage = isDockerMessage;
exports.isFunction = isFunction;
exports.isImageError = isImageError;
exports.isObject = isObject;
exports.isProcessMessage = isProcessMessage;
exports.isStoriesMessage = isStoriesMessage;
exports.isString = isString;
exports.isTest = isTest;
exports.isTestMessage = isTestMessage;
exports.isWebpackMessage = isWebpackMessage;
exports.isWorkerMessage = isWorkerMessage;
exports.noop = noop;
/* eslint-disable @typescript-eslint/no-explicit-any */

/* eslint-enable @typescript-eslint/no-explicit-any */

// eslint-disable-next-line @typescript-eslint/no-explicit-any

function noop() {
  /* noop */
}
function isDefined(value) {
  return value !== null && value !== undefined;
}
function isTest(x) {
  return isDefined(x) && 'id' in x && 'storyId' in x && typeof x.id == 'string' && typeof x.storyId == 'string';
}
function isObject(x) {
  return typeof x == 'object' && x != null;
}
function isString(x) {
  return typeof x == 'string';
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function isFunction(x) {
  return typeof x == 'function';
}
function isImageError(error) {
  return error instanceof Error && 'images' in error;
}
function isProcessMessage(message) {
  return isObject(message) && 'scope' in message;
}
function isWorkerMessage(message) {
  return isProcessMessage(message) && message.scope == 'worker';
}
function isStoriesMessage(message) {
  return isProcessMessage(message) && message.scope == 'stories';
}
function isTestMessage(message) {
  return isProcessMessage(message) && message.scope == 'test';
}
function isWebpackMessage(message) {
  return isProcessMessage(message) && message.scope == 'webpack';
}
function isDockerMessage(message) {
  return isProcessMessage(message) && message.scope == 'docker';
}