UNPKG

alacritty-theme-switch

Version:
26 lines (25 loc) 766 B
// Copyright 2018-2025 the Deno authors. MIT license. // This module is browser compatible. import { parserFactory, toml } from "./_parser.js"; /** * Parses a {@link https://toml.io | TOML} string into an object. * * @example Usage * ```ts * import { parse } from "@std/toml/parse"; * import { assertEquals } from "@std/assert"; * * const tomlString = `title = "TOML Example" * [owner] * name = "Alice" * bio = "Alice is a programmer."`; * * const obj = parse(tomlString); * assertEquals(obj, { title: "TOML Example", owner: { name: "Alice", bio: "Alice is a programmer." } }); * ``` * @param tomlString TOML string to be parsed. * @returns The parsed JS object. */ export function parse(tomlString) { return parserFactory(toml)(tomlString); }