1.0.0 • Published 11 months ago

js-yaml-js-types-esm v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

js-yaml-js-types-esm

NPM version

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 });
1.0.0

11 months ago