(rawValue, fallback = false)
| 739 | } |
| 740 | |
| 741 | function parseBooleanSetting(rawValue, fallback = false) { |
| 742 | if (typeof rawValue === 'boolean') { |
| 743 | return rawValue; |
| 744 | } |
| 745 | const normalized = String(rawValue || '') |
| 746 | .trim() |
| 747 | .toLowerCase(); |
| 748 | if (['true', 'yes', 'on', '1'].includes(normalized)) { |
| 749 | return true; |
| 750 | } |
| 751 | if (['false', 'no', 'off', '0'].includes(normalized)) { |
| 752 | return false; |
| 753 | } |
| 754 | return fallback; |
| 755 | } |
| 756 | |
| 757 | function shouldCompileRuntimeBytecode() { |
| 758 | return parseBooleanSetting(process.env.DEEPSCIENTIST_RUNTIME_COMPILE_BYTECODE, false); |
no test coverage detected