deno.land / std@0.224.0 / yaml / schema / extended.ts

extended.ts
View Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.// This module is browser compatible.
import { Schema } from "../schema.ts";import { regexp, undefinedType } from "../_type/mod.ts";import { DEFAULT_SCHEMA } from "./default.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. * * @example * ```ts * import { * EXTENDED_SCHEMA, * parse, * } from "https://deno.land/std@$STD_VERSION/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 }, * ); * ``` */export const EXTENDED_SCHEMA: Schema = new Schema({ explicit: [regexp, undefinedType], include: [DEFAULT_SCHEMA],});
/*** * 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. * * @example * ```ts * import { * EXTENDED_SCHEMA, * parse, * } from "https://deno.land/std@$STD_VERSION/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 }, * ); * ``` * * @deprecated This will be removed in 1.0.0. Use {@link EXTENDED_SCHEMA} instead. */export const extended = EXTENDED_SCHEMA;
std

Version Info

Tagged at
6 months ago