md-curcuma
Version:
A Typescript library for transporting and converting markdown and other data.
27 lines (26 loc) • 810 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArrayJoin_Mapping = void 0;
const _ = require("lodash");
class ArrayJoin_Mapping {
constructor(properties) {
this.properties = properties;
}
perform(mapping_properties) {
let target_value = mapping_properties.source_value;
if (_.isArray(target_value)) {
target_value = target_value
.map((item) => {
if (_.isString(item)) {
return item;
}
else if (_.isObject(item)) {
return JSON.stringify(item);
}
})
.join(this.properties.separator);
}
return target_value;
}
}
exports.ArrayJoin_Mapping = ArrayJoin_Mapping;