https://github.com/cheminfo/dynamic-typing

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

hacktoberfest

Keywords from Contributors

nmr nmr-spectroscopy
Last synced: 9 months ago · JSON representation

Repository

Basic Info
Statistics
  • Stars: 0
  • Watchers: 6
  • Forks: 0
  • Open Issues: 0
  • Releases: 6
Topics
hacktoberfest
Created almost 5 years ago · Last pushed about 2 years ago
Metadata Files
Readme Changelog License

README.md

dynamic-typing

NPM version build status Test coverage npm download DOI

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.')0
  • parseString('0.0')0
  • parseString('abc')'abc'
  • parseString('True')true
  • parseString('false')false
  • parseString('0')0
  • parseString('123')123
  • parseString('123.456')123.456
  • parseString('12e3')12000
  • parseString('0x10')16
  • parseString('0b10')2

API Documentation

License

MIT

Owner

  • Name: Cheminfo
  • Login: cheminfo
  • Kind: organization

GitHub Events

Total
Last Year

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 28
  • Total Committers: 3
  • Avg Commits per committer: 9.333
  • Development Distribution Score (DDS): 0.25
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email 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
autorelease: tagged (6) hacktoberfest-accepted (1)

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

  • Versions: 6
  • Dependent Packages: 4
  • Dependent Repositories: 20
  • Downloads: 8,690 Last month
Rankings
Downloads: 2.3%
Dependent repos count: 2.8%
Dependent packages count: 4.5%
Average: 9.2%
Forks count: 15.5%
Stargazers count: 21.0%
Maintainers (1)
Last synced: 9 months ago

Dependencies

package.json npm
  • @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
.github/workflows/documentationjs.yml actions
  • JamesIves/github-pages-deploy-action releases/v4 composite
  • actions/checkout v2 composite
  • zakodium/documentationjs-action v1 composite
.github/workflows/lactame.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • zakodium/lactame-action v1 composite
.github/workflows/nodejs.yml actions
.github/workflows/release.yml actions