function contentDependency(item) {
  if (!item || typeof item === "function") {
    return item;
  }
  if (Array.isArray(item)) {
    return JSON.stringify([...item].sort());
  }
  if (typeof item === "object") {
    return JSON.stringify(Object.keys(item).sort().reduce((memo, key) => ({ ...memo, [key]: item[key] }), {}));
  }
  return `${item}`;
}
function mergeDeep(target, ...sources) {
  if (!target || typeof target !== "object") {
    return target;
  }
  const newTarget = { ...target };
  for (const source of sources) {
    if (typeof source === "object") {
      Object.keys(source).forEach((key) => {
        const targetValue = newTarget[key];
        const sourceValue = source[key];
        if (Array.isArray(targetValue) && Array.isArray(sourceValue)) {
          newTarget[key] = [...targetValue, ...sourceValue];
        } else if (typeof targetValue === "object" && typeof sourceValue === "object") {
          newTarget[key] = mergeDeep(targetValue, sourceValue);
        } else {
          newTarget[key] = sourceValue;
        }
      });
    }
  }
  return newTarget;
}
function stripNullOrUndefined(object) {
  if (!object) {
    return object;
  }
  return Object.entries(object).reduce((finalObject, [key, val]) => ({
    ...finalObject,
    ...val !== null && val !== void 0 ? { [key]: val } : {}
  }), {});
}
export {
  contentDependency,
  mergeDeep,
  stripNullOrUndefined
};
//# sourceMappingURL=objects.js.map
