'use strict'; const inArray = require("in-array"); module.exports = function parseValue(item) { /* We require() this here due to circular imports... */ const tableToStructure = require("./table-to-structure"); if (item.type === "TableConstructorExpression") { return tableToStructure(item); } else if (inArray(["BooleanLiteral", "NumericLiteral", "StringLiteral"], item.type)) { return item.value; } else { throw new Error(`Unknown type ${item.type} encountered`); } }