We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! Thank you very much for the loader, it is very useful.
It would be very nice to add one minor feature to it - some option in config to treat "absent" (or unset) keys as "false".
The text was updated successfully, but these errors were encountered:
but if they are absent, how do you know their names in order to turn them into false?
false
Sorry, something went wrong.
Like this (dirty patch) -
preprocessor.ts
function evaluate(condition: string, defs: OptionObject): boolean { const code = `return (${condition}) ? true : false;`; const args = Object.keys(defs); let result: boolean; try { const f = new Function(...args, code); result = f(...args.map((k) => defs[k])); //console.log(`evaluation of (${condition}) === ${result}`); } catch(error) { // throw `error evaluation #if condition(${condition}): ${error}`; return false; // ...if option "treatAbsentAsFalse" is set and error is ReferenceError } return result; }
No branches or pull requests
Hi! Thank you very much for the loader, it is very useful.
It would be very nice to add one minor feature to it - some option in config to treat "absent" (or unset) keys as "false".
The text was updated successfully, but these errors were encountered: