MCPcopy Index your code
hub / github.com/codecombat/codecombat / positify

Function positify

app/core/utils.js:710–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

708const round = _.curry((digits, n) => n = +n.toFixed(digits))
709
710const positify = func => params => function (x) { if (x > 0) { return func(params)(x) } else { return 0 } }
711
712// f(x) = ax + b
713const createLinearFunc = params => x => ((params.a || 1) * x) + (params.b || 0)

Callers 1

utils.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected