This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/env-var/lib/accessors/bool.js
T

19 lines
346 B
JavaScript

'use strict'
module.exports = function asBool (value) {
const val = value.toLowerCase()
const allowedValues = [
'false',
'0',
'true',
'1'
]
if (allowedValues.indexOf(val) === -1) {
throw new Error('should be either "true", "false", "TRUE", "FALSE", 1, or 0')
}
return !(((val === '0') || (val === 'false')))
}