@o3co/ts.hocon 1.3.0 → 1.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3co/ts.hocon",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "Full Lightbend HOCON spec-compliant parser and config library for TypeScript",
5
5
  "keywords": [
6
6
  "hocon",
@@ -38,8 +38,10 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
+ "@types/js-yaml": "^4.0.9",
41
42
  "@types/node": "^25.5.0",
42
43
  "@vitest/coverage-v8": "4.1.2",
44
+ "js-yaml": "^4.1.1",
43
45
  "tsup": "^8.5.1",
44
46
  "typedoc": "^0.28.18",
45
47
  "typescript": "^5.9.3",
@@ -1,53 +0,0 @@
1
- type DurationUnit = 'ns' | 'us' | 'ms' | 's' | 'm' | 'h' | 'd';
2
- type ByteUnit = 'B' | 'KB' | 'KiB' | 'MB' | 'MiB' | 'GB' | 'GiB' | 'TB' | 'TiB';
3
-
4
- type ScalarValueType = 'string' | 'number' | 'boolean' | 'null';
5
- type HoconValue = {
6
- kind: 'object';
7
- fields: Map<string, HoconValue>;
8
- } | {
9
- kind: 'array';
10
- items: HoconValue[];
11
- } | {
12
- kind: 'scalar';
13
- raw: string;
14
- valueType: ScalarValueType;
15
- };
16
-
17
- declare class Config {
18
- private readonly root;
19
- constructor(root: HoconValue & {
20
- kind: 'object';
21
- });
22
- get(path: string): unknown;
23
- getString(path: string): string;
24
- getNumber(path: string): number;
25
- getBoolean(path: string): boolean;
26
- getDuration(path: string, unit?: DurationUnit): number;
27
- getBytes(path: string, unit?: ByteUnit): number;
28
- getConfig(path: string): Config;
29
- getList(path: string): unknown[];
30
- has(path: string): boolean;
31
- keys(): string[];
32
- withFallback(fallback: Config): Config;
33
- toObject(): unknown;
34
- private lookupNode;
35
- private requireScalar;
36
- }
37
-
38
- type ParseOptions = {
39
- baseDir?: string;
40
- env?: Record<string, string>;
41
- readFile?: (filePath: string) => Promise<string>;
42
- readFileSync?: (filePath: string) => string;
43
- };
44
- declare function parse(input: string, opts?: ParseOptions): Config;
45
- /**
46
- * Truly async version of `parse()`. Include directives are resolved
47
- * asynchronously via `readFile` when provided.
48
- */
49
- declare function parseAsync(input: string, opts?: ParseOptions): Promise<Config>;
50
- declare function parseFile(filePath: string, opts?: ParseOptions): Config;
51
- declare function parseFileAsync(filePath: string, opts?: ParseOptions): Promise<Config>;
52
-
53
- export { type ByteUnit as B, Config as C, type DurationUnit as D, type HoconValue as H, type ParseOptions as P, type ScalarValueType as S, parseAsync as a, parseFile as b, parseFileAsync as c, parse as p };
@@ -1,53 +0,0 @@
1
- type DurationUnit = 'ns' | 'us' | 'ms' | 's' | 'm' | 'h' | 'd';
2
- type ByteUnit = 'B' | 'KB' | 'KiB' | 'MB' | 'MiB' | 'GB' | 'GiB' | 'TB' | 'TiB';
3
-
4
- type ScalarValueType = 'string' | 'number' | 'boolean' | 'null';
5
- type HoconValue = {
6
- kind: 'object';
7
- fields: Map<string, HoconValue>;
8
- } | {
9
- kind: 'array';
10
- items: HoconValue[];
11
- } | {
12
- kind: 'scalar';
13
- raw: string;
14
- valueType: ScalarValueType;
15
- };
16
-
17
- declare class Config {
18
- private readonly root;
19
- constructor(root: HoconValue & {
20
- kind: 'object';
21
- });
22
- get(path: string): unknown;
23
- getString(path: string): string;
24
- getNumber(path: string): number;
25
- getBoolean(path: string): boolean;
26
- getDuration(path: string, unit?: DurationUnit): number;
27
- getBytes(path: string, unit?: ByteUnit): number;
28
- getConfig(path: string): Config;
29
- getList(path: string): unknown[];
30
- has(path: string): boolean;
31
- keys(): string[];
32
- withFallback(fallback: Config): Config;
33
- toObject(): unknown;
34
- private lookupNode;
35
- private requireScalar;
36
- }
37
-
38
- type ParseOptions = {
39
- baseDir?: string;
40
- env?: Record<string, string>;
41
- readFile?: (filePath: string) => Promise<string>;
42
- readFileSync?: (filePath: string) => string;
43
- };
44
- declare function parse(input: string, opts?: ParseOptions): Config;
45
- /**
46
- * Truly async version of `parse()`. Include directives are resolved
47
- * asynchronously via `readFile` when provided.
48
- */
49
- declare function parseAsync(input: string, opts?: ParseOptions): Promise<Config>;
50
- declare function parseFile(filePath: string, opts?: ParseOptions): Config;
51
- declare function parseFileAsync(filePath: string, opts?: ParseOptions): Promise<Config>;
52
-
53
- export { type ByteUnit as B, Config as C, type DurationUnit as D, type HoconValue as H, type ParseOptions as P, type ScalarValueType as S, parseAsync as a, parseFile as b, parseFileAsync as c, parse as p };