@themachinarium/google-merchant-feed
Version:
A simple library to generate Google Merchant XML Feed
13 lines (10 loc) • 323 B
text/typescript
import { UNIT, Unit } from "./unit";
export namespace WeightWithUnit {
export type Model = {
value: number;
unit: keyof Pick<typeof UNIT, "lb" | "oz" | "g" | "kg">;
};
export function formatter(valueWithUnit: Model): string {
return `${valueWithUnit.value} ${Unit.formatter(valueWithUnit.unit)}`;
}
}