@lhncbc/ucum-lhc 5.0.0 → 5.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../source/ucumLhcUtils.js"],"names":["Ucum","require","UnitTables","UnitString","UcumLhcUtils","constructor","getInstance","unitsCount","ucumJsonDefs","loadJsonDefs","uStrParser_","useHTMLInMessages","use","undefined","useBraceMsgForEachString","validateUnitString","uStr","suggest","valConv","resp","getSpecifiedUnit","theUnit","retObj","csCode_","name_","guidance_","status","convertUnitTo","fromUnitCode","fromVal","toUnitCode","molecularWeight","returnObj","trim","push","_checkFromVal","fromUnit","parseResp","concat","toUnit","convertFrom","moleExp_","Error","isMoleMassCommensurable","convertMolToMass","convertMassToMol","err","message","needMoleWeightMsg_","convertToBaseUnits","inputUnitLookup","unit","msg","retMsg","length","isArbitrary_","unitToExp","dimVec","dim_","dimVec_","baseUnitString","dimVecIndexToBaseUnit","dimVecIndexToBaseUnit_","i","len","exp","retUnitLookup","retUnit","magnitude","e","toString","fromUnitIsSpecial","isSpecial_","responseObj","isNaN","intUtils_","isNumericString","checkSynonyms","theSyn","getSynonyms","uName","utab","getUnitByCode","parseString","console","log","unshift","origString","commensurablesList","fromName","commUnits","fromDim","getProperty","getUnitsByDimension"],"mappings":";;;;;;;AAOA;;AAIA;;;;;;AAXA;;;;;;AAMA,IAAIA,IAAI,GAAGC,OAAO,CAAC,aAAD,CAAP,CAAuBD,IAAlC;;AAEA,IAAIE,UAAU,GAAGD,OAAO,CAAC,iBAAD,CAAP,CAA2BC,UAA5C;;AACA,IAAIC,UAAU,GAAGF,OAAO,CAAC,iBAAD,CAAP,CAA2BE,UAA5C;;AAIA;;;AAGO,MAAMC,YAAN,CAAmB;AAExB;;;;;AAKAC,EAAAA,WAAW,GAAG;AAEV,QAAIH,UAAU,CAACI,WAAX,GAAyBC,UAAzB,OAA0C,CAA9C,EAAiD;AAE/C;AACAC,iCAA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GAA5C;AACD,KAFD,MAGK;AACH,UAAIhC,MAAM,GAAG,IAAb;AACA,UAAIkC,OAAO,GAAGvD,QAAQ,CAACwD,WAAT,CAAqB,MAArB,CAAd;;AACA,UAAI,CAACD,OAAL,EAAc;AACZtC,QAAAA,MAAM,CAACnB,IAAP,CAAY,2CAA2CuD,QAAvD;AACD,OAFD,MAGK;AACH,YAAI;AACFhC,UAAAA,MAAM,GAAGkC,OAAO,CAACC,WAAR,CAAoB,SAApB,CAAT;AACD,SAFD,CAGA,OAAO9C,GAAP,EAAY;AACVO,UAAAA,MAAM,CAACnB,IAAP,CAAYY,GAAG,CAACC,OAAhB;AACA,cAAID,GAAG,CAACC,OAAJ,KACF,qDADF,EAEEU,MAAM,GAAG,IAAT;AACH;;AACD,YAAIA,MAAJ,EAAY;AACV,cAAIwB,IAAI,GAAG/E,UAAU,CAACI,WAAX,EAAX;AACAoF,UAAAA,SAAS,GAAGT,IAAI,CAACY,mBAAL,CAAyBpC,MAAzB,CAAZ;AACD;AACF,OApBE,CAoBD;;AACH,KAhC0B,CAgCzB;;;AACF,WAAO,CAACiC,SAAD,EAAarC,MAAb,CAAP;AACD,GAxkBuB,CAwkBtB;;;AAxkBsB,C,CA0kBxB;;AAGF;;;;;;;;;;;;;;;;;;AAcAjD,YAAY,CAACE,WAAb,GAA2B,YAAU;AACnC,SAAO,IAAIF,YAAJ,EAAP;AACD,CAFD","sourcesContent":["/**\n * This class provides a single point of access to the LHC UCUM utilities\n *\n * @author Lee Mericle\n *\n */\nvar Ucum = require('./config.js').Ucum;\nimport {ucumJsonDefs} from './ucumJsonDefs.js';\nvar UnitTables = require('./unitTables.js').UnitTables;\nvar UnitString = require('./unitString.js').UnitString;\n\nimport * as intUtils_ from \"./ucumInternalUtils.js\";\n\n/**\n * UCUM external utilities class\n */\nexport class UcumLhcUtils {\n\n /**\n * Constructor. This loads the json prefix and unit definitions if\n * they haven't been loaded already and creates itself as a singleton object.\n *\n */\n constructor() {\n\n if (UnitTables.getInstance().unitsCount() === 0) {\n\n // Load the prefix and unit objects\n ucumJsonDefs.loadJsonDefs();\n }\n\n // Get the UnitString parser that will be used with this instance\n // of the LHC Utilities\n this.uStrParser_ = UnitString.getInstance();\n\n } // end constructor\n\n\n /**\n * This method calls the useHTMLInMessages method on the UnitString\n * object. It should be called by web applications that use\n * these utilities.\n *\n * @param use flag indicating whether or not to use the braces message;\n * defaults to true\n */\n useHTMLInMessages(use) {\n if (use === undefined)\n use = true ;\n this.uStrParser_.useHTMLInMessages(use);\n }\n\n\n /**\n * This method calls the useBraceMsgForEachString method on the UnitString\n * object. It should be called by web applications where unit\n * strings are validated individually (as opposed to validating a whole\n * file of unit strings).\n *\n * @param use flag indicating whether or not to use the braces message;\n * defaults to true\n */\n useBraceMsgForEachString(use) {\n if (use === undefined)\n use = true ;\n this.uStrParser_.useBraceMsgForEachString(use);\n }\n\n\n /**\n * This method validates a unit string. It first checks to see if the\n * string passed in is a unit code that is found in the unit codes table.\n * If it is not found it parses the string to see if it resolves to a\n * valid unit string.\n *\n * If a valid unit cannot be found, the string is tested for some common\n * errors, such as missing brackets or a missing multiplication operator.\n * If found, the error is reported in the messages array that is returned.\n *\n * If a valid unit cannot be found and an error cannot be discerned, this\n * may return, if requested, a list of suggested units in the messages\n * array that is returned. Suggestions are based on matching the expression\n * with unit names and synonyms.\n *\n * @param uStr the string to be validated\n * @param suggest a boolean to indicate whether or not suggestions are\n * requested for a string that cannot be resolved to a valid unit;\n * true indicates suggestions are wanted; false indicates they are not,\n * and is the default if the parameter is not specified;\n * @param valConv a string indicating if this validation request was initiated\n * by a validation task ('validate') or a conversion task ('convert'),\n * used only for the demo code, and the default is 'Validator' if the\n * parameter is not specified;\n * @returns an object with five properties:\n * 'status' will be 'valid' (the uStr is a valid UCUM code), 'invalid'\n * (the uStr is not a valid UCUM code, and substitutions or\n * suggestions may or may not be returned, depending on what was\n * requested and found); or 'error' (an input or programming error\n * occurred);\n * 'ucumCode' the valid ucum code, which may differ from what was passed\n * in (e.g., if 'Gauss' is passed in, this will contain 'G') OR null if\n * the string was flagged as invalid or an error occurred;\n * 'msg' is an array of one or more messages, if the string is invalid or\n * an error occurred, indicating the problem, or an explanation of a\n * substitution such as the substitution of 'G' for 'Gauss', or\n * an empty array if no messages were generated;\n * 'unit' which is null if no unit is found, or a hash for a unit found:\n * 'code' is the unit's ucum code (G in the above example;\n * 'name' is the unit's name (Gauss in the above example); and\n * 'guidance' is the unit's guidance/description data; and\n * 'suggestions' if suggestions were requested and found, this is an array\n * of one or more hash objects. Each hash contains three elements:\n * 'msg' which is a message indicating what part of the uStr input\n * parameter the suggestions are for;\n * 'invalidUnit' which is the unit expression the suggestions are\n * for; and\n * 'units' which is an array of data for each suggested unit found.\n * Each array will contain the unit code, the unit name and the\n * unit guidance (if any).\n * If no suggestions were requested and found, this property is not\n * returned.\n */\n validateUnitString(uStr, suggest, valConv) {\n\n if (suggest === undefined)\n suggest = false ;\n\n if (valConv === undefined)\n valConv = 'validate' ;\n\n let resp = this.getSpecifiedUnit(uStr, valConv, suggest);\n let theUnit = resp['unit'];\n let retObj = !theUnit ? {'ucumCode': null} :\n {'ucumCode': resp['origString'],\n 'unit': {'code': theUnit.csCode_,\n 'name': theUnit.name_,\n 'guidance': theUnit.guidance_ }};\n retObj.status = resp.status;\n if (resp['suggestions']) {\n retObj['suggestions'] = resp['suggestions'];\n }\n retObj['msg'] = resp['retMsg'];\n return retObj;\n\n } // end validateUnitString\n\n\n /**\n * This method converts one unit to another\n *\n * @param fromUnitCode the unit code/expression/string of the unit to be converted\n * @param fromVal the number of \"from\" units to be converted to \"to\" units\n * @param toUnitCode the unit code/expression/string of the unit that the from\n * field is to be converted to\n * @param suggest a boolean to indicate whether or not suggestions are\n * requested for a string that cannot be resolved to a valid unit;\n * true indicates suggestions are wanted; false indicates they are not,\n * and is the default if the parameter is not specified;\n * @param molecularWeight the molecular weight of the substance in question\n * when a conversion is being requested from mass to moles and vice versa.\n * This is required when one of the units represents a value in moles. It is\n * ignored if neither unit includes a measurement in moles.\n * @returns a hash with six elements:\n * 'status' that will be: 'succeeded' if the conversion was successfully\n * calculated; 'failed' if the conversion could not be made, e.g., if\n * the units are not commensurable; or 'error' if an error occurred;\n * 'toVal' the numeric value indicating the conversion amount, or null\n * if the conversion failed (e.g., if the units are not commensurable);\n * 'msg' is an array message, if the string is invalid or an error occurred,\n * indicating the problem, or an explanation of a substitution such as\n * the substitution of 'G' for 'Gauss', or an empty array if no\n * messages were generated;\n * 'suggestions' if suggestions were requested and found, this is a hash\n * that contains at most two elements:\n * 'from' which, if the fromUnitCode input parameter or one or more of\n * its components could not be found, is an array one or more hash\n * objects. Each hash contains three elements:\n * 'msg' which is a message indicating what unit expression the\n * suggestions are for;\n * 'invalidUnit' which is the unit expression the suggestions\n * are for; and\n * 'units' which is an array of data for each suggested unit found.\n * Each array will contain the unit code, the unit name and the\n * unit guidance (if any).\n * If no suggestions were found for the fromUnitCode this element\n * will not be included.\n * 'to' which, if the \"to\" unit expression or one or more of its\n * components could not be found, is an array one or more hash objects. Each hash\n * contains three elements:\n * 'msg' which is a message indicating what toUnitCode input\n * parameter the suggestions are for;\n * 'invalidUnit' which is the unit expression the suggestions\n * are for; and\n * 'units' which is an array of data for each suggested unit found.\n * Each array will contain the unit code, the unit name and the\n * unit guidance (if any).\n * If no suggestions were found for the toUnitCode this element\n * will not be included.\n * No 'suggestions' element will be included in the returned hash\n * object if none were found, whether or not they were requested.\n * 'fromUnit' the unit object for the fromUnitCode passed in; returned\n * in case it's needed for additional data from the object; and\n * 'toUnit' the unit object for the toUnitCode passed in; returned\n * in case it's needed for additional data from the object.\n */\n convertUnitTo(fromUnitCode, fromVal, toUnitCode, suggest, molecularWeight) {\n if (suggest === undefined)\n suggest = false ;\n\n if (molecularWeight === undefined)\n molecularWeight = null ;\n\n let returnObj = {'status' : 'failed',\n 'toVal' : null,\n 'msg' : []} ;\n\n if (fromUnitCode) {\n fromUnitCode = fromUnitCode.trim();\n }\n if (!fromUnitCode || fromUnitCode == '') {\n returnObj['status'] = 'error';\n returnObj['msg'].push('No \"from\" unit expression specified.');\n }\n this._checkFromVal(fromVal, returnObj);\n if (toUnitCode) {\n toUnitCode = toUnitCode.trim();\n }\n if (!toUnitCode || toUnitCode == '') {\n returnObj['status'] = 'error';\n returnObj['msg'].push('No \"to\" unit expression specified.');\n }\n if (returnObj['status'] !== 'error') {\n try {\n let fromUnit = null;\n\n let parseResp = this.getSpecifiedUnit(fromUnitCode, 'convert', suggest);\n fromUnit = parseResp['unit'];\n if (parseResp['retMsg'])\n returnObj['msg'] = returnObj['msg'].concat(parseResp['retMsg']);\n if (parseResp['suggestions']) {\n returnObj['suggestions'] = {};\n returnObj['suggestions']['from'] = parseResp['suggestions'];\n }\n if (!fromUnit) {\n returnObj['msg'].push(`Unable to find a unit for ${fromUnitCode}, ` +\n `so no conversion could be performed.`);\n }\n\n let toUnit = null;\n parseResp = this.getSpecifiedUnit(toUnitCode, 'convert', suggest);\n toUnit = parseResp['unit'];\n if (parseResp['retMsg'])\n returnObj['msg'] = returnObj['msg'].concat(parseResp['retMsg']);\n if (parseResp['suggestions']) {\n if (!returnObj['suggestions'])\n returnObj['suggestions'] = {} ;\n returnObj['suggestions']['to'] = parseResp['suggestions'];\n }\n if (!toUnit) {\n returnObj['msg'].push(`Unable to find a unit for ${toUnitCode}, ` +\n `so no conversion could be performed.`);\n }\n\n if (fromUnit && toUnit) {\n try {\n // if no molecular weight was specified perform a normal conversion\n if (!molecularWeight) {\n returnObj['toVal'] = toUnit.convertFrom(fromVal, fromUnit);\n }\n else {\n if (fromUnit.moleExp_ !== 0 && toUnit.moleExp_ !== 0) {\n throw(new Error('A molecular weight was specified ' +\n 'but a mass <-> mole conversion cannot be executed for two ' +\n 'mole-based units. No conversion was attempted.'));\n }\n if (fromUnit.moleExp_ === 0 && toUnit.moleExp_ === 0) {\n throw(new Error('A molecular weight was specified ' +\n 'but a mass <-> mole conversion cannot be executed when ' +\n 'neither unit is mole-based. No conversion was attempted.'));\n }\n if (!fromUnit.isMoleMassCommensurable(toUnit)) {\n throw(new Error(`Sorry. ${fromUnitCode} cannot be ` +\n `converted to ${toUnitCode}.`));\n }\n\n // if the \"from\" unit is a mole-based unit, assume a mole to mass\n // request\n if (fromUnit.moleExp_ !== 0) {\n returnObj['toVal'] =\n fromUnit.convertMolToMass(fromVal, toUnit, molecularWeight);\n }\n // else the \"to\" unit must be the mole-based unit, so assume a\n // mass to mole request\n else {\n returnObj['toVal'] =\n fromUnit.convertMassToMol(fromVal, toUnit, molecularWeight);\n }\n } // end if a molecular weight was specified\n\n // if an error hasn't been thrown - either from convertFrom or here,\n // set the return object to show success\n returnObj['status'] = 'succeeded';\n returnObj['fromUnit'] = fromUnit;\n returnObj['toUnit'] = toUnit;\n }\n catch (err) {\n returnObj['status'] = 'failed';\n returnObj['msg'].push(err.message);\n }\n\n\n } // end if we have the from and to units\n }\n catch (err) {\n if (err.message == Ucum.needMoleWeightMsg_)\n returnObj['status'] = 'failed';\n else\n returnObj['status'] = 'error';\n returnObj['msg'].push(err.message);\n }\n }\n\n return returnObj ;\n\n } // end convertUnitTo\n\n\n /**\n * Converts the given unit string into its base units, their exponents, and\n * a magnitude, and returns that data.\n * @param fromUnit the unit string to be converted to base units information\n * @param fromVal the number of \"from\" units to be converted\n * @returns an object with the properties:\n * 'status' indicates whether the result succeeded. The value will be one of:\n * 'succeeded': the conversion was successfully calculated (which can be\n * true even if it was already in base units);\n * 'invalid': fromUnit is not a valid UCUM code;\n * 'failed': the conversion could not be made (e.g., if it is an \"arbitrary\" unit);\n * 'error': if an error occurred (an input or programming error)\n * 'msg': an array of one or more messages, if the string is invalid or\n * an error occurred, indicating the problem, or a suggestion of a\n * substitution such as the substitution of 'G' for 'Gauss', or\n * an empty array if no messages were generated. There can also be a\n * message that is just informational or warning.\n * 'magnitude': the new value when fromVal units of fromUnits is expressed in the base units.\n * 'fromUnitIsSpecial': whether the input unit fromUnit is a \"special unit\"\n * as defined in UCUM. This means there is some function applied to convert\n * between fromUnit and the base units, so the returned magnitude is likely not\n * useful as a scale factor for other conversions (i.e., it only has validity\n * and usefulness for the input values that produced it).\n * 'unitToExp': a map of base units in uStr to their exponent\n */\n convertToBaseUnits(fromUnit, fromVal) {\n let retObj = {};\n this._checkFromVal(fromVal, retObj);\n if (!retObj.status) { // could be set to 'error' by _checkFromVal\n let inputUnitLookup = this.getSpecifiedUnit(fromUnit, 'validate');\n retObj = {status: inputUnitLookup.status == 'valid' ? 'succeeded' : inputUnitLookup.status};\n let unit = inputUnitLookup.unit;\n retObj.msg = inputUnitLookup.retMsg || [];\n if (!unit) {\n if (inputUnitLookup.retMsg?.length == 0)\n retObj.msg.push('Could not find unit information for '+fromUnit);\n }\n else if (unit.isArbitrary_) {\n retObj.msg.push('Arbitrary units cannot be converted to base units or other units.');\n retObj.status = 'failed';\n }\n else if (retObj.status == 'succeeded') {\n let unitToExp = {};\n let dimVec = unit.dim_?.dimVec_\n let baseUnitString = '1';\n if (dimVec) {\n let dimVecIndexToBaseUnit = UnitTables.getInstance().dimVecIndexToBaseUnit_;\n for (let i=0, len=dimVec.length; i<len; ++i) {\n let exp = dimVec[i];\n if (exp) {\n unitToExp[dimVecIndexToBaseUnit[i]] = exp;\n baseUnitString += '.' + dimVecIndexToBaseUnit[i] + exp;\n }\n }\n }\n\n // The unit might have a conversion function, which has to be applied; we\n // cannot just assume unit_.magnitude_ is the magnitude in base units.\n let retUnitLookup = this.getSpecifiedUnit(baseUnitString, 'validate');\n // There should not be any error in retUnitLookup, unless there is a bug.\n let retUnit = retUnitLookup.unit;\n if (retUnitLookup.status !== 'valid') {\n retObj.msg.push('Unable construct base unit string; tried '+baseUnitString);\n retObj.status = 'error';\n }\n else {\n try {\n retObj.magnitude = retUnit.convertFrom(fromVal, unit);\n }\n catch (e) {\n retObj.msg.push(e.toString());\n retObj.status = 'error';\n }\n if (retObj.status == 'succeeded') {\n retObj.unitToExp = unitToExp;\n retObj.fromUnitIsSpecial = unit.isSpecial_;\n }\n }\n }\n }\n return retObj;\n }\n\n\n /**\n * Checks the given value as to whether it is suitable as a \"from\" value in a\n * unit conversion. If it is not, the responseObj will have its status set\n * to 'error' and a message added.\n * @param fromVal The value to check\n * @param responseObj the object that will be updated if the value is not\n * usable.\n */\n _checkFromVal(fromVal, responseObj) {\n if (fromVal === null || isNaN(fromVal) || (typeof fromVal !== 'number' &&\n !intUtils_.isNumericString(fromVal))) {\n responseObj.status = 'error';\n if (!responseObj.msg)\n responseObj.msg = [];\n responseObj.msg.push('No \"from\" value, or an invalid \"from\" value, ' +\n 'was specified.');\n }\n }\n\n\n /**\n * This method accepts a term and looks for units that include it as\n * a synonym - or that include the term in its name.\n *\n * @param theSyn the term to search for\n * @returns a hash with up to three elements:\n * 'status' contains the status of the request, which can be 'error',\n * 'failed' or succeeded';\n * 'msg' which contains a message for an error or if no units were found; and\n * 'units' which is an array that contains one hash for each unit found:\n * 'code' is the unit's csCode_\n * 'name' is the unit's name_\n * 'guidance' is the unit's guidance_\n *\n */\n checkSynonyms(theSyn) {\n let retObj = {} ;\n if (theSyn === undefined || theSyn === null) {\n retObj['status'] = 'error';\n retObj['msg'] = 'No term specified for synonym search.'\n }\n else {\n retObj = intUtils_.getSynonyms(theSyn);\n } // end if a search synonym was supplied\n\n return retObj ;\n\n } // end checkSynonyms\n\n\n /**\n * This method parses a unit string to get (or try to get) the unit\n * represented by the string. It returns an error message if no string was specified\n * or if any errors were encountered trying to get the unit.\n *\n * @param uName the expression/string representing the unit\n * @param valConv indicates what type of request this is for - a request to\n * validate (pass in 'validate') or a request to convert (pass in 'convert')\n * @param suggest a boolean to indicate whether or not suggestions are\n * requested for a string that cannot be resolved to a valid unit;\n * true indicates suggestions are wanted; false indicates they are not,\n * and is the default if the parameter is not specified;\n * @returns a hash containing:\n * 'status' will be 'valid' (uName is a valid UCUM code), 'invalid'\n * (the uStr is not a valid UCUM code, and substitutions or\n * suggestions may or may not be returned, depending on what was\n * requested and found); or 'error' (an input or programming error\n * occurred);\n * 'unit' the unit object (or null if there were problems creating the\n * unit);\n * 'origString' the possibly updated unit string passed in;\n * 'retMsg' an array of user messages (informational, error or warning) if\n * any were generated (IF any were generated, otherwise will be an\n * empty array); and\n * 'suggestions' is an array of 1 or more hash objects. Each hash\n * contains three elements:\n * 'msg' which is a message indicating what unit expression the\n * suggestions are for;\n * 'invalidUnit' which is the unit expression the suggestions are\n * for; and\n * 'units' which is an array of data for each suggested unit found.\n * Each array will contain the unit code, the unit name and the\n * unit guidance (if any).\n * The return hash will not contain a suggestions array if a valid unit\n * was found or if suggestions were not requested and found.\n */\n getSpecifiedUnit(uName, valConv, suggest) {\n\n if (suggest === undefined)\n suggest = false ;\n\n let retObj = {};\n retObj['retMsg'] = [];\n\n if (!uName) {\n retObj['retMsg'].push('No unit string specified.');\n }\n else {\n let utab = UnitTables.getInstance();\n uName = uName.trim();\n\n // go ahead and just try using the name as the code. This may or may not\n // work, but if it does, it cuts out a lot of parsing.\n let theUnit = utab.getUnitByCode(uName);\n\n // If we found it, set the returned unit string to what was passed in;\n // otherwise try parsing as a unit string\n if (theUnit) {\n retObj['unit'] = theUnit ;\n retObj['origString'] = uName;\n }\n else {\n try {\n let resp = this.uStrParser_.parseString(uName, valConv, suggest);\n retObj['unit'] = resp[0];\n retObj['origString'] = resp[1];\n if (resp[2])\n retObj['retMsg'] = resp[2];\n retObj['suggestions'] = resp[3];\n }\n catch (err) {\n console.log(`Unit requested for unit string ${uName}.` +\n 'request unsuccessful; error thrown = ' + err.message);\n retObj['retMsg'].unshift(`${uName} is not a valid unit. ` +\n `${err.message}`);\n }\n } // end if the unit was not found as a unit name\n } // end if a unit expression was specified\n\n // Set the status field\n if (!retObj.unit) {\n // No unit was found; check whether origString has a value\n retObj.status = !retObj.origString ? 'error' : 'invalid';\n }\n else {\n // Check whether substitutions were made to the unit string in order to\n // find the unit\n retObj.status = retObj.origString === uName ? 'valid': 'invalid';\n }\n\n return retObj;\n\n } // end getSpecifiedUnit\n\n\n /**\n * This method retrieves a list of units commensurable, i.e., that can be\n * converted from and to, a specified unit. Returns an error if the \"from\"\n * unit cannot be found.\n *\n * @param fromName the name/unit string of the \"from\" unit\n * @returns an array containing two elements;\n * first element is the list of commensurable units if any were found\n * second element is an error message if the \"from\" unit is not found\n */\n commensurablesList(fromName) {\n\n let retMsg = [];\n let commUnits = null ;\n let parseResp = this.getSpecifiedUnit(fromName, 'validate', false);\n let fromUnit = parseResp['unit'];\n if (parseResp['retMsg'].length > 0)\n retMsg = parseResp['retMsg'] ;\n if (!fromUnit) {\n retMsg.push(`Could not find unit ${fromName}.`);\n }\n else {\n let dimVec = null ;\n let fromDim = fromUnit.getProperty('dim_');\n if (!fromDim) {\n retMsg.push('No commensurable units were found for ' + fromName) ;\n }\n else {\n try {\n dimVec = fromDim.getProperty('dimVec_');\n }\n catch (err) {\n retMsg.push(err.message);\n if (err.message ===\n \"Dimension does not have requested property(dimVec_)\")\n dimVec = null;\n }\n if (dimVec) {\n let utab = UnitTables.getInstance();\n commUnits = utab.getUnitsByDimension(dimVec);\n }\n } // end if the from unit has a dimension vector\n } // end if we found a \"from\" unit\n return [commUnits , retMsg];\n } // end commensurablesList\n\n} // end UcumLhcUtils class\n\n\n/**\n * This function exists ONLY until the original UcumLhcUtils constructor\n * is called for the first time. It's defined here in case getInstance\n * is called before the constructor. This calls the constructor.\n *\n * The constructor redefines the getInstance function to return the\n * singleton UcumLhcUtils object. This is based on the UnitTables singleton\n * implementation; see more detail in the UnitTables constructor description.\n *\n * NO LONGER TRUE - not implemented as a singleton. This method retained to\n * avoid problems with calls to it that exist throughout the code.\n *\n * @return the (formerly singleton) UcumLhcUtils object.\n */\nUcumLhcUtils.getInstance = function(){\n return new UcumLhcUtils();\n} ;\n"],"file":"ucumLhcUtils.js"}
1
+ {"version":3,"file":"ucumLhcUtils.js","names":["_ucumJsonDefs","require","intUtils_","_interopRequireWildcard","_getRequireWildcardCache","WeakMap","cache","obj","__esModule","default","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Ucum","UnitTables","UnitString","UcumLhcUtils","constructor","getInstance","unitsCount","ucumJsonDefs","loadJsonDefs","uStrParser_","useHTMLInMessages","use","undefined","useBraceMsgForEachString","validateUnitString","uStr","suggest","valConv","resp","getSpecifiedUnit","theUnit","retObj","csCode_","name_","guidance_","status","convertUnitTo","fromUnitCode","fromVal","toUnitCode","molecularWeight","returnObj","trim","push","_checkFromVal","fromUnit","parseResp","concat","toUnit","convertFrom","moleExp_","Error","isMoleMassCommensurable","convertMolToMass","convertMassToMol","err","message","needMoleWeightMsg_","convertToBaseUnits","inputUnitLookup","unit","msg","retMsg","length","isArbitrary_","unitToExp","dimVec","dim_","dimVec_","baseUnitString","dimVecIndexToBaseUnit","dimVecIndexToBaseUnit_","i","len","exp","retUnitLookup","retUnit","magnitude","e","toString","fromUnitIsSpecial","isSpecial_","responseObj","isNaN","isNumericString","checkSynonyms","theSyn","getSynonyms","uName","utab","getUnitByCode","parseString","console","log","unshift","origString","commensurablesList","fromName","commUnits","fromDim","getProperty","getUnitsByDimension","exports"],"sources":["../source/ucumLhcUtils.js"],"sourcesContent":["/**\n * This class provides a single point of access to the LHC UCUM utilities\n *\n * @author Lee Mericle\n *\n */\nvar Ucum = require('./config.js').Ucum;\nimport {ucumJsonDefs} from './ucumJsonDefs.js';\nvar UnitTables = require('./unitTables.js').UnitTables;\nvar UnitString = require('./unitString.js').UnitString;\n\nimport * as intUtils_ from \"./ucumInternalUtils.js\";\n\n/**\n * UCUM external utilities class\n */\nexport class UcumLhcUtils {\n\n /**\n * Constructor. This loads the json prefix and unit definitions if\n * they haven't been loaded already and creates itself as a singleton object.\n *\n */\n constructor() {\n\n if (UnitTables.getInstance().unitsCount() === 0) {\n\n // Load the prefix and unit objects\n ucumJsonDefs.loadJsonDefs();\n }\n\n // Get the UnitString parser that will be used with this instance\n // of the LHC Utilities\n this.uStrParser_ = UnitString.getInstance();\n\n } // end constructor\n\n\n /**\n * This method calls the useHTMLInMessages method on the UnitString\n * object. It should be called by web applications that use\n * these utilities.\n *\n * @param use flag indicating whether or not to use the braces message;\n * defaults to true\n */\n useHTMLInMessages(use) {\n if (use === undefined)\n use = true ;\n this.uStrParser_.useHTMLInMessages(use);\n }\n\n\n /**\n * This method calls the useBraceMsgForEachString method on the UnitString\n * object. It should be called by web applications where unit\n * strings are validated individually (as opposed to validating a whole\n * file of unit strings).\n *\n * @param use flag indicating whether or not to use the braces message;\n * defaults to true\n */\n useBraceMsgForEachString(use) {\n if (use === undefined)\n use = true ;\n this.uStrParser_.useBraceMsgForEachString(use);\n }\n\n\n /**\n * This method validates a unit string. It first checks to see if the\n * string passed in is a unit code that is found in the unit codes table.\n * If it is not found it parses the string to see if it resolves to a\n * valid unit string.\n *\n * If a valid unit cannot be found, the string is tested for some common\n * errors, such as missing brackets or a missing multiplication operator.\n * If found, the error is reported in the messages array that is returned.\n *\n * If a valid unit cannot be found and an error cannot be discerned, this\n * may return, if requested, a list of suggested units in the messages\n * array that is returned. Suggestions are based on matching the expression\n * with unit names and synonyms.\n *\n * @param uStr the string to be validated\n * @param suggest a boolean to indicate whether or not suggestions are\n * requested for a string that cannot be resolved to a valid unit;\n * true indicates suggestions are wanted; false indicates they are not,\n * and is the default if the parameter is not specified;\n * @param valConv a string indicating if this validation request was initiated\n * by a validation task ('validate') or a conversion task ('convert'),\n * used only for the demo code, and the default is 'Validator' if the\n * parameter is not specified;\n * @returns an object with five properties:\n * 'status' will be 'valid' (the uStr is a valid UCUM code), 'invalid'\n * (the uStr is not a valid UCUM code, and substitutions or\n * suggestions may or may not be returned, depending on what was\n * requested and found); or 'error' (an input or programming error\n * occurred);\n * 'ucumCode' the valid ucum code, which may differ from what was passed\n * in (e.g., if 'Gauss' is passed in, this will contain 'G') OR null if\n * the string was flagged as invalid or an error occurred;\n * 'msg' is an array of one or more messages, if the string is invalid or\n * an error occurred, indicating the problem, or an explanation of a\n * substitution such as the substitution of 'G' for 'Gauss', or\n * an empty array if no messages were generated;\n * 'unit' which is null if no unit is found, or a hash for a unit found:\n * 'code' is the unit's ucum code (G in the above example;\n * 'name' is the unit's name (Gauss in the above example); and\n * 'guidance' is the unit's guidance/description data; and\n * 'suggestions' if suggestions were requested and found, this is an array\n * of one or more hash objects. Each hash contains three elements:\n * 'msg' which is a message indicating what part of the uStr input\n * parameter the suggestions are for;\n * 'invalidUnit' which is the unit expression the suggestions are\n * for; and\n * 'units' which is an array of data for each suggested unit found.\n * Each array will contain the unit code, the unit name and the\n * unit guidance (if any).\n * If no suggestions were requested and found, this property is not\n * returned.\n */\n validateUnitString(uStr, suggest, valConv) {\n\n if (suggest === undefined)\n suggest = false ;\n\n if (valConv === undefined)\n valConv = 'validate' ;\n\n let resp = this.getSpecifiedUnit(uStr, valConv, suggest);\n let theUnit = resp['unit'];\n let retObj = !theUnit ? {'ucumCode': null} :\n {'ucumCode': resp['origString'],\n 'unit': {'code': theUnit.csCode_,\n 'name': theUnit.name_,\n 'guidance': theUnit.guidance_ }};\n retObj.status = resp.status;\n if (resp['suggestions']) {\n retObj['suggestions'] = resp['suggestions'];\n }\n retObj['msg'] = resp['retMsg'];\n return retObj;\n\n } // end validateUnitString\n\n\n /**\n * This method converts one unit to another\n *\n * @param fromUnitCode the unit code/expression/string of the unit to be converted\n * @param fromVal the number of \"from\" units to be converted to \"to\" units\n * @param toUnitCode the unit code/expression/string of the unit that the from\n * field is to be converted to\n * @param suggest a boolean to indicate whether or not suggestions are\n * requested for a string that cannot be resolved to a valid unit;\n * true indicates suggestions are wanted; false indicates they are not,\n * and is the default if the parameter is not specified;\n * @param molecularWeight the molecular weight of the substance in question\n * when a conversion is being requested from mass to moles and vice versa.\n * This is required when one of the units represents a value in moles. It is\n * ignored if neither unit includes a measurement in moles.\n * @returns a hash with six elements:\n * 'status' that will be: 'succeeded' if the conversion was successfully\n * calculated; 'failed' if the conversion could not be made, e.g., if\n * the units are not commensurable; or 'error' if an error occurred;\n * 'toVal' the numeric value indicating the conversion amount, or null\n * if the conversion failed (e.g., if the units are not commensurable);\n * 'msg' is an array message, if the string is invalid or an error occurred,\n * indicating the problem, or an explanation of a substitution such as\n * the substitution of 'G' for 'Gauss', or an empty array if no\n * messages were generated;\n * 'suggestions' if suggestions were requested and found, this is a hash\n * that contains at most two elements:\n * 'from' which, if the fromUnitCode input parameter or one or more of\n * its components could not be found, is an array one or more hash\n * objects. Each hash contains three elements:\n * 'msg' which is a message indicating what unit expression the\n * suggestions are for;\n * 'invalidUnit' which is the unit expression the suggestions\n * are for; and\n * 'units' which is an array of data for each suggested unit found.\n * Each array will contain the unit code, the unit name and the\n * unit guidance (if any).\n * If no suggestions were found for the fromUnitCode this element\n * will not be included.\n * 'to' which, if the \"to\" unit expression or one or more of its\n * components could not be found, is an array one or more hash objects. Each hash\n * contains three elements:\n * 'msg' which is a message indicating what toUnitCode input\n * parameter the suggestions are for;\n * 'invalidUnit' which is the unit expression the suggestions\n * are for; and\n * 'units' which is an array of data for each suggested unit found.\n * Each array will contain the unit code, the unit name and the\n * unit guidance (if any).\n * If no suggestions were found for the toUnitCode this element\n * will not be included.\n * No 'suggestions' element will be included in the returned hash\n * object if none were found, whether or not they were requested.\n * 'fromUnit' the unit object for the fromUnitCode passed in; returned\n * in case it's needed for additional data from the object; and\n * 'toUnit' the unit object for the toUnitCode passed in; returned\n * in case it's needed for additional data from the object.\n */\n convertUnitTo(fromUnitCode, fromVal, toUnitCode, suggest, molecularWeight) {\n if (suggest === undefined)\n suggest = false ;\n\n if (molecularWeight === undefined)\n molecularWeight = null ;\n\n let returnObj = {'status' : 'failed',\n 'toVal' : null,\n 'msg' : []} ;\n\n if (fromUnitCode) {\n fromUnitCode = fromUnitCode.trim();\n }\n if (!fromUnitCode || fromUnitCode == '') {\n returnObj['status'] = 'error';\n returnObj['msg'].push('No \"from\" unit expression specified.');\n }\n this._checkFromVal(fromVal, returnObj);\n if (toUnitCode) {\n toUnitCode = toUnitCode.trim();\n }\n if (!toUnitCode || toUnitCode == '') {\n returnObj['status'] = 'error';\n returnObj['msg'].push('No \"to\" unit expression specified.');\n }\n if (returnObj['status'] !== 'error') {\n try {\n let fromUnit = null;\n\n let parseResp = this.getSpecifiedUnit(fromUnitCode, 'convert', suggest);\n fromUnit = parseResp['unit'];\n if (parseResp['retMsg'])\n returnObj['msg'] = returnObj['msg'].concat(parseResp['retMsg']);\n if (parseResp['suggestions']) {\n returnObj['suggestions'] = {};\n returnObj['suggestions']['from'] = parseResp['suggestions'];\n }\n if (!fromUnit) {\n returnObj['msg'].push(`Unable to find a unit for ${fromUnitCode}, ` +\n `so no conversion could be performed.`);\n }\n\n let toUnit = null;\n parseResp = this.getSpecifiedUnit(toUnitCode, 'convert', suggest);\n toUnit = parseResp['unit'];\n if (parseResp['retMsg'])\n returnObj['msg'] = returnObj['msg'].concat(parseResp['retMsg']);\n if (parseResp['suggestions']) {\n if (!returnObj['suggestions'])\n returnObj['suggestions'] = {} ;\n returnObj['suggestions']['to'] = parseResp['suggestions'];\n }\n if (!toUnit) {\n returnObj['msg'].push(`Unable to find a unit for ${toUnitCode}, ` +\n `so no conversion could be performed.`);\n }\n\n if (fromUnit && toUnit) {\n try {\n // if no molecular weight was specified perform a normal conversion\n if (!molecularWeight) {\n returnObj['toVal'] = toUnit.convertFrom(fromVal, fromUnit);\n }\n else {\n if (fromUnit.moleExp_ !== 0 && toUnit.moleExp_ !== 0) {\n throw(new Error('A molecular weight was specified ' +\n 'but a mass <-> mole conversion cannot be executed for two ' +\n 'mole-based units. No conversion was attempted.'));\n }\n if (fromUnit.moleExp_ === 0 && toUnit.moleExp_ === 0) {\n throw(new Error('A molecular weight was specified ' +\n 'but a mass <-> mole conversion cannot be executed when ' +\n 'neither unit is mole-based. No conversion was attempted.'));\n }\n if (!fromUnit.isMoleMassCommensurable(toUnit)) {\n throw(new Error(`Sorry. ${fromUnitCode} cannot be ` +\n `converted to ${toUnitCode}.`));\n }\n\n // if the \"from\" unit is a mole-based unit, assume a mole to mass\n // request\n if (fromUnit.moleExp_ !== 0) {\n returnObj['toVal'] =\n fromUnit.convertMolToMass(fromVal, toUnit, molecularWeight);\n }\n // else the \"to\" unit must be the mole-based unit, so assume a\n // mass to mole request\n else {\n returnObj['toVal'] =\n fromUnit.convertMassToMol(fromVal, toUnit, molecularWeight);\n }\n } // end if a molecular weight was specified\n\n // if an error hasn't been thrown - either from convertFrom or here,\n // set the return object to show success\n returnObj['status'] = 'succeeded';\n returnObj['fromUnit'] = fromUnit;\n returnObj['toUnit'] = toUnit;\n }\n catch (err) {\n returnObj['status'] = 'failed';\n returnObj['msg'].push(err.message);\n }\n\n\n } // end if we have the from and to units\n }\n catch (err) {\n if (err.message == Ucum.needMoleWeightMsg_)\n returnObj['status'] = 'failed';\n else\n returnObj['status'] = 'error';\n returnObj['msg'].push(err.message);\n }\n }\n\n return returnObj ;\n\n } // end convertUnitTo\n\n\n /**\n * Converts the given unit string into its base units, their exponents, and\n * a magnitude, and returns that data.\n * @param fromUnit the unit string to be converted to base units information\n * @param fromVal the number of \"from\" units to be converted\n * @returns an object with the properties:\n * 'status' indicates whether the result succeeded. The value will be one of:\n * 'succeeded': the conversion was successfully calculated (which can be\n * true even if it was already in base units);\n * 'invalid': fromUnit is not a valid UCUM code;\n * 'failed': the conversion could not be made (e.g., if it is an \"arbitrary\" unit);\n * 'error': if an error occurred (an input or programming error)\n * 'msg': an array of messages (possibly empty) if the string is invalid or\n * an error occurred, indicating the problem, or a suggestion of a\n * substitution such as the substitution of 'G' for 'Gauss', or\n * an empty array if no messages were generated. There can also be a\n * message that is just informational or warning.\n * 'magnitude': the new value when fromVal units of fromUnits is expressed in the base units.\n * 'fromUnitIsSpecial': whether the input unit fromUnit is a \"special unit\"\n * as defined in UCUM. This means there is some function applied to convert\n * between fromUnit and the base units, so the returned magnitude is likely not\n * useful as a scale factor for other conversions (i.e., it only has validity\n * and usefulness for the input values that produced it).\n * 'unitToExp': a map of base units in fromUnit to their exponent\n */\n convertToBaseUnits(fromUnit, fromVal) {\n let retObj = {};\n this._checkFromVal(fromVal, retObj);\n if (!retObj.status) { // could be set to 'error' by _checkFromVal\n let inputUnitLookup = this.getSpecifiedUnit(fromUnit, 'validate');\n retObj = {status: inputUnitLookup.status == 'valid' ? 'succeeded' : inputUnitLookup.status};\n let unit = inputUnitLookup.unit;\n retObj.msg = inputUnitLookup.retMsg || [];\n if (!unit) {\n if (inputUnitLookup.retMsg?.length == 0)\n retObj.msg.push('Could not find unit information for '+fromUnit);\n }\n else if (unit.isArbitrary_) {\n retObj.msg.push('Arbitrary units cannot be converted to base units or other units.');\n retObj.status = 'failed';\n }\n else if (retObj.status == 'succeeded') {\n let unitToExp = {};\n let dimVec = unit.dim_?.dimVec_\n let baseUnitString = '1';\n if (dimVec) {\n let dimVecIndexToBaseUnit = UnitTables.getInstance().dimVecIndexToBaseUnit_;\n for (let i=0, len=dimVec.length; i<len; ++i) {\n let exp = dimVec[i];\n if (exp) {\n unitToExp[dimVecIndexToBaseUnit[i]] = exp;\n baseUnitString += '.' + dimVecIndexToBaseUnit[i] + exp;\n }\n }\n }\n\n // The unit might have a conversion function, which has to be applied; we\n // cannot just assume unit_.magnitude_ is the magnitude in base units.\n let retUnitLookup = this.getSpecifiedUnit(baseUnitString, 'validate');\n // There should not be any error in retUnitLookup, unless there is a bug.\n let retUnit = retUnitLookup.unit;\n if (retUnitLookup.status !== 'valid') {\n retObj.msg.push('Unable construct base unit string; tried '+baseUnitString);\n retObj.status = 'error';\n }\n else {\n try {\n retObj.magnitude = retUnit.convertFrom(fromVal, unit);\n }\n catch (e) {\n retObj.msg.push(e.toString());\n retObj.status = 'error';\n }\n if (retObj.status == 'succeeded') {\n retObj.unitToExp = unitToExp;\n retObj.fromUnitIsSpecial = unit.isSpecial_;\n }\n }\n }\n }\n return retObj;\n }\n\n\n /**\n * Checks the given value as to whether it is suitable as a \"from\" value in a\n * unit conversion. If it is not, the responseObj will have its status set\n * to 'error' and a message added.\n * @param fromVal The value to check\n * @param responseObj the object that will be updated if the value is not\n * usable.\n */\n _checkFromVal(fromVal, responseObj) {\n if (fromVal === null || isNaN(fromVal) || (typeof fromVal !== 'number' &&\n !intUtils_.isNumericString(fromVal))) {\n responseObj.status = 'error';\n if (!responseObj.msg)\n responseObj.msg = [];\n responseObj.msg.push('No \"from\" value, or an invalid \"from\" value, ' +\n 'was specified.');\n }\n }\n\n\n /**\n * This method accepts a term and looks for units that include it as\n * a synonym - or that include the term in its name.\n *\n * @param theSyn the term to search for\n * @returns a hash with up to three elements:\n * 'status' contains the status of the request, which can be 'error',\n * 'failed' or succeeded';\n * 'msg' which contains a message for an error or if no units were found; and\n * 'units' which is an array that contains one hash for each unit found:\n * 'code' is the unit's csCode_\n * 'name' is the unit's name_\n * 'guidance' is the unit's guidance_\n *\n */\n checkSynonyms(theSyn) {\n let retObj = {} ;\n if (theSyn === undefined || theSyn === null) {\n retObj['status'] = 'error';\n retObj['msg'] = 'No term specified for synonym search.'\n }\n else {\n retObj = intUtils_.getSynonyms(theSyn);\n } // end if a search synonym was supplied\n\n return retObj ;\n\n } // end checkSynonyms\n\n\n /**\n * This method parses a unit string to get (or try to get) the unit\n * represented by the string. It returns an error message if no string was specified\n * or if any errors were encountered trying to get the unit.\n *\n * @param uName the expression/string representing the unit\n * @param valConv indicates what type of request this is for - a request to\n * validate (pass in 'validate') or a request to convert (pass in 'convert')\n * @param suggest a boolean to indicate whether or not suggestions are\n * requested for a string that cannot be resolved to a valid unit;\n * true indicates suggestions are wanted; false indicates they are not,\n * and is the default if the parameter is not specified;\n * @returns a hash containing:\n * 'status' will be 'valid' (uName is a valid UCUM code), 'invalid'\n * (the uStr is not a valid UCUM code, and substitutions or\n * suggestions may or may not be returned, depending on what was\n * requested and found); or 'error' (an input or programming error\n * occurred);\n * 'unit' the unit object (or null if there were problems creating the\n * unit);\n * 'origString' the possibly updated unit string passed in;\n * 'retMsg' an array of user messages (informational, error or warning) if\n * any were generated (IF any were generated, otherwise will be an\n * empty array); and\n * 'suggestions' is an array of 1 or more hash objects. Each hash\n * contains three elements:\n * 'msg' which is a message indicating what unit expression the\n * suggestions are for;\n * 'invalidUnit' which is the unit expression the suggestions are\n * for; and\n * 'units' which is an array of data for each suggested unit found.\n * Each array will contain the unit code, the unit name and the\n * unit guidance (if any).\n * The return hash will not contain a suggestions array if a valid unit\n * was found or if suggestions were not requested and found.\n */\n getSpecifiedUnit(uName, valConv, suggest) {\n\n if (suggest === undefined)\n suggest = false ;\n\n let retObj = {};\n retObj['retMsg'] = [];\n\n if (!uName) {\n retObj['retMsg'].push('No unit string specified.');\n }\n else {\n let utab = UnitTables.getInstance();\n uName = uName.trim();\n\n // go ahead and just try using the name as the code. This may or may not\n // work, but if it does, it cuts out a lot of parsing.\n let theUnit = utab.getUnitByCode(uName);\n\n // If we found it, set the returned unit string to what was passed in;\n // otherwise try parsing as a unit string\n if (theUnit) {\n retObj['unit'] = theUnit ;\n retObj['origString'] = uName;\n }\n else {\n try {\n let resp = this.uStrParser_.parseString(uName, valConv, suggest);\n retObj['unit'] = resp[0];\n retObj['origString'] = resp[1];\n if (resp[2])\n retObj['retMsg'] = resp[2];\n retObj['suggestions'] = resp[3];\n }\n catch (err) {\n console.log(`Unit requested for unit string ${uName}.` +\n 'request unsuccessful; error thrown = ' + err.message);\n retObj['retMsg'].unshift(`${uName} is not a valid unit. ` +\n `${err.message}`);\n }\n } // end if the unit was not found as a unit name\n } // end if a unit expression was specified\n\n // Set the status field\n if (!retObj.unit) {\n // No unit was found; check whether origString has a value\n retObj.status = !retObj.origString ? 'error' : 'invalid';\n }\n else {\n // Check whether substitutions were made to the unit string in order to\n // find the unit\n retObj.status = retObj.origString === uName ? 'valid': 'invalid';\n }\n\n return retObj;\n\n } // end getSpecifiedUnit\n\n\n /**\n * This method retrieves a list of units commensurable, i.e., that can be\n * converted from and to, a specified unit. Returns an error if the \"from\"\n * unit cannot be found.\n *\n * @param fromName the name/unit string of the \"from\" unit\n * @returns an array containing two elements;\n * first element is the list of commensurable units if any were found\n * second element is an error message if the \"from\" unit is not found\n */\n commensurablesList(fromName) {\n\n let retMsg = [];\n let commUnits = null ;\n let parseResp = this.getSpecifiedUnit(fromName, 'validate', false);\n let fromUnit = parseResp['unit'];\n if (parseResp['retMsg'].length > 0)\n retMsg = parseResp['retMsg'] ;\n if (!fromUnit) {\n retMsg.push(`Could not find unit ${fromName}.`);\n }\n else {\n let dimVec = null ;\n let fromDim = fromUnit.getProperty('dim_');\n if (!fromDim) {\n retMsg.push('No commensurable units were found for ' + fromName) ;\n }\n else {\n try {\n dimVec = fromDim.getProperty('dimVec_');\n }\n catch (err) {\n retMsg.push(err.message);\n if (err.message ===\n \"Dimension does not have requested property(dimVec_)\")\n dimVec = null;\n }\n if (dimVec) {\n let utab = UnitTables.getInstance();\n commUnits = utab.getUnitsByDimension(dimVec);\n }\n } // end if the from unit has a dimension vector\n } // end if we found a \"from\" unit\n return [commUnits , retMsg];\n } // end commensurablesList\n\n} // end UcumLhcUtils class\n\n\n/**\n * This function exists ONLY until the original UcumLhcUtils constructor\n * is called for the first time. It's defined here in case getInstance\n * is called before the constructor. This calls the constructor.\n *\n * The constructor redefines the getInstance function to return the\n * singleton UcumLhcUtils object. This is based on the UnitTables singleton\n * implementation; see more detail in the UnitTables constructor description.\n *\n * NO LONGER TRUE - not implemented as a singleton. This method retained to\n * avoid problems with calls to it that exist throughout the code.\n *\n * @return the (formerly singleton) UcumLhcUtils object.\n */\nUcumLhcUtils.getInstance = function(){\n return new UcumLhcUtils();\n} ;\n"],"mappings":";;;;;;AAOA,IAAAA,aAAA,GAAAC,OAAA;AAIA,IAAAC,SAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAoD,SAAAG,yBAAA,eAAAC,OAAA,kCAAAC,KAAA,OAAAD,OAAA,IAAAD,wBAAA,YAAAA,CAAA,WAAAE,KAAA,YAAAA,KAAA;AAAA,SAAAH,wBAAAI,GAAA,QAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,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5
  });
6
6
  exports.UnitTables = exports.UcumLhcUtils = exports.Ucum = void 0;
7
-
8
7
  /**
9
8
  * This exports definitions for ucum classes that need references to them
10
9
  * available to the demo code. The actual code will be in the ucumPkg
11
10
  * library found in the dist directory. This file provides the hooks to
12
11
  * those classes within the library.
13
12
  */
14
- var Ucum = require("./config.js").Ucum;
15
13
 
14
+ var Ucum = require("./config.js").Ucum;
16
15
  exports.Ucum = Ucum;
17
-
18
16
  var UcumLhcUtils = require("./ucumLhcUtils.js").UcumLhcUtils;
19
-
20
17
  exports.UcumLhcUtils = UcumLhcUtils;
21
-
22
18
  var UnitTables = require("./unitTables.js").UnitTables;
23
-
24
19
  exports.UnitTables = UnitTables;
25
20
  //# sourceMappingURL=ucumPkg.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../source/ucumPkg.js"],"names":["Ucum","require","UcumLhcUtils","UnitTables"],"mappings":";;;;;;;AAAA;;;;;;AAOO,IAAIA,IAAI,GAAGC,OAAO,CAAC,aAAD,CAAP,CAAuBD,IAAlC;;;;AACA,IAAIE,YAAY,GAAGD,OAAO,CAAC,mBAAD,CAAP,CAA6BC,YAAhD;;;;AACA,IAAIC,UAAU,GAAGF,OAAO,CAAC,iBAAD,CAAP,CAA2BE,UAA5C","sourcesContent":["/**\n * This exports definitions for ucum classes that need references to them\n * available to the demo code. The actual code will be in the ucumPkg\n * library found in the dist directory. This file provides the hooks to\n * those classes within the library.\n */\n\nexport var Ucum = require(\"./config.js\").Ucum;\nexport var UcumLhcUtils = require(\"./ucumLhcUtils.js\").UcumLhcUtils;\nexport var UnitTables = require(\"./unitTables.js\").UnitTables;"],"file":"ucumPkg.js"}
1
+ {"version":3,"file":"ucumPkg.js","names":["Ucum","require","exports","UcumLhcUtils","UnitTables"],"sources":["../source/ucumPkg.js"],"sourcesContent":["/**\n * This exports definitions for ucum classes that need references to them\n * available to the demo code. The actual code will be in the ucumPkg\n * library found in the dist directory. This file provides the hooks to\n * those classes within the library.\n */\n\nexport var Ucum = require(\"./config.js\").Ucum;\nexport var UcumLhcUtils = require(\"./ucumLhcUtils.js\").UcumLhcUtils;\nexport var UnitTables = require(\"./unitTables.js\").UnitTables;"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEO,IAAIA,IAAI,GAAGC,OAAO,CAAC,aAAa,CAAC,CAACD,IAAI;AAACE,OAAA,CAAAF,IAAA,GAAAA,IAAA;AACvC,IAAIG,YAAY,GAAGF,OAAO,CAAC,mBAAmB,CAAC,CAACE,YAAY;AAACD,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAC7D,IAAIC,UAAU,GAAGH,OAAO,CAAC,iBAAiB,CAAC,CAACG,UAAU;AAACF,OAAA,CAAAE,UAAA,GAAAA,UAAA"}