(message)
| 1 | const parseResizeMessage = (message) => { |
| 2 | if (!message.startsWith?.("\x01")) return null; |
| 3 | |
| 4 | const resizeData = message.substring(1); |
| 5 | if (!resizeData.includes(",")) return null; |
| 6 | |
| 7 | const [width, height] = resizeData.split(",").map(Number); |
| 8 | if (isNaN(width) || isNaN(height)) return null; |
| 9 | |
| 10 | return { width, height }; |
| 11 | }; |
| 12 | |
| 13 | module.exports = { parseResizeMessage }; |
no outgoing calls
no test coverage detected