* Writes the given contents to the patched file if updated * @param {string} patchedName Name of patched file * @param {string} file Contents to write
(patchedName, file)
| 16 | * @param {string} file Contents to write |
| 17 | */ |
| 18 | function writeIfUpdated(patchedName, file) { |
| 19 | if ( |
| 20 | !fs.existsSync(patchedName) || |
| 21 | fs.readFileSync(patchedName, 'utf8') != file |
| 22 | ) { |
| 23 | fs.writeFileSync(patchedName, file); |
| 24 | logLocalDev('Patched', cyan(patchedName)); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Patches Web Animations polyfill by wrapping its body into `install` function. |
no test coverage detected