style: Apply Prettier formatting with 4-space indentation

Applied consistent code formatting across the project using Prettier, now configured to use 4-space indentation instead of tabs.
This commit is contained in:
Scott Idem
2025-11-18 18:40:50 -05:00
parent 6d1f9989d0
commit 0987cd6ad9
346 changed files with 86645 additions and 84459 deletions

View File

@@ -18,73 +18,73 @@ import type { key_val } from './ae_utils';
// Updated 2022-02-11
export const process_data_string = function process_data_string(data_string: string) {
console.log('*** process_data_string() ***');
// console.log(data_string);
if (!data_string || data_string.length < 1) {
console.log('No data string found.');
return false;
}
console.log('*** process_data_string() ***');
// console.log(data_string);
if (!data_string || data_string.length < 1) {
console.log('No data string found.');
return false;
}
const obj: key_val = {};
const obj: key_val = {};
const colon_index = data_string.indexOf(':');
if (colon_index) {
const data_string_type = data_string.slice(0, colon_index);
console.log(data_string_type);
const colon_index = data_string.indexOf(':');
if (colon_index) {
const data_string_type = data_string.slice(0, colon_index);
console.log(data_string_type);
obj['qr_type'] = data_string_type;
obj['qr_type'] = data_string_type;
if (data_string_type == 'MECARD') {
const mecard_str = data_string.slice(colon_index + 1);
console.log(mecard_str);
if (data_string_type == 'MECARD') {
const mecard_str = data_string.slice(colon_index + 1);
console.log(mecard_str);
obj['str'] = mecard_str;
} else if (data_string_type == 'OBJ') {
const key_value_str = data_string.slice(colon_index + 1);
console.log(key_value_str);
const key_value_array = key_value_str.split(',');
// console.log(key_value_array);
const ot_colon_index = key_value_array[0].indexOf(':');
const obj_type = key_value_array[0].slice(ot_colon_index + 1);
// console.log(obj_type);
const oi_colon_index = key_value_array[1].indexOf(':');
const obj_id = key_value_array[1].slice(oi_colon_index + 1);
// console.log(obj_id);
obj['type'] = obj_type;
obj['id'] = obj_id;
} else if (data_string_type == 'JSON') {
const partial_json_str = data_string.slice(colon_index + 1);
console.log(partial_json_str);
const json_str = `{${partial_json_str}}`;
console.log(json_str);
obj['str'] = mecard_str;
} else if (data_string_type == 'OBJ') {
const key_value_str = data_string.slice(colon_index + 1);
console.log(key_value_str);
const key_value_array = key_value_str.split(',');
// console.log(key_value_array);
const ot_colon_index = key_value_array[0].indexOf(':');
const obj_type = key_value_array[0].slice(ot_colon_index + 1);
// console.log(obj_type);
const oi_colon_index = key_value_array[1].indexOf(':');
const obj_id = key_value_array[1].slice(oi_colon_index + 1);
// console.log(obj_id);
obj['type'] = obj_type;
obj['id'] = obj_id;
} else if (data_string_type == 'JSON') {
const partial_json_str = data_string.slice(colon_index + 1);
console.log(partial_json_str);
const json_str = `{${partial_json_str}}`;
console.log(json_str);
obj['json'] = JSON.parse(json_str);
} else if (data_string_type == 'STR') {
const str = data_string.slice(colon_index + 1);
console.log(str);
obj['json'] = JSON.parse(json_str);
} else if (data_string_type == 'STR') {
const str = data_string.slice(colon_index + 1);
console.log(str);
obj['str'] = str;
} else if (data_string_type == 'http' || data_string_type == 'https') {
console.log(`http or https: ${data_string}`);
obj['str'] = str;
} else if (data_string_type == 'http' || data_string_type == 'https') {
console.log(`http or https: ${data_string}`);
obj['type'] = 'url';
obj['url'] = data_string;
} else {
console.log('The unknown data string type was found. Returning the string part.');
const unknown_str = data_string.slice(colon_index + 1);
console.log(unknown_str);
obj['type'] = 'url';
obj['url'] = data_string;
} else {
console.log('The unknown data string type was found. Returning the string part.');
const unknown_str = data_string.slice(colon_index + 1);
console.log(unknown_str);
obj['str'] = unknown_str;
}
} else {
console.log('The data string type was not found. Returning the entire string.');
console.log(data_string);
obj['str'] = unknown_str;
}
} else {
console.log('The data string type was not found. Returning the entire string.');
console.log(data_string);
obj['qr_type'] = 'UNKNOWN';
obj['str'] = data_string;
// return false;
}
obj['qr_type'] = 'UNKNOWN';
obj['str'] = data_string;
// return false;
}
console.log(obj);
return obj; // Returns an object
console.log(obj);
return obj; // Returns an object
};