Skip to content
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

Open
guiled opened this issue Oct 15, 2024 · 4 comments
Open

Suggestion : remove "boolean" package dependency #70

guiled opened this issue Oct 15, 2024 · 4 comments

Comments

@guiled
Copy link

guiled commented Oct 15, 2024

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.

@silverwind
Copy link

silverwind commented Oct 22, 2024

The boolean package has been deprecated:

https://www.npmjs.com/package/boolean

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@MikeMcC399
Copy link

boolean is not only now unsupported, also the repository link in the npm registry no longer works.

$ npm view boolean

boolean@3.2.0 | MIT | deps: none | versions: 22
boolean converts lots of things to boolean.
https://github.com/thenativeweb/boolean#readme

DEPRECATED ⚠️  - Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

keywords: boolean, parser

dist
.tarball: https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz
.shasum: 9e5294af4e98314494cbb17979fa54ca159f116b
.integrity: sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==
.unpackedSize: 12.5 kB

maintainers:
- thenativeweb-admin <hello@thenativeweb.io>

dist-tags:
latest: 3.2.0

published over a year ago by thenativeweb-admin <hello@thenativeweb.io>

https://github.com/thenativeweb exists, but https://github.com/thenativeweb/boolean does not (HTTP 404 error).

@silverwind
Copy link

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;
  }
};

@MagicalEarner
Copy link

use
npm install electron@latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants