js-yaml-js-types-esm
v1.0.0
Published
js-yaml extra types with ESM support
Downloads
103
Readme
js-yaml-js-types-esm
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 () {...}'
Installation
npm install js-yaml-js-types-esm
Usage
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 });