MCPcopy
hub / github.com/webpack/webpack / scope

Function scope

lib/container/options.js:95–109  ·  view source on GitHub ↗
(scope, options)

Source from the content-addressed store, hash-verified

93 * @returns {Record<string, string | string[] | T>} options to spread or pass
94 */
95const scope = (scope, options) => {
96 /** @type {Record<string, string | string[] | T>} */
97 const obj = {};
98 process(
99 options,
100 (item) => /** @type {string | string[] | T} */ (item),
101 (item) => /** @type {string | string[] | T} */ (item),
102 (key, value) => {
103 obj[
104 key.startsWith("./") ? `${scope}${key.slice(1)}` : `${scope}/${key}`
105 ] = value;
106 }
107 );
108 return obj;
109};
110
111module.exports.parseOptions = parseOptions;
112module.exports.scope = scope;

Callers

nothing calls this directly

Calls 2

sliceMethod · 0.80
processFunction · 0.70

Tested by

no test coverage detected