https://github.com/cheminfo/dynamic-typing
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.5%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Basic Info
- Host: GitHub
- Owner: cheminfo
- License: mit
- Language: TypeScript
- Default Branch: main
- Homepage: https://cheminfo.github.io/dynamic-typing/
- Size: 1.15 MB
Statistics
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
- Releases: 6
Topics
Metadata Files
README.md
dynamic-typing
Dynamically types a string.
When parsing text files, like the ones coming out fromm scientific instruments, it is often useful to convert the obtained strings to their corresponding types.
Indeed when you parse the file while all the fields are text some of them represents in fact numbers or booleans.
This package will try to make the conversion for you using the following rules:
- a string that has as lowercase value 'true' or 'false' will be converted to the corresponding boolean
- a string that when converted to number (using
Number(string)) does not yield to NaN will be converted to number - other strings will be kept as string
This package was optimized for speed and seems to work pretty well. Please don't hesitate to submit bug reports or contribute.
Installation
$ npm i dynamic-typing
Usage
```js import { parseString } from 'dynamic-typing';
const result = parseString('0x100');
// result is the number 256 ```
More examples:
parseString('')➡''parseString(' ')➡' 'parseString('.')➡'.'parseString('0.')➡0parseString('0.0')➡0parseString('abc')➡'abc'parseString('True')➡trueparseString('false')➡falseparseString('0')➡0parseString('123')➡123parseString('123.456')➡123.456parseString('12e3')➡12000parseString('0x10')➡16parseString('0b10')➡2
API Documentation
License
Owner
- Name: Cheminfo
- Login: cheminfo
- Kind: organization
- Website: https://www.cheminfo.org/
- Repositories: 242
- Profile: https://github.com/cheminfo
GitHub Events
Total
Last Year
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Luc Patiny | l****c@p****m | 21 |
| cheminfo-bot | 1****t | 6 |
| Wadjih Bencheikh | j****h@e****z | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 1
- Total pull requests: 8
- Average time to close issues: 30 days
- Average time to close pull requests: 2 months
- Total issue authors: 1
- Total pull request authors: 3
- Average comments per issue: 0.0
- Average comments per pull request: 0.75
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- lpatiny (1)
Pull Request Authors
- cheminfo-bot (6)
- wadjih-bencheikh18 (2)
- lpatiny (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- npm 8,690 last-month
- Total dependent packages: 4
- Total dependent repositories: 20
- Total versions: 6
- Total maintainers: 1
npmjs.org: dynamic-typing
Dynamically type a string
- Homepage: https://github.com/cheminfo/dynamic-typing#readme
- License: MIT
-
Latest release: 1.0.1
published about 2 years ago
Rankings
Maintainers (1)
Dependencies
- @babel/plugin-transform-modules-commonjs ^7.18.6 development
- @types/jest ^28.1.7 development
- eslint ^8.22.0 development
- eslint-config-cheminfo ^8.0.2 development
- jest ^28.1.3 development
- prettier ^2.7.1 development
- rollup ^2.78.1 development
- JamesIves/github-pages-deploy-action releases/v4 composite
- actions/checkout v2 composite
- zakodium/documentationjs-action v1 composite
- actions/checkout v3 composite
- actions/setup-node v3 composite
- zakodium/lactame-action v1 composite