tsd-extract
v0.8.17
Published
Extract any definition from TS definitions file string
Downloads
110
Maintainers
Readme
Install
This package is pure ESM. If you're not ready yet, use a non-ESM alternative, tsd-extract-noesm.
npm i tsd-extract
Quick Take
import { strict as assert } from "assert";
import { extract } from "tsd-extract";
const { value } = extract(
`interface Opts1 { foo: boolean };
interface Opts2 { bar: boolean };`,
"Opts2",
);
assert.equal(value, "interface Opts2 { bar: boolean };");
Documentation
Please visit codsen.com for a full description of the API.
Contributing
To report bugs or request features or assistance, raise an issue on GitHub.
Licence
MIT License.
Copyright © 2010-2024 Roy Revelt and other contributors.