Added comments for leading semicolons
(cherry picked from commit 60739c7853
)
This commit is contained in:
parent
1b2aff170f
commit
03a3726dd8
|
@ -56,11 +56,11 @@ export const createContract = newEndpoint(['POST'], async (req, [user, _]) => {
|
||||||
|
|
||||||
let min, max, initialProb
|
let min, max, initialProb
|
||||||
if (outcomeType === 'NUMERIC') {
|
if (outcomeType === 'NUMERIC') {
|
||||||
;({ min, max } = validate(numericSchema, req.body))
|
;({ min, max } = validate(numericSchema, req.body)) // leading ; intentional: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#assignment_separate_from_declaration_2
|
||||||
if (max - min <= 0.01) throw new APIError(400, 'Invalid range.')
|
if (max - min <= 0.01) throw new APIError(400, 'Invalid range.')
|
||||||
}
|
}
|
||||||
if (outcomeType === 'BINARY') {
|
if (outcomeType === 'BINARY') {
|
||||||
;({ initialProb } = validate(binarySchema, req.body))
|
;({ initialProb } = validate(binarySchema, req.body)) // leading ; intentional: see abive
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uses utc time on server:
|
// Uses utc time on server:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user