8000 Can't Parse a Stringified example. · Issue #21 · LongTengDao/j-toml · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Can't Parse a Stringified example. #21
Closed
@meyverick

Description

@meyverick

I try to stringify the readme example and then parse it and it returns an error. Am I doing it wrong?

Script

import TOML from "@ltd/j-toml";

const test = TOML.stringify({
	key: "value",
	dotted: {
		key: "value",
	},
	inlineTable: TOML.inline({ key: "value" }),
	mix: {
		key: "value",
		table: TOML.Section({
			key: "value",
		}),
	},
	table: TOML.Section({
		key: "value",
		table: TOML.Section({
			key: "value",
		}),
	}),
});

const rootTable = TOML.parse(test);

Returns

PS C:\Users\User Name\Files\My Project\app> node helpers/configFile.js
file:///C:/Users/User%20Name/Files/My%20Project/app/node_modules/@ltd/j-toml/index.mjs:2230
    if ( typeof sourcePath!=='string' ) { throw TypeError$1('TOML.parse(source.path)'); }
                                                                            ^

TypeError: TOML.parse(source.path)
    at parse (file:///C:/Users/User%20Name/Files/My%20Project/app/node_modules/@ltd/j-toml/index.mjs:2230:49)
    at Module.parse (file:///C:/Users/User%20Name/Files/My%20Project/app/node_modules/@ltd/j-toml/index.mjs:2293:6)
    at file:///C:/Users/User%20Name/Files/V%20Rising/app/helpers/configFile.js:38:24
    at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:409:24)
    at async loadESM (node:internal/process/esm_loader:85:5)
    at async handleMainPromise (node:internal/modules/run_main:61:12)

Node.js v17.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0