MCPcopy
hub / github.com/webpack/webpack / buildMap

Function buildMap

tooling/generate-html-entities.js:94–102  ·  view source on GitHub ↗
(entities)

Source from the content-addressed store, hash-verified

92 * @returns {Record<string, string>} name -> decoded characters
93 */
94const buildMap = (entities) => {
95 /** @type {Record<string, string>} */
96 const map = {};
97 // Sort alphabetically so the emitted literal is deterministic.
98 for (const k of Object.keys(entities).sort()) {
99 map[k.slice(1)] = entities[k].characters;
100 }
101 return map;
102};
103
104/**
105 * Render the `// #region html entities` … `// #endregion` block. The entity

Callers 1

Calls 3

sortMethod · 0.80
sliceMethod · 0.80
keysMethod · 0.65

Tested by

no test coverage detected