@jsverse/transloco-keys-manager
Version:
Extract translatable keys from projects that uses Transloco
17 lines • 602 B
JavaScript
import { isObject } from '../../utils/validators.utils.js';
export function removeExtraKeys(currentTranslation, extractedTranslation) {
const resolved = {};
for (const key in currentTranslation) {
if (!extractedTranslation.hasOwnProperty(key)) {
continue;
}
if (isObject(currentTranslation[key])) {
resolved[key] = removeExtraKeys(currentTranslation[key], extractedTranslation[key]);
}
else {
resolved[key] = currentTranslation[key];
}
}
return resolved;
}
//# sourceMappingURL=remove-extra-keys.js.map