Skip to content

Translate between hypothetical elements' atomic number, their systematic element name, and their symbol.

Notifications You must be signed in to change notification settings

mk-pmb/systematic-element-name-pmb-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

systematic-element-name-pmb

Translate between hypothetical elements' atomic number, their systematic element name, and their symbol.

In chemistry and physics, hypothetical chemical elements whose existence has not yet been proven are assigned a temporary systematic element name based on their Atomic number.

API

This module exports one function:

parse(input)

Translate input, which may be

  • an atomic number given as a Number or as a string of decimal digits,
  • a string with the systematic element name,
  • or a string with the systematic symbol.

For valid inputs, returns an object like { Z: 123, symb: 'Ubt': name: 'Unbitrium' }.

For almost-valid inputs (e.g. non-standard letter case or lack of contraction for dounle "i" or triple "n"), two additional properties are added:

  • fixed: Which field ('symb' or 'name') contains the corrected version of the input value.
  • origInput: The original input value.

For invalid inputs, returns false.

Usage

see test/usage.mjs.

Range restriction

In chemistry, systematic element names are meant to be used only for elements with 3-digit atomic numbers. This library ignores this restriction, and will happily parse and produce systematic symbols that will conflict with the symbols of known elements.

See test/conflicts.mjs for examples.

Known issues

  • Needs more/better tests and docs.

 

License

ISC

About

Translate between hypothetical elements' atomic number, their systematic element name, and their symbol.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published