-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
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
Suggestion : remove "boolean" package dependency #70
Comments
The https://www.npmjs.com/package/boolean
|
boolean is not only now unsupported, also the repository link in the npm registry no longer works.
https://github.com/thenativeweb exists, but https://github.com/thenativeweb/boolean does not (HTTP 404 error). |
Should be easy enough to replace, this is the whole module: const boolean = function (value: any): boolean {
switch (Object.prototype.toString.call(value)) {
case '[object String]':
return [ 'true', 't', 'yes', 'y', 'on', '1' ].includes(value.trim().toLowerCase());
case '[object Number]':
return value.valueOf() === 1;
case '[object Boolean]':
return value.valueOf();
default:
return false;
}
}; |
use |
The "boolean" dependency is quite light, but is also absolutely overkill. It is only used in one line, just to check that a env config matches some string values.
I think it took more time to search for and include this package than code the desire behaviour.
The text was updated successfully, but these errors were encountered: