(records, observer)
| 16 | } |
| 17 | |
| 18 | const callback = async (records, observer) => { |
| 19 | const icons = { |
| 20 | created: '✅', |
| 21 | appeared: '✅', |
| 22 | modified: '📝', |
| 23 | deleted: '🗑️', |
| 24 | disappeared: '🗑️', |
| 25 | }; |
| 26 | for (const record of records) { |
| 27 | console.log(record); |
| 28 | if (record.changedHandle && record.changedHandle.name.endsWith('.crswap')) { |
| 29 | continue; |
| 30 | } |
| 31 | if (!record.changedHandle) { |
| 32 | continue; |
| 33 | } |
| 34 | logMessage( |
| 35 | `The ${record.changedHandle.kind} "${record.changedHandle.name}" ${['modified', 'deleted', 'created'].includes(record.type) ? 'was ' : ''}${ |
| 36 | icons[record.type] |
| 37 | } ${record.type}` |
| 38 | ); |
| 39 | } |
| 40 | }; |
| 41 | |
| 42 | (async () => { |
| 43 | const observer = new self.FileSystemObserver(callback); |
no test coverage detected