Skip to content

Commit

Permalink
Fix default value in utilFns.js and add debug verification in oafp.so…
Browse files Browse the repository at this point in the history
…urce.js.hbs
  • Loading branch information
nmaguiar committed Mar 4, 2024
1 parent e0e0694 commit e9e1068
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/include/utilFns.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const _$f = (r, options) => {
switch(params.sqlfilter.toLowerCase()) {
case "simple" : method = "nlinq"; break
case "advanced": method = "h2"; break
default : method = "auto"
default : method = __
}
}
if (isArray(r) && r.length > 0) r = $sql(r, options.__sql.trim(), method)
Expand Down
15 changes: 15 additions & 0 deletions src/oafp.source.js.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ var params = processExpr(" ")
const oafp = (params) => {
if (isUnDef(params) || isDef(params.____ojob)) return

// Ensure params are interpreted as lower case
Object.keys(params).forEach(pk => {
var npk = pk.toLowerCase()
if (pk != npk && isUnDef(params[npk])) {
params[npk] = params[pk]
delete params[pk]
}
})

// --- Util functions
{{{srcUtilFns}}}
// ---
Expand Down Expand Up @@ -408,6 +417,12 @@ var _run = () => {
}
}

// Verify debug
if (isDef(params["-debug"])) {
//__initializeCon()
printErr("DEBUG: " + stringify(params, __, ""))
}

if (isNumber(params.loop)) {
while(1) {
_run()
Expand Down

0 comments on commit e9e1068

Please sign in to comment.