All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Return "cannot convert" message even if molecular weight and charge fields are provided, if the convert cannot happen between the units.
- Return both "require molecular weight" and "require charge" messages at the same time, if both are required in convertUnitTo().
- Published a new API, commensurablesList, to UcumLhcUtils.
- Removed bower support
- Fixed the sourcemap for browser-dist/ucum-lhc.min.js.
- In the npm package, replace browser-dist/ucum-lhc.js with ucum-lhc.min.js and its sourcemap.
- Removed unneeded dependency.
- Support for handling eq/mol/mass conversions when there are powers of those units.
- Keep annotation and remove leading "1" in CiCode.
- Validator issue: 2+10 should be invalid.
- convertUnitTo now supports specifying the charge of the substance when converting between eq and mol (or eq and g).
- Specifying the charge when converting between eq and mol (or g) is now required. Previously it assumed the charge is 1, which is not always the case.
- convertUnitTo now takes an "options" parameter into which the former parameters "suggestions" and "molecularWeight" have been moved, and which contains a new option "charge" for specifying the charge of the substance.
- Specifying a molecularWeight value when none is needed is no longer treated as an error.
- Validator issue reported on github: m(/s) should be invalid.
- Typos in ucum.csv.
- Validator issues reported on github: g.m2-1 and g.(m2)-1 should be invalid.
- Some of the tags were wrongly closed with <.sup> in ucum-lhc.js.
- Breaking change to the new "convertToBaseUnits" API added in 4.2.0: The returned "msg" array can now contain messages even when the conversion is successful. The returned object now also contains a "status" field just like the "convertUnitTo" API.
- Certain annotation units were marked invalid if the same string existed as a bracketed unit (e.g., {degF} and [degF]). (This fixes the problem raised in #45.)
- Added a new API, convertToBaseUnits, to UcumLhcUtils.
- Added some needed space around symbols in HTML error messages.
- Now validates that characters within annotation strings are in the permitted range.
- Updated to Node.js 18.
- Units from the data/ucum.csv file, which contains many unit strings with prefixes, were previously permitted to take an additional prefix.
- Units derived from other units were previously being labeled as "base units", though apparently without ill effect on the current public APIs.
- Update version to 4.1.6 for tagging the last merge, which was to update generated files but was not given a new version number and not tagged.
- Fixed generated name issue for complex units, #29
- Moved grunt-extract-sourcemap to devDependencies.
- Updated dependencies to avoid issues raised by npm audit (except one on a devDependency).
- Fixed to work in IE 11.
- Updated dependencies to get patches for security vulnerabilities.
- removed unnecessary index.html
- the sizes of ucumDefs.json and related files reduced
- ucumDefs.json generation: baseFactor_ and magnitude_ should be numbers
- added impexp/README.md about generating ucumDef.json
- 4.0.0 was just published today, and is missing a data file in the npm package. This version fixes that.
- This main file of the npm package is now a file that uses CommonJS modules (i.e., NodeJs-compatible) instead of a browserified bundle. The problem with serving a browserfied bundle via npm was that if you pulled it in and then tried to browserify it along with application code, an exception would be thrown because browserify has already run on part of the code. The change should be transparent to the user of the package, but just in case there is some unforeseen consequence, I am incrementing the major version. If your application needs the browserified version, that is still available in the browser-dist directory.
- Corrected processing so that strings like "1e2" are no longer considered valid units.
- Updated dependencies to get patches for security vulnerabilities.
- Minor corrections to the UCUM data (mostly with regard to extra properties we added like "guidance").
- As result of the dependency update, the build process needed to be revised, and the individual transpiled files were removed. The package.json "main" file has changed. This is not expected to cause a problem for normal usage of the package (relying on the "main" file), and the API has not changed, but due to the upheaval, a semver-major change seemed warranted.
- Updated dependencies to get patches for security vulnerabilities.
- Demo page: The validation message on the Validator tab was displayed vertically when the unit was valid.
- Demo page changes: fixed processing flow problem that allowed an attempt to convert an invalid unit; tweaked flow on initial display of converter tab; added meta data to the page to increase visibility to search engines.
- Added mass<-> moles conversion to the UCUM Demo page, with a request to the user to supply a molecular weight when such a conversion is requested.
- Added capability to existing convertUnitTo library function to convert mass to moles expression.
- Fixed mismatches with version numbers as well as problem with library distribution on 2.5.2.
- Fixed problem with 2.5.0 where not all files were being included in the source-es5/ucumPkg.js package.
- The changes made by browserify have been removed from the ucum-lhc package available to node.js users, necessitating the creation of separate distributions. The distribution of the library code starts at the source-es5/ucumPkg.js file. The distribution in the browser-dist directory contains server side code that includes browser related code. The distribution in the demo-dist directory continues to contain the code related to the UCUM-LHC demo page.
- fixed bug where validation of a unit string that contains an operator, such as B[10.nV] is a valid string and validates correctly as a single valid UCUM code, but did not validate correctly when preceded by a prefix, e.g., dB[10.nV].
- fixed bug where validation of a unit string terminated with an operator returned an incorrect response. It correctly flagged the string as an invalid unit expression but included a coding error message that should not have been included.
- blocked division and multiplication operations as well as conversion operations on arbitrary units
- Added capability to open directly to converter page using url https://ucum.nlm.nih.gov/ucum-lhc/demo.html#converter
- redesigned validator tab on Demo page to move messages closer to the unit expression input field
- redesigned converter tab on Demo page to resemble an equation for the conversion
- Updated npm packages growl and semver to avoid critical security vulnerabilities flagged by GitHub
- Updated conversion code to properly handle conversion of unitless measurements, such as moles.
- Updated code to make text for combined units, e.g., 2.(mmol/L), more explicit in regards to evaluation order.
- fixed appearance of the demo page converter tab so that when the page is widened in the browser the text all anchors on the left. One portion of the text was anchored to the right, which made a widened version look wrong.
- modifications to ensure that plain numbers, e.g., 7, are reported correctly.
- added unit name to demo output messages, where available, to make sure user knows what unit is being reported as valid.
- added information related to version number of the ucum-essence.xml file used as well as changes made to it
- reformatted display of suggestions lists for the demo site to use a bulleted list of suggestions rather than a plain text list.
- fixed a bug that prevented suggestion lists from being created for more than one unit.
- added list selection listener to unit expression field on validation tab of the demo page
- fixed autofill problem on Edge browser.
- fixed positioning of text on converter tab of the demo page so that it is consistent in how it lines up when the page is widened.
- changed unit name (not code) creation for constructed units to enclose the name in square brackets and use an asterisk (*) for multiplication instead of a period.
- fix for overwritten units during data update process
- updates to register bower package
- updates to third party and UCUM LHC license information
- fixes to csv file validator
- cosmetic updates to overview and demo pages related to banner, titles
- created npm package
- shifts module tests to use distribution package
- moves ucumFileValidator to demo directory
- updates README
- removes guidance text for constructed units, e.g., units that are created on the fly, as they are specified for validation or conversion. For example, m[H2O]/cm is constructed from m[H2O] (meter of water column) divided by cm (centimeter). No guidance data is provided for this constructed unit.
- added disclaimer concerning conversion results to demo page convert tab and to README.md page
- completed bug fix for zero and negative number of units for conversions.
- updated link at the top of the demo page to refer back to the overview page - and the link at the top of the overview page to refer back to itself.
- added text to the demo file validation to clarify that only units are validated. Prefixes on their own are not validated.
- updated the ucumDefs.json with version 2.1 (November 21, 2017) of the ucum-essence.xml file from unitsofmeasure.org
- started fixes on a bug where a zero or negative number of units was considered an error.
- Upgraded the validation processing for conversion request on the demo page; validation is now performed on the fly as each element is entered. This is a change only to the demo page.
- Added ability to get suggestions for invalid unit expressions.
- Enhanced unit string validation to accommodate/correct:
- missing multiplication operators, e.g., 2mg instead of 2.mg;
- unit name specified instead of ucum code, e.g., day instead of d;
- misplaced annotations, e.g., {creatine}mol instead of mol{creatine}**;
- missing square brackets, e.g., in_i instead of [in_i]; and
- braces instead of brackets, e.g., {degF} instead of [degF].
- Updated unit creation process to include updates to case-insensitve codes and print symbol values when creating a unit from multiple units.
- Updated treatment of prefixes for special units that use conversion functions to record prefix values in the separate conversion prefix field.
- Data file has been updated with enhanced synonyms and is also now written in a a readable JSON format.
- Autocompleters no longer return multiple-unit strings, e.g., kg/cm. Multiple-unit strings are still (very) valid, but the autocompleters just return one list single-unit strings at a time.
- The commensurables list on the conversion tab's "convert to" field has been changed to just use the same autocompleter as used for the "convert from" field. The list will now include units that cannot be converted.
- Allowed conversion of units with no dimensions
- added testing for the Unit.convertFrom and Unit.convertTo functions
- This change log.
- Streamlined divString function in Unit.js
- Moved parenthesized unit string processing to separate function in UnitString.js (processParens).
- Added testing for the processParens function in testUnitString.spec.js
- Updated UcumFileValidator.js with previously changed function name (validUnitString -> validateUnitString in UcumLhcUtils.js).