| 50 | } |
| 51 | |
| 52 | function queue(_event, filename) { |
| 53 | if (!filename) return; |
| 54 | const fullPath = resolve(root, String(filename)); |
| 55 | const remotePath = toRemotePath(fullPath); |
| 56 | if (!remotePath || isIgnored(remotePath)) return; |
| 57 | clearTimeout(pending.get(remotePath)); |
| 58 | pending.set(remotePath, setTimeout(() => { |
| 59 | pending.delete(remotePath); |
| 60 | sync(fullPath, remotePath).catch((error) => console.error(`sync error ${remotePath} ${message(error)}`)); |
| 61 | }, debounceMs)); |
| 62 | } |
| 63 | |
| 64 | function toRemotePath(fullPath) { |
| 65 | const localPath = relative(root, fullPath); |