MCPcopy
hub / github.com/ampproject/amphtml / createReplacement

Function createReplacement

build-system/babel-config/helpers.js:39–45  ·  view source on GitHub ↗

* @param {string} identifierName the identifier name to replace * @param {boolean|string} value the value to replace with * @return {!Object} replacement options used by minify-replace plugin

(identifierName, value)

Source from the content-addressed store, hash-verified

37 * @return {!Object} replacement options used by minify-replace plugin
38 */
39 function createReplacement(identifierName, value) {
40 const replacement =
41 typeof value === 'boolean'
42 ? {type: 'booleanLiteral', value}
43 : {type: 'stringLiteral', value};
44 return {identifierName, replacement};
45 }
46
47 const constants = Object.assign({}, BUILD_CONSTANTS, opt_overrides);
48 const replacements = Object.entries(constants).map(([ident, val]) =>

Callers 1

getReplacePluginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected