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

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

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

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

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