UNPKG

auto-config-loader

Version:

Find and load configuration from a package.json property, rc file, or CommonJS module.

8 lines (6 loc) 271 B
import type { AST } from 'toml-eslint-parser'; import { parseTOML, getStaticTOMLValue } from 'toml-eslint-parser'; export function tomlLoader<T>(_: string, content: string): T { const ast: AST.TOMLProgram = parseTOML(content); return getStaticTOMLValue(ast) as T; }