Skip to content

Commit

Permalink
refine map format
Browse files Browse the repository at this point in the history
  • Loading branch information
asdofindia committed Nov 19, 2016
1 parent 9d9d70d commit 21ecd28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function getJSONMap (inmap) {
}

function transformToMap(text) {
let JSONMap = {};
let JSONMap = {"map":{}};
let lines = text.split('\n');
for (let line of lines) {
line = line.trim();
Expand All @@ -27,7 +27,9 @@ function transformToMap(text) {
continue;
} else if (line.includes("=")) {
let equation = line.split("=");
JSONMap[equation[0]] = equation[1];
let lhs = equation[0].trim();
let rhs = equation[1].trim();
JSONMap["map"][lhs] = rhs;
}
}
return JSONMap;
Expand Down

0 comments on commit 21ecd28

Please sign in to comment.