MCPcopy
hub / github.com/webpack/webpack / getLibraryName

Function getLibraryName

lib/config/defaults.js:1446–1462  ·  view source on GitHub ↗
(library)

Source from the content-addressed store, hash-verified

1444 * @returns {string} a readable library name
1445 */
1446 const getLibraryName = (library) => {
1447 const libraryName =
1448 typeof library === "object" &&
1449 library &&
1450 !Array.isArray(library) &&
1451 "type" in library
1452 ? library.name
1453 : /** @type {LibraryName} */ (library);
1454 if (Array.isArray(libraryName)) {
1455 return libraryName.join(".");
1456 } else if (typeof libraryName === "object") {
1457 return getLibraryName(libraryName.root);
1458 } else if (typeof libraryName === "string") {
1459 return libraryName;
1460 }
1461 return "";
1462 };
1463
1464 F(output, "uniqueName", () => {
1465 const libraryName = getLibraryName(output.library).replace(

Callers 1

applyOutputDefaultsFunction · 0.85

Calls 1

isArrayMethod · 0.80

Tested by

no test coverage detected