This package is a fork of js-yaml-js-types that adds support for ES modules. It provides extra types for js-yaml:
js-yaml extra types:
- !!js/regexp /pattern/gim
- !!js/undefined ''
- !!js/function 'function () {...}'
npm install js-yaml-js-types-esm
import import yaml from "js-yaml";
import { all as unsafe } from "js-yaml-js-types";
const schema = yaml.DEFAULT_SCHEMA.extend(unsafe);
const src = `
- !!js/regexp /pattern/gim
- !!js/undefined ''
- !!js/function 'function () { return true }'
`
yaml.load(src, { schema });