@raintech-oss/jovo-dew
Version:
Dew View Engine for Jovo
25 lines • 916 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OutputProcessor = void 0;
const lodash_1 = require("lodash");
const BaseProcessor_1 = require("./BaseProcessor");
class OutputProcessor extends BaseProcessor_1.BaseProcessor {
constructor(plugin, jovo) {
super(plugin, jovo);
this.plugin = plugin;
this.jovo = jovo;
}
process(key, obj, viewPath, data) {
// console.log({ key, obj, viewPath });
const response = {};
let value = this.jovo.$t(`${viewPath}.${key}`, data);
if (this.plugin.returnResourcePathKeysOnly.includes(key)) {
// overwrite value with path
value = `${viewPath}.${key}`;
}
(0, lodash_1.set)(response, key, value);
return response;
}
}
exports.OutputProcessor = OutputProcessor;
//# sourceMappingURL=OutputProcessor.js.map