/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Quality } from "#aspects/Quality.js";
import { InvalidMetadataError } from "#decoration/errors.js";
import { FieldSemantics } from "#decoration/semantics/FieldSemantics.js";
import { ValueModel } from "#models/ValueModel.js";
import { Decorator } from "@matter/general";
const nullable = Decorator((_target, context) => {
  const model = FieldSemantics.of(context).mutableModel;
  if (!(model instanceof ValueModel)) {
    throw new InvalidMetadataError("Only value models may be nullable");
  }
  model.quality = new Quality({ ...model.quality, nullable: true });
});
export {
  nullable
};
//# sourceMappingURL=nullable.js.map
