1.0.9 • Published 5 years ago
js-yaml-type-ts-module v1.0.9
js-yaml-type-ts-module
Use it like this:
import createTSModuleType from 'js-yaml-type-ts-module'
const type = createTSModuleType()
const schema = new yaml.Schema({
include: [yaml.DEFAULT_SAFE_SCHEMA],
explicit: [type],
})
const parsed = yaml.load(
`
customModule: !!ts/module |
export default {
boolean: true,
func: () => true,
asyncFunc: async () => true,
}
`,
{ schema }
)