MCPcopy
hub / github.com/webpack/webpack / writeFile

Method writeFile

lib/Compiler.js:1139–1162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1137 */
1138 _emitRecords(callback) {
1139 const writeFile = () => {
1140 /** @type {OutputFileSystem} */
1141 (this.outputFileSystem).writeFile(
1142 /** @type {string} */ (this.recordsOutputPath),
1143 JSON.stringify(
1144 this.records,
1145 (n, value) => {
1146 if (
1147 typeof value === "object" &&
1148 value !== null &&
1149 !Array.isArray(value)
1150 ) {
1151 const keys = Object.keys(value);
1152 if (!isSorted(keys)) {
1153 return sortObject(value, keys);
1154 }
1155 }
1156 return value;
1157 },
1158 2
1159 ),
1160 callback
1161 );
1162 };
1163
1164 const recordsOutputPathDirectory = dirname(
1165 /** @type {OutputFileSystem} */

Callers 15

doWriteMethod · 0.45
withProfilingFunction · 0.45
step2Function · 0.45
step3Function · 0.45
step4Function · 0.45
setupFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45
setupFunction · 0.45

Calls 4

isSortedFunction · 0.85
sortObjectFunction · 0.85
isArrayMethod · 0.80
keysMethod · 0.65

Tested by 3

step2Function · 0.36
step3Function · 0.36
step4Function · 0.36