@sean_kenny/eu4-text-file-to-json-parser-js
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -23,8 +23,9 @@ import { readFile } from "fs/promises"; | ||
.slice(1, -1) | ||
.trim() | ||
.split(' '); | ||
currentKeyToPushTo = `${currentKeyToPushTo}${currentKeyToPushTo.length > 0 ? '.' : ''}${propertyName}`; | ||
.split("\"") | ||
.flatMap((element, index) => index % 2 === 0 ? element.split(" ") : [element]) | ||
.map((element) => element.trim()) | ||
.filter((element) => element !== ''); | ||
outputJSONData = writeValueToOutputJSONData({ | ||
outputJSONData, | ||
currentKeyToPushTo, | ||
currentKeyToPushTo: `${currentKeyToPushTo}${currentKeyToPushTo.length > 0 ? '.' : ''}${propertyName}`, | ||
valueToPush: elements | ||
@@ -68,4 +69,6 @@ }); | ||
const arrayValues = cleanedRow | ||
.split(' ') | ||
.map((element) => element.trim()); | ||
.split("\"") | ||
.flatMap((element, index) => index % 2 === 0 ? element.split(" ") : [element]) | ||
.map((element) => element.trim()) | ||
.filter((element) => element !== ''); | ||
outputJSONData = writeValueToOutputJSONData({ | ||
@@ -72,0 +75,0 @@ outputJSONData, |
{ | ||
"name": "@sean_kenny/eu4-text-file-to-json-parser-js", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A library for reading text files in the format EU4 encodes it's game data in.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
11902
159