bug - fromDecimal() param delim as Auto-isFixed
This commit is contained in:
parent
ad20c91f5b
commit
9489ec7825
@ -1288,8 +1288,8 @@ class Utils {
|
||||
* @param {string} token
|
||||
* @returns {string}
|
||||
*/
|
||||
static charRep(token) {
|
||||
return {
|
||||
static charRep(token, data="Auto") {
|
||||
const charMap = {
|
||||
"Space": " ",
|
||||
"Percent": "%",
|
||||
"Comma": ",",
|
||||
@ -1304,7 +1304,11 @@ class Utils {
|
||||
"\\x": "\\x",
|
||||
"Nothing (separate chars)": "",
|
||||
"None": "",
|
||||
}[token];
|
||||
};
|
||||
if(token === "Auto" && data !== "Auto") {
|
||||
return Object.values(charMap).find(char => data.includes(char));
|
||||
}
|
||||
return charMap[token];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ import Utils from "../Utils.mjs";
|
||||
* fromDecimal("10:20:30", "Colon");
|
||||
*/
|
||||
export function fromDecimal(data, delim="Auto") {
|
||||
delim = Utils.charRep(delim);
|
||||
delim = Utils.charRep(delim, data);
|
||||
const output = [];
|
||||
let byteStr = data.split(delim);
|
||||
if (byteStr[byteStr.length-1] === "")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user