js-yaml-js-types

js-yaml extra types

MIT 2 个版本
安装
npm install js-yaml-js-types
yarn add js-yaml-js-types
pnpm add js-yaml-js-types
bun add js-yaml-js-types
README

js-yaml-js-types

CI NPM version

js-yaml extra types:

  • !!js/regexp /pattern/gim
  • !!js/undefined ''
  • !!js/function 'function () {...}'

Installation

npm install js-yaml-js-types

Usage

const yaml = require('js-yaml');
const unsafe = require('js-yaml-js-types').all;

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.1 2022-10-21
1.0.0 2021-01-04