All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scaffolding.custom-module.mjs.main-ingestion-legacy-upgrade.mjs Maven / Gradle / Ivy

There is a newer version: 6.1.1
Show newest version
import hubUtils from "/data-hub/5/impl/hub-utils.mjs";

function main(content, options) {
  const legacyOptions = options.options;
  const contentUri = content["uri"];
  let contentValue = content["value"];
  const contentContext = content["context"];

  if(hubUtils.isJsonDocument(contentValue)) {
    contentValue = contentValue.toObject();
    contentValue = (contentValue && contentValue.content) ? contentValue.content : contentValue;
  }

  let result = {};
  result["uri"] = contentUri;
  result["value"] = require(legacyOptions["mainModuleUri"]).main(contentUri, contentValue, legacyOptions);
  result["context"] = contentContext;

  return result;
}

export default {
  main
};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy