(pkg: string)
| 101 | if (old.length === data.length && old.equals(data)) return; |
| 102 | } |
| 103 | fs.writeFileSync(filePath, data); |
| 104 | } |
| 105 | |
| 106 | function requireOrInstall(pkg: string): any { |
| 107 | try { |
| 108 | return require(pkg); |
| 109 | } catch (err: any) { |
| 110 | const code = err?.code; |
| 111 | if (code !== "MODULE_NOT_FOUND" && code !== "ERR_MODULE_NOT_FOUND") throw err; |
| 112 | console.warn("quote loader installing npm package", { pkg }); |
| 113 | npm_install(pkg); |
| 114 | return require(pkg); |
| 115 | } |
| 116 | } |
no test coverage detected