Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/yaml/schema/extended.ts>extended

The Deno Standard Library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
variable extended
Deprecated
Deprecated

(will be removed in 1.0.0) Use EXTENDED_SCHEMA instead.

import { extended } from "https://deno.land/std@0.222.1/yaml/schema/extended.ts";

Extends JS-YAML default schema with additional JavaScript types It is not described in the YAML specification. Functions are no longer supported for security reasons.

Examples

Example 1

import {
  EXTENDED_SCHEMA,
  parse,
} from "https://deno.land/std@0.222.1/yaml/mod.ts";

const data = parse(
  `
  regexp:
    simple: !!js/regexp foobar
    modifiers: !!js/regexp /foobar/mi
  undefined: !!js/undefined ~
# Disabled, see: https://github.com/denoland/deno_std/pull/1275
#  function: !!js/function >
#    function foobar() {
#      return 'hello world!';
#    }
`,
  { schema: EXTENDED_SCHEMA },
);