@o3co/ts.hocon 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -1
- package/dist/adapters/env.cjs +1668 -0
- package/dist/adapters/env.d.cts +41 -0
- package/dist/adapters/env.d.ts +41 -0
- package/dist/adapters/env.js +1629 -0
- package/dist/adapters/jsonc.cjs +1613 -0
- package/dist/adapters/jsonc.d.cts +25 -0
- package/dist/adapters/jsonc.d.ts +25 -0
- package/dist/adapters/jsonc.js +1574 -0
- package/dist/adapters/properties.cjs +1681 -0
- package/dist/adapters/properties.d.cts +27 -0
- package/dist/adapters/properties.d.ts +27 -0
- package/dist/adapters/properties.js +1643 -0
- package/dist/adapters/toml.cjs +1570 -0
- package/dist/adapters/toml.d.cts +18 -0
- package/dist/adapters/toml.d.ts +18 -0
- package/dist/adapters/toml.js +1534 -0
- package/dist/adapters/yaml.cjs +1610 -0
- package/dist/adapters/yaml.d.cts +43 -0
- package/dist/adapters/yaml.d.ts +43 -0
- package/dist/adapters/yaml.js +1573 -0
- package/dist/index.cjs +107 -17
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +107 -17
- package/dist/zod.cjs +107 -17
- package/dist/zod.d.cts +1 -1
- package/dist/zod.d.ts +1 -1
- package/dist/zod.js +107 -17
- package/package.json +47 -13
- package/dist/{config-D27s3_aG.d.cts → config-PdhVgeLS.d.cts} +3 -3
- package/dist/{config-D27s3_aG.d.ts → config-PdhVgeLS.d.ts} +3 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { C as Config } from '../config-PdhVgeLS.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Read a YAML document as HOCON config.
|
|
5
|
+
*
|
|
6
|
+
* This is a HOCON library, not a YAML implementation, and the API keeps that
|
|
7
|
+
* boundary. What this package owns is the decoded-tree → HOCON step, exposed
|
|
8
|
+
* directly as {@link fromYamlValue}: root must be a mapping, `${...}` stays
|
|
9
|
+
* literal, NaN and infinity are refused, a multi-document stream is refused,
|
|
10
|
+
* binary becomes its base64 text. How YAML *text* becomes a tree — whether
|
|
11
|
+
* `010` is 8 or 10, whether `no` is a boolean — is the YAML library's answer,
|
|
12
|
+
* not a contract here.
|
|
13
|
+
*
|
|
14
|
+
* `parseYaml` is a convenience front on `yaml` (eemeli), pinned to
|
|
15
|
+
* `version: '1.2'` so a library default cannot drift under it. A caller who
|
|
16
|
+
* needs a different library, version or schema decodes the text themselves and
|
|
17
|
+
* hands the tree to {@link fromYamlValue} — that is the supported way to swap
|
|
18
|
+
* parsers, and it keeps the choice, and its consequences, in the caller's
|
|
19
|
+
* hands:
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import jsy from 'js-yaml'
|
|
23
|
+
* const cfg = fromYamlValue(jsy.load(src), 'their-file.yml')
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* See docs/specs/format-ingestion-mapping.md items F5.x in the hocon scope.
|
|
27
|
+
*/
|
|
28
|
+
declare function parseYaml(input: string, originDescription?: string): Config;
|
|
29
|
+
/**
|
|
30
|
+
* Build a Config from an already-decoded YAML value tree, produced by whatever
|
|
31
|
+
* YAML library and settings the caller chose. This is the tree-level boundary
|
|
32
|
+
* this module actually owns (spec F5); `parseYaml` is just a default decoder in
|
|
33
|
+
* front of it.
|
|
34
|
+
*
|
|
35
|
+
* Leaf normalization accepts the shapes common across JS YAML libraries, not
|
|
36
|
+
* only the default one: a `Map` (eemeli with `mapAsMap`) has its scalar keys
|
|
37
|
+
* stringified per F5.3, a `Date` (js-yaml 4 timestamps) becomes its ISO string
|
|
38
|
+
* — the same reasoning as F4.2 for TOML dates — and a `Uint8Array` becomes
|
|
39
|
+
* base64 (F5.5).
|
|
40
|
+
*/
|
|
41
|
+
declare function fromYamlValue(value: unknown, originDescription?: string): Config;
|
|
42
|
+
|
|
43
|
+
export { fromYamlValue, parseYaml };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { C as Config } from '../config-PdhVgeLS.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Read a YAML document as HOCON config.
|
|
5
|
+
*
|
|
6
|
+
* This is a HOCON library, not a YAML implementation, and the API keeps that
|
|
7
|
+
* boundary. What this package owns is the decoded-tree → HOCON step, exposed
|
|
8
|
+
* directly as {@link fromYamlValue}: root must be a mapping, `${...}` stays
|
|
9
|
+
* literal, NaN and infinity are refused, a multi-document stream is refused,
|
|
10
|
+
* binary becomes its base64 text. How YAML *text* becomes a tree — whether
|
|
11
|
+
* `010` is 8 or 10, whether `no` is a boolean — is the YAML library's answer,
|
|
12
|
+
* not a contract here.
|
|
13
|
+
*
|
|
14
|
+
* `parseYaml` is a convenience front on `yaml` (eemeli), pinned to
|
|
15
|
+
* `version: '1.2'` so a library default cannot drift under it. A caller who
|
|
16
|
+
* needs a different library, version or schema decodes the text themselves and
|
|
17
|
+
* hands the tree to {@link fromYamlValue} — that is the supported way to swap
|
|
18
|
+
* parsers, and it keeps the choice, and its consequences, in the caller's
|
|
19
|
+
* hands:
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import jsy from 'js-yaml'
|
|
23
|
+
* const cfg = fromYamlValue(jsy.load(src), 'their-file.yml')
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* See docs/specs/format-ingestion-mapping.md items F5.x in the hocon scope.
|
|
27
|
+
*/
|
|
28
|
+
declare function parseYaml(input: string, originDescription?: string): Config;
|
|
29
|
+
/**
|
|
30
|
+
* Build a Config from an already-decoded YAML value tree, produced by whatever
|
|
31
|
+
* YAML library and settings the caller chose. This is the tree-level boundary
|
|
32
|
+
* this module actually owns (spec F5); `parseYaml` is just a default decoder in
|
|
33
|
+
* front of it.
|
|
34
|
+
*
|
|
35
|
+
* Leaf normalization accepts the shapes common across JS YAML libraries, not
|
|
36
|
+
* only the default one: a `Map` (eemeli with `mapAsMap`) has its scalar keys
|
|
37
|
+
* stringified per F5.3, a `Date` (js-yaml 4 timestamps) becomes its ISO string
|
|
38
|
+
* — the same reasoning as F4.2 for TOML dates — and a `Uint8Array` becomes
|
|
39
|
+
* base64 (F5.5).
|
|
40
|
+
*/
|
|
41
|
+
declare function fromYamlValue(value: unknown, originDescription?: string): Config;
|
|
42
|
+
|
|
43
|
+
export { fromYamlValue, parseYaml };
|