import { FieldValueIsNaNError } from "../../commerce/product-template-component-utils/error.js";
const computeNumberOfStars = (value, field)=>{
    if (null === value) return null;
    const valueAsNumber = parseFloat(`${value}`);
    if (Number.isNaN(valueAsNumber)) throw new FieldValueIsNaNError(field, value);
    return valueAsNumber;
};
export { computeNumberOfStars };
