moved debugEnabled() functionality to a lambda, simplified usage
for the push method, move the call to getValueAndDest below the enabled check as it was unused before then (perf+)
a guard condition for stopTimer for the case where the unix time passed in is invalid (this will print -1).
push strings instead of functions to dest.debug
refactor switch statement with one case to an if/else
formatting and whitespace fixes
In a second commit:
remove the variadic function definition for push(), previously the function would accept either one, two or three arguments and in the case of three it would use the second argument as the destination of the 'push'. In practise this seems to have never been used only been used in one place and adds complexity to the code.
@orangejulius regarding the second commit, do you remember why this exists and why confidenceScoreFallback.js would be using the Debug helper to push onto $hit instead of $req? [edit] agh this https://github.com/pelias/api/pull/1436
small cosmetic refactor:
debugEnabled()
functionality to a lambda, simplified usagepush
method, move the call togetValueAndDest
below the enabled check as it was unused before then (perf+)stopTimer
for the case where the unix time passed in is invalid (this will print-1
).dest.debug
switch
statement with onecase
to anif/else
In a second commit:
push()
, previously the function would accept either one, two or three arguments and in the case of three it would use the second argument as the destination of the 'push'. In practise this seems to havenever been usedonly been used in one place and adds complexity to the code.@orangejulius regarding the second commit, do you remember why this exists and why
confidenceScoreFallback.js
would be using theDebug
helper to push onto$hit
instead of$req
? [edit] agh this https://github.com/pelias/api/pull/1436