i18next/i18next

View on GitHub
src/postProcessor.js

Summary

Maintainability
A
35 mins
Test Coverage
export default {
  processors: {},

  addPostProcessor(module) {
    this.processors[module.name] = module;
  },

  handle(processors, value, key, options, translator) {
    processors.forEach((processor) => {
      if (this.processors[processor])
        value = this.processors[processor].process(value, key, options, translator);
    });

    return value;
  },
};