SAP-BTP-Spielwiese/app1/node_modules/validator/es/lib/toBoolean.js
Markus Rettig 775ac7b58c completed step 3 from the tutorial
you must login with an BTP account in order to see the app
2024-02-08 16:13:36 +01:00

10 lines
No EOL
249 B
JavaScript

import assertString from './util/assertString';
export default function toBoolean(str, strict) {
assertString(str);
if (strict) {
return str === '1' || /^true$/i.test(str);
}
return str !== '0' && !/^false$/i.test(str) && str !== '';
}