Installations
npm install @eturino/ts-parse-boolean
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=10.0
Score
72.7
Supply Chain
100
Quality
75.4
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (89.16%)
JavaScript (10.84%)
Developer
eturino
Download Statistics
Total Downloads
156,973
Last Day
331
Last Week
1,373
Last Month
5,522
Last Year
57,518
GitHub Statistics
47 Commits
3 Watching
25 Branches
1 Contributors
Bundle Size
459.00 B
Minified
306.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.1.3
Package Id
@eturino/ts-parse-boolean@1.1.3
Unpacked Size
15.85 kB
Size
5.93 kB
File Count
19
Total Downloads
Cumulative downloads
Total Downloads
156,973
Last day
10%
331
Compared to previous day
Last week
-5.6%
1,373
Compared to previous week
Last month
18.7%
5,522
Compared to previous month
Last year
3.3%
57,518
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
23
@eturino/ts-parse-boolean
TypeDoc generated docs in here
Converts to a boolean. Returns false if the value is falsy. If it is truthy it checks it by converting to a string, trimming, upcasing, and checking if the value is not FALSE
or NO
or 0
.
If we pass a value that is not a boolean
, string
, number
, null
or undefined
, it will return false
.
Installation
yarn add @eturino/ts-parse-boolean
or npm install @eturino/ts-parse-boolean
.
Usage
1import parseBoolean from "@eturino/ts-parse-boolean"; 2 3parseBoolean(true); // => true 4parseBoolean(false); // => false 5parseBoolean(1); // => true 6parseBoolean(0); // => false 7parseBoolean(-8); // => true 8parseBoolean(" 0 "); // => false 9parseBoolean(" tRue "); // => true 10parseBoolean(" No "); // => false 11parseBoolean(" faLse "); // => false 12parseBoolean(" Whatever "); // => true 13 14// complex values are not parsed and we return false by default 15parseBoolean(["a"]); // => false 16parseBoolean({ a: 1 }); // => false
Development, Commits, versioning and publishing
See documentation for development
See The Typescript-Starter docs.
Commits and CHANGELOG
For commits, you should use commitizen
1yarn global add commitizen 2 3#commit your changes: 4git cz
As typescript-starter docs state:
This project is tooled for conventional changelog to make managing releases easier. See the standard-version documentation for more information on the workflow, or CHANGELOG.md
for an example.
1# bump package.json version, update CHANGELOG.md, git tag the release 2yarn run version
You may find a tool like wip
helpful for managing work in progress before you're ready to create a meaningful commit.
Creating the first version
Once you are ready to create the first version, run the following (note that reset
is destructive and will remove all files not in the git repo from the directory).
1# Reset the repo to the latest commit and build everything 2yarn run reset && yarn run test && yarn run doc:html 3 4# Then version it with standard-version options. e.g.: 5# don't bump package.json version 6yarn run version -- --first-release 7 8# Other popular options include: 9 10# PGP sign it: 11# $ yarn run version -- --sign 12 13# alpha release: 14# $ yarn run version -- --prerelease alpha
And after that, remember to publish the docs.
And finally push the new tags to github and publish the package to npm.
1# Push to git 2git push --follow-tags origin master 3 4# Publish to NPM (allowing public access, required if the package name is namespaced like `@somewhere/some-lib`) 5yarn publish --access public
Publish the Docs
1yarn run doc:html && yarn run doc:publish
This will generate the docs and publish them in github pages.
Generate a version
There is a single yarn command for preparing a new release. See One-step publish preparation script in TypeScript-Starter
1# Prepare a standard release 2yarn prepare-release 3 4# Push to git 5git push --follow-tags origin master 6 7# Publish to NPM (allowing public access, required if the package name is namespaced like `@somewhere/some-lib`) 8yarn publish --access public
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/10 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 20 are checked with a SAST tool
Reason
39 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-mhxj-85r3-2x55
- Warn: Project is vulnerable to: GHSA-8mmm-9v2q-x3f9
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-4r62-v4vq-hr96
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7
- Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6
- Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
1.7
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More