mirror of
https://github.com/SikongJueluo/cc-utils.git
synced 2025-11-05 03:37:50 +08:00
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
This commit is contained in:
11
src/lib/thirdparty/ts-result-es/utils.ts
vendored
Normal file
11
src/lib/thirdparty/ts-result-es/utils.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user