deno.land / std@0.180.0 / encoding / jsonc.ts

نووسراو ببینە
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
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
/** * @deprecated (will be removed after 0.182.0) Import from `std/jsonc` instead. * * {@linkcode parse} function for parsing * [JSONC](https://code.visualstudio.com/docs/languages/json#_json-with-comments) * (JSON with Comments) strings. * * This module is browser compatible. * * @module */
export { /** * @deprecated (will be removed after 0.182.0) Import from `std/jsonc/parse.ts` instead. * * Valid types as a result of JSON parsing. */ type JSONValue, /** * @deprecated (will be removed after 0.182.0) Import from `std/jsonc/parse.ts` instead. * * Converts a JSON with Comments (JSONC) string into an object. * If a syntax error is found, throw a SyntaxError. * * @example * * ```ts * import * as JSONC from "https://deno.land/std@$STD_VERSION/jsonc/mod.ts"; * * console.log(JSONC.parse('{"foo": "bar", } // comment')); //=> { foo: "bar" } * console.log(JSONC.parse('{"foo": "bar", } /* comment *\/')); //=> { foo: "bar" } * console.log(JSONC.parse('{"foo": "bar" } // comment', { * allowTrailingComma: false, * })); //=> { foo: "bar" } * ``` * * @param text A valid JSONC string. */ parse, /** @deprecated (will be removed after 0.182.0) Import from `std/jsonc/parse.ts` instead. */ type ParseOptions,} from "../jsonc/mod.ts";
std

Version Info

Tagged at
a year ago