function hasVirtualProps(value) {
  return typeof value === "object" && value !== null && VIRTUAL_PROP_NAMES.every((name) => name in value);
}
function enrichRowWithVirtualProps(row, key, collectionId, computeSynced, computeOrigin) {
  const existingRow = row;
  return {
    ...row,
    $synced: existingRow.$synced ?? computeSynced(),
    $origin: existingRow.$origin ?? computeOrigin(),
    $key: existingRow.$key ?? key,
    $collectionId: existingRow.$collectionId ?? collectionId
  };
}
const VIRTUAL_PROP_NAMES = [
  "$synced",
  "$origin",
  "$key",
  "$collectionId"
];
function isVirtualPropName(name) {
  return VIRTUAL_PROP_NAMES.includes(name);
}
function hasVirtualPropPath(path) {
  return path.some((segment) => isVirtualPropName(segment));
}
export {
  VIRTUAL_PROP_NAMES,
  enrichRowWithVirtualProps,
  hasVirtualPropPath,
  hasVirtualProps,
  isVirtualPropName
};
//# sourceMappingURL=virtual-props.js.map
