@@ -240,7 +240,7 @@ const twoDecimals = decimal(2);
240240 *
241241 * A range is always required, because unbounded financial inputs allow gross typos (eg. an extra
242242 * digit) to slip through and cause data corruption, so callers must always think about a sensible
243- * limit. For most cases, prefer the ready-made `signedMoney() ` or `unsignedMoney() ` helpers instead
243+ * limit. For most cases, prefer the ready-made `signedMoney` or `unsignedMoney` helpers instead
244244 * of calling this directly.
245245 */
246246export function money ( min : number , max : number ) : ValidatorFn {
@@ -270,17 +270,13 @@ const maxMoney = 5_000_000;
270270 * Validate a signed amount of money (can be negative), suitable for a value stored in a database
271271 * column of type `SIGNED INT`, such as a balance.
272272 */
273- export function signedMoney ( ) : ValidatorFn {
274- return money ( - maxMoney , maxMoney ) ;
275- }
273+ export const signedMoney = money ( - maxMoney , maxMoney ) ;
276274
277275/**
278276 * Validate an unsigned amount of money (cannot be negative), suitable for a value stored in a
279277 * database column of type `UNSIGNED INT`, such as a price.
280278 */
281- export function unsignedMoney ( ) : ValidatorFn {
282- return money ( 0 , maxMoney ) ;
283- }
279+ export const unsignedMoney = money ( 0 , maxMoney ) ;
284280
285281/**
286282 * Validate that the number is strictly greater than given one.
0 commit comments