MCPcopy Create free account
hub / github.com/ampproject/amphtml / cloneLocalizedStringBundle

Function cloneLocalizedStringBundle

src/service/localization/strings.js:156–162  ·  view source on GitHub ↗

* Creates a deep copy of the specified LocalizedStringBundle. * @param {!LocalizedStringBundleDef} localizedStringBundle * @return {!LocalizedStringBundleDef}

(localizedStringBundle)

Source from the content-addressed store, hash-verified

154 * @return {!LocalizedStringBundleDef}
155 */
156function cloneLocalizedStringBundle(localizedStringBundle) {
157 return /** @type {!LocalizedStringBundleDef} */ (
158 parseJson(
159 JSON.stringify(/** @type {!JsonObject} */ (localizedStringBundle))
160 )
161 );
162}
163
164/**
165 * Creates a pseudo locale by applying string transformations (specified by the

Callers 1

createPseudoLocaleFunction · 0.85

Calls 2

parseJsonFunction · 0.90
stringifyMethod · 0.80

Tested by

no test coverage detected