mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-24 21:42:58 +00:00
refactor: align platform APIs with community review
This commit is contained in:
@@ -91,3 +91,7 @@ export const VALID_COMMANDS = new Set([
|
||||
"remote-status",
|
||||
"init-settings",
|
||||
] as const);
|
||||
|
||||
export function isCLICommand(value: string): value is CLICommand {
|
||||
return (VALID_COMMANDS as ReadonlySet<string>).has(value);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { path, readline } from "@vrtmrz/livesync-commonlib/node";
|
||||
|
||||
export function toArrayBuffer(data: Buffer): ArrayBuffer {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- required in environments where Buffer.buffer is ArrayBufferLike
|
||||
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength) as ArrayBuffer;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user