MCPcopy
hub / github.com/webpack/webpack / toString

Method toString

lib/schemes/HttpUriPlugin.js:276–294  ·  view source on GitHub ↗

* Returns a string representation. * @returns {string} stringified lockfile

()

Source from the content-addressed store, hash-verified

274 * @returns {string} stringified lockfile
275 */
276 toString() {
277 let str = "{\n";
278 const entries = [...this.entries].sort(([a], [b]) => (a < b ? -1 : 1));
279 for (const [key, entry] of entries) {
280 if (typeof entry === "string") {
281 str += ` ${JSON.stringify(key)}: ${JSON.stringify(entry)},\n`;
282 } else {
283 str += ` ${JSON.stringify(key)}: { `;
284 if (entry.resolved !== key) {
285 str += `"resolved": ${JSON.stringify(entry.resolved)}, `;
286 }
287 str += `"integrity": ${JSON.stringify(
288 entry.integrity
289 )}, "contentType": ${JSON.stringify(entry.contentType)} },\n`;
290 }
291 }
292 str += ` "version": ${this.version}\n}\n`;
293 return str;
294 }
295}
296
297/**

Callers 8

deserializeFunction · 0.45
stackToStringMethod · 0.45
_serializeMethod · 0.45
readLockfileMethod · 0.45
fetchContentRawMethod · 0.45
applyMethod · 0.45
runWriteMethod · 0.45

Calls 1

sortMethod · 0.80

Tested by

no test coverage detected