mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
fix: support integer arithmetic for divided_by, closes #465
This commit is contained in:
@@ -4,7 +4,7 @@ export const abs = argumentsToValue(Math.abs)
|
||||
export const atLeast = argumentsToValue(Math.max)
|
||||
export const atMost = argumentsToValue(Math.min)
|
||||
export const ceil = argumentsToValue(Math.ceil)
|
||||
export const dividedBy = argumentsToValue((v: number, arg: number) => v / arg)
|
||||
export const dividedBy = argumentsToValue((dividend: number, divisor: number, integerArithmetic = false) => integerArithmetic ? Math.floor(dividend / divisor) : dividend / divisor)
|
||||
export const floor = argumentsToValue(Math.floor)
|
||||
export const minus = argumentsToValue((v: number, arg: number) => v - arg)
|
||||
export const modulo = argumentsToValue((v: number, arg: number) => v % arg)
|
||||
|
||||
Reference in New Issue
Block a user