Commit 8d1b7740 authored by PTSEFTON's avatar PTSEFTON
Browse files

Updating for new ro-crate

parent 8d574a2f
No preview for this file type
......@@ -57,6 +57,9 @@ module.exports = function() {
parse: function parse(name, data = "", links_to = null) {
this.data = data;
if (Array.isArray(data)) {
data = data[0];
}
this.links_to = links_to;
this.is_relational = this.links_to ? true : false;
this.is_repeating = false;
......@@ -104,13 +107,11 @@ module.exports = function() {
//console.log("Nesting, this is the name", this.name)
var nested_type = nest[2];
var nested_json = { "TYPE:": nested_type };
var parts = data.replace(/ *, +/, ",").split(",");
//console.log(parts)
for (var i = 0; i < parts.length; i++) {
var part = parts[i];
var pair = part.match(/(.*?) *: *(.*)/);
nested_json[lowercase_first(pair[1]).trim()] = pair[2].trim();
}
if (!nested_json["name"]) {
......
......@@ -31,7 +31,7 @@
"json": "^9.0.6",
"jsonld": "^1.6.2",
"node-json2html": "^1.1.1",
"ro-crate": "^1.2.7",
"ro-crate": "^1.2.11",
"sha1": "^1.1.1",
"shelljs": "^0.8.1",
"tmp": "0.0.33",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment