|
|
|
@ -13,9 +13,17 @@ module.exports = function createPropertyMapper(propertyMap) {
|
|
|
|
|
transformer: destinationPath
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
let destinationObject, destinationProperty;
|
|
|
|
|
|
|
|
|
|
if (destinationPath.includes(".")) {
|
|
|
|
|
let destinationPathParts = destinationPath.split(".");
|
|
|
|
|
let destinationObject = destinationPathParts[0];
|
|
|
|
|
let destinationProperty = destinationPathParts.slice(1).join(".");
|
|
|
|
|
|
|
|
|
|
destinationObject = destinationPathParts[0];
|
|
|
|
|
destinationProperty = destinationPathParts.slice(1).join(".");
|
|
|
|
|
} else {
|
|
|
|
|
destinationObject = destinationPath;
|
|
|
|
|
destinationProperty = sourceProperty;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
sourceProperty: sourceProperty,
|
|
|
|
@ -82,8 +90,8 @@ module.exports = function createPropertyMapper(propertyMap) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let mapper = module.exports({
|
|
|
|
|
foo: "one.foo",
|
|
|
|
|
bar: "two.bar",
|
|
|
|
|
foo: "one",
|
|
|
|
|
bar: "two",
|
|
|
|
|
twoFoo: "two.foo",
|
|
|
|
|
baz: (value) => {
|
|
|
|
|
return {
|
|
|
|
|