Merge 6698452a8119b4a6fec4be90c1eefb50e324725d into 49b855c761b717b90f2a1db90458c4122c16291b

This commit is contained in:
Kathir Eswaran 2026-07-15 12:04:09 -07:00 committed by GitHub
commit f0f7241450
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -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];
}

View File

@ -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] === "")