* feat(serial): support local Windows named pipe consoles * test(serial): synchronize pipe acceptance and cover saved-host form * fix(serial): preserve named-pipe paths with spaces when editing hosts * test(serial): verify Windows pipes through native Electron IPC * test(serial): keep Electron listener callbacks in renderer context * test(serial): cover busy pipe cancellation and bounded slow-reader writes * test(serial): construct single-instance fixture pipe path correctly
10 lines
381 B
TypeScript
10 lines
381 B
TypeScript
// Keep in sync with electron/bridges/serialNamedPipe.cjs.
|
|
export function isWindowsNamedPipePath(value: string): boolean {
|
|
return /^\\\\[.?]\\pipe\\[^\r\n\0]+$/i.test(value);
|
|
}
|
|
|
|
export function isSerialEndpointPath(value: string): boolean {
|
|
return value.startsWith('/dev/') || /^COM\d+$/i.test(value)
|
|
|| /^\\\\\.\\COM\d+$/i.test(value) || isWindowsNamedPipePath(value);
|
|
}
|