Files
cc-utils/src/lib/thirdparty/ts-result-es/utils.ts
SikongJueluo 119bc1997a reconstruct: autocraft algorithm; feature: rust-style result
reconstruct:
- move queue and sortedarray to dir datatype
- move semaphore and readwritelock to dir mutex
- reconstruct autocraft search algorithm, use hashmap instead of forloop
- adjust some code style
feature:
- add rust-style result lib
2025-10-26 10:06:50 +08:00

12 lines
232 B
TypeScript

export function toString(val: unknown): string {
let value = String(val);
if (value === "[object Object]") {
try {
value = textutils.serialize(val as object);
} catch {
return "";
}
}
return value;
}