@o3co/ts.hocon 1.8.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 +38 -5
- 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 +139 -43
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +139 -43
- package/dist/zod.cjs +139 -43
- package/dist/zod.d.cts +1 -1
- package/dist/zod.d.ts +1 -1
- package/dist/zod.js +139 -43
- package/package.json +44 -9
- 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,27 @@
|
|
|
1
|
+
import { C as Config } from '../config-PdhVgeLS.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Read a `java.util.Properties` file as HOCON config.
|
|
5
|
+
*
|
|
6
|
+
* The result is a fully resolved Config holding only strings, so it works as a
|
|
7
|
+
* fallback layer under your own document:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* const base = parsePropertiesConfig(readFileSync('service.properties', 'utf-8'))
|
|
11
|
+
* const cfg = parse(readFileSync('app.conf', 'utf-8'), { resolveSubstitutions: false })
|
|
12
|
+
* const merged = cfg.withFallback(base).resolve()
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Deferring resolution matters: the default `parse` resolves as it goes, so a
|
|
16
|
+
* `${...}` pointing into the Properties file would fail before the fallback is
|
|
17
|
+
* ever attached.
|
|
18
|
+
*
|
|
19
|
+
* A `${a.b}` in a value stays that literal text — the file belongs to another
|
|
20
|
+
* program that never agreed to HOCON's syntax (spec F0.2).
|
|
21
|
+
*
|
|
22
|
+
* Shares its syntax layer with `include "x.properties"`, so the two cannot
|
|
23
|
+
* drift apart.
|
|
24
|
+
*/
|
|
25
|
+
declare function parsePropertiesConfig(input: string, originDescription?: string): Config;
|
|
26
|
+
|
|
27
|
+
export { parsePropertiesConfig };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { C as Config } from '../config-PdhVgeLS.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Read a `java.util.Properties` file as HOCON config.
|
|
5
|
+
*
|
|
6
|
+
* The result is a fully resolved Config holding only strings, so it works as a
|
|
7
|
+
* fallback layer under your own document:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* const base = parsePropertiesConfig(readFileSync('service.properties', 'utf-8'))
|
|
11
|
+
* const cfg = parse(readFileSync('app.conf', 'utf-8'), { resolveSubstitutions: false })
|
|
12
|
+
* const merged = cfg.withFallback(base).resolve()
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Deferring resolution matters: the default `parse` resolves as it goes, so a
|
|
16
|
+
* `${...}` pointing into the Properties file would fail before the fallback is
|
|
17
|
+
* ever attached.
|
|
18
|
+
*
|
|
19
|
+
* A `${a.b}` in a value stays that literal text — the file belongs to another
|
|
20
|
+
* program that never agreed to HOCON's syntax (spec F0.2).
|
|
21
|
+
*
|
|
22
|
+
* Shares its syntax layer with `include "x.properties"`, so the two cannot
|
|
23
|
+
* drift apart.
|
|
24
|
+
*/
|
|
25
|
+
declare function parsePropertiesConfig(input: string, originDescription?: string): Config;
|
|
26
|
+
|
|
27
|
+
export { parsePropertiesConfig };
|