@effected/toml 0.14.0 → 0.15.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/Toml.js CHANGED
@@ -6,7 +6,7 @@ import { stringifyValue } from "./internal/stringifyValue.js";
6
6
  import { TomlDiagnostic } from "./TomlDiagnostic.js";
7
7
  import { Effect, Result, Schema, SchemaIssue, SchemaTransformation } from "effect";
8
8
 
9
- //#region src/Toml.ts
9
+ // src/Toml.ts
10
10
  /**
11
11
  * Options controlling stringify behavior. The only knob is `newline` —
12
12
  * omitted, it resolves to `"\n"`.
@@ -303,5 +303,4 @@ var Toml = class Toml {
303
303
  }
304
304
  };
305
305
 
306
- //#endregion
307
306
  export { Toml, TomlParseError, TomlStringifyError, TomlStringifyOptions };
package/TomlDateTime.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
 
3
- //#region src/TomlDateTime.ts
3
+ // src/TomlDateTime.ts
4
4
  /** Zero-pad `value` to `width` digits (never truncates a wider value). */
5
5
  function pad(value, width) {
6
6
  return String(value).padStart(width, "0");
@@ -143,5 +143,4 @@ var TomlOffsetDateTime = class extends Schema.Class("TomlOffsetDateTime")(Schema
143
143
  }
144
144
  };
145
145
 
146
- //#endregion
147
146
  export { TomlLocalDate, TomlLocalDateTime, TomlLocalTime, TomlOffsetDateTime };
package/TomlDiagnostic.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { TOML_LEX_ERROR_CODES, TOML_PARSE_ERROR_CODES, TOML_SEMANTIC_ERROR_CODES, TOML_STRINGIFY_ERROR_CODES } from "./internal/diagnostics.js";
2
2
  import { Schema } from "effect";
3
3
 
4
- //#region src/TomlDiagnostic.ts
4
+ // src/TomlDiagnostic.ts
5
5
  /**
6
6
  * Error codes emitted by the lexer stage.
7
7
  *
@@ -106,5 +106,4 @@ function lineChar(text, offset) {
106
106
  };
107
107
  }
108
108
 
109
- //#endregion
110
109
  export { TomlDiagnostic, TomlErrorCode, TomlLexErrorCode, TomlParseErrorCode, TomlSemanticErrorCode, TomlStringifyErrorCode };
package/TomlDocument.js CHANGED
@@ -7,7 +7,7 @@ import { TomlDiagnostic } from "./TomlDiagnostic.js";
7
7
  import { TomlParseError } from "./Toml.js";
8
8
  import { Effect, Schema, SchemaIssue, SchemaTransformation } from "effect";
9
9
 
10
- //#region src/TomlDocument.ts
10
+ // src/TomlDocument.ts
11
11
  /**
12
12
  * Materialize an engine throw into the typed error: `RawTomlError` becomes a
13
13
  * positioned diagnostic and a `GuardExceeded` depth trip becomes a
@@ -133,5 +133,4 @@ var TomlDocument = class TomlDocument extends Schema.Class("TomlDocument")({
133
133
  }
134
134
  };
135
135
 
136
- //#endregion
137
136
  export { TomlDocument };
package/TomlEdit.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
 
3
- //#region src/TomlEdit.ts
3
+ // src/TomlEdit.ts
4
4
  /**
5
5
  * A range within a TOML document, expressed as a zero-based character
6
6
  * `offset` and a `length` in UTF-16 code units. Pass to `TomlFormat.format`
@@ -52,5 +52,4 @@ var TomlEdit = class extends Schema.Class("TomlEdit")({
52
52
  }
53
53
  };
54
54
 
55
- //#endregion
56
55
  export { TomlEdit, TomlRange };
package/TomlFormat.js CHANGED
@@ -9,7 +9,7 @@ import { TomlDocument } from "./TomlDocument.js";
9
9
  import { TomlEdit } from "./TomlEdit.js";
10
10
  import { Effect, Schema } from "effect";
11
11
 
12
- //#region src/TomlFormat.ts
12
+ // src/TomlFormat.ts
13
13
  /**
14
14
  * Options controlling formatting and modification behavior. The only knob is
15
15
  * `newline`: for `format` it normalizes every newline outside multi-line
@@ -657,5 +657,4 @@ var TomlFormat = class TomlFormat {
657
657
  });
658
658
  };
659
659
 
660
- //#endregion
661
660
  export { TomlFormat, TomlFormattingOptions, TomlModificationError };
package/TomlNode.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { TomlLocalDate, TomlLocalDateTime, TomlLocalTime, TomlOffsetDateTime } from "./TomlDateTime.js";
2
2
  import { Schema } from "effect";
3
3
 
4
- //#region src/TomlNode.ts
4
+ // src/TomlNode.ts
5
5
  /**
6
6
  * The three simple-key spellings: `bare`, `basic` (`"..."`) and `literal`
7
7
  * (`'...'`).
@@ -209,5 +209,4 @@ const TomlExpression = Schema.Union([
209
209
  TomlTrivia
210
210
  ]);
211
211
 
212
- //#endregion
213
212
  export { TomlArray, TomlArrayTableHeader, TomlBoolean, TomlDateTimeLiteral, TomlExpression, TomlFloat, TomlInlineEntry, TomlInlineTable, TomlInteger, TomlKey, TomlKeyKind, TomlKeyValue, TomlString, TomlStringStyle, TomlTableHeader, TomlTrivia, TomlValueNode };
package/TomlVisitor.js CHANGED
@@ -8,7 +8,7 @@ import { TomlDiagnostic } from "./TomlDiagnostic.js";
8
8
  import { TomlParseError } from "./Toml.js";
9
9
  import { Data, Effect, Stream } from "effect";
10
10
 
11
- //#region src/TomlVisitor.ts
11
+ // src/TomlVisitor.ts
12
12
  /**
13
13
  * Constructors and matchers for the `TomlVisitorEvent` union (e.g.
14
14
  * `TomlVisitorEvent.KeyValue({ path, node })`, `TomlVisitorEvent.$is("Comment")`).
@@ -162,5 +162,4 @@ var TomlVisitor = class {
162
162
  }
163
163
  };
164
164
 
165
- //#endregion
166
165
  export { TomlVisitor, TomlVisitorEvent };
package/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Data, Effect, Result, Schema, Stream } from "effect";
2
- //#region src/TomlDiagnostic.d.ts
3
2
  /**
4
3
  * Error codes emitted by the lexer stage.
5
4
  *
@@ -99,8 +98,6 @@ export declare class TomlDiagnostic extends TomlDiagnostic_base {
99
98
  readonly length: number;
100
99
  }): TomlDiagnostic;
101
100
  }
102
- //#endregion
103
- //#region src/Toml.d.ts
104
101
  declare const TomlStringifyOptions_base: Schema.Class<TomlStringifyOptions, Schema.Struct<{
105
102
  readonly newline: Schema.optionalKey<Schema.Literals<readonly ["\n", "\r\n"]>>;
106
103
  }>, {}>;
@@ -360,8 +357,6 @@ export declare class Toml {
360
357
  */
361
358
  static bind<T, E, RD = never, RE = never>(target: Schema.Codec<T, E, RD, RE>): TomlBoundCodec<T, RD, RE>;
362
359
  }
363
- //#endregion
364
- //#region src/TomlDateTime.d.ts
365
360
  declare const TomlLocalDate_base: Schema.Class<TomlLocalDate, Schema.Struct<{
366
361
  year: Schema.Int;
367
362
  month: Schema.Int;
@@ -429,8 +424,6 @@ declare const TomlOffsetDateTime_base: Schema.Class<TomlOffsetDateTime, Schema.S
429
424
  export declare class TomlOffsetDateTime extends TomlOffsetDateTime_base {
430
425
  toString(): string;
431
426
  }
432
- //#endregion
433
- //#region src/TomlNode.d.ts
434
427
  /**
435
428
  * The three simple-key spellings: `bare`, `basic` (`"..."`) and `literal`
436
429
  * (`'...'`).
@@ -647,8 +640,6 @@ export declare const TomlExpression: Schema.Union<readonly [typeof TomlKeyValue,
647
640
  * @public
648
641
  */
649
642
  export type TomlExpression = typeof TomlExpression.Type;
650
- //#endregion
651
- //#region src/TomlDocument.d.ts
652
643
  declare const TomlDocument_base: Schema.Class<TomlDocument, Schema.Struct<{
653
644
  readonly source: Schema.String;
654
645
  readonly expressions: Schema.$Array<Schema.Union<readonly [typeof TomlKeyValue, typeof TomlTableHeader, typeof TomlArrayTableHeader, typeof TomlTrivia]>>;
@@ -726,8 +717,6 @@ export declare class TomlDocument extends TomlDocument_base {
726
717
  */
727
718
  stringify(): string;
728
719
  }
729
- //#endregion
730
- //#region src/TomlEdit.d.ts
731
720
  /**
732
721
  * A single path segment: a `string` for table keys or a `number` for array
733
722
  * and array-of-tables indices.
@@ -784,8 +773,6 @@ export declare class TomlEdit extends TomlEdit_base {
784
773
  */
785
774
  static applyAll(text: string, edits: ReadonlyArray<TomlEdit>): string;
786
775
  }
787
- //#endregion
788
- //#region src/TomlFormat.d.ts
789
776
  /**
790
777
  * A range accepted at the `format`/`formatToString` call sites: either a
791
778
  * {@link TomlRange} instance or a plain `{ offset, length }` literal (the two
@@ -925,8 +912,6 @@ export declare class TomlFormat {
925
912
  */
926
913
  static readonly modifyToString: (text: string, path: TomlPath, value: unknown, options?: TomlFormattingOptions | undefined) => Effect.Effect<string, TomlModificationError | TomlParseError, never>;
927
914
  }
928
- //#endregion
929
- //#region src/TomlVisitor.d.ts
930
915
  /**
931
916
  * The discriminated union of TOML visitor events, in document order.
932
917
  * `TableStart` fires once for the root with `path: []` before any other
@@ -1116,6 +1101,5 @@ export declare class TomlVisitor {
1116
1101
  */
1117
1102
  static visit(text: string): Stream.Stream<TomlVisitorEvent, TomlParseError>;
1118
1103
  }
1119
- //#endregion
1120
1104
  export type { TomlBoundCodec, TomlPath, TomlRangeLike, TomlSegment };
1121
1105
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- //#region src/internal/diagnostics.ts
1
+ // src/internal/diagnostics.ts
2
2
  const TOML_LEX_ERROR_CODES = [
3
3
  "InvalidUtf8",
4
4
  "UnterminatedString",
@@ -47,5 +47,4 @@ var RawTomlError = class extends Error {
47
47
  };
48
48
  const isRawTomlError = (u) => u instanceof RawTomlError;
49
49
 
50
- //#endregion
51
50
  export { RawTomlError, TOML_LEX_ERROR_CODES, TOML_PARSE_ERROR_CODES, TOML_SEMANTIC_ERROR_CODES, TOML_STRINGIFY_ERROR_CODES, isRawTomlError };
@@ -1,4 +1,4 @@
1
- //#region src/internal/limits.ts
1
+ // src/internal/limits.ts
2
2
  /**
3
3
  * Raw guard-trip signal. The engine throws it; ONLY the public modules catch
4
4
  * it and materialize the typed error. It must never escape a public entry
@@ -20,5 +20,4 @@ var GuardExceeded = class extends Error {
20
20
  };
21
21
  const isGuardExceeded = (u) => u instanceof GuardExceeded;
22
22
 
23
- //#endregion
24
23
  export { GuardExceeded, isGuardExceeded };
@@ -4,7 +4,7 @@ import { TomlLocalDate, TomlLocalDateTime, TomlLocalTime, TomlOffsetDateTime } f
4
4
  import { TomlArray, TomlArrayTableHeader, TomlBoolean, TomlDateTimeLiteral, TomlFloat, TomlInlineEntry, TomlInlineTable, TomlInteger, TomlKey, TomlKeyValue, TomlString, TomlTableHeader, TomlTrivia } from "../TomlNode.js";
5
5
  import { assertValidUnicode, classifyValueToken, scanBareKey, scanBasicString, scanComment, scanLiteralString, scanMultilineBasicString, scanMultilineLiteralString, scanNewline, scanValueToken, scanWhitespace, skipBom } from "./scanner.js";
6
6
 
7
- //#region src/internal/parser.ts
7
+ // src/internal/parser.ts
8
8
  const LF = 10;
9
9
  const CR = 13;
10
10
  const QUOTE = 34;
@@ -400,5 +400,4 @@ const parseExpressions = (source) => {
400
400
  return expressions;
401
401
  };
402
402
 
403
- //#endregion
404
403
  export { parseExpressions };
@@ -1,7 +1,7 @@
1
1
  import { RawTomlError } from "./diagnostics.js";
2
2
  import { TomlLocalDate, TomlLocalDateTime, TomlLocalTime, TomlOffsetDateTime } from "../TomlDateTime.js";
3
3
 
4
- //#region src/internal/scanner.ts
4
+ // src/internal/scanner.ts
5
5
  const NUL = 0;
6
6
  const TAB = 9;
7
7
  const LF = 10;
@@ -503,5 +503,4 @@ const classifyValueToken = (token, offset) => {
503
503
  return raise("InvalidValue", `${token} is not a valid TOML value`, offset, length);
504
504
  };
505
505
 
506
- //#endregion
507
506
  export { assertValidUnicode, classifyValueToken, isBareKeyChar, scanBareKey, scanBasicString, scanComment, scanLiteralString, scanMultilineBasicString, scanMultilineLiteralString, scanNewline, scanValueToken, scanWhitespace, skipBom };
@@ -1,7 +1,7 @@
1
1
  import { RawTomlError } from "./diagnostics.js";
2
2
  import { TomlArray, TomlArrayTableHeader, TomlInlineTable, TomlTableHeader, TomlTrivia } from "../TomlNode.js";
3
3
 
4
- //#region src/internal/semantic.ts
4
+ // src/internal/semantic.ts
5
5
  const makeNode = (kind, sectionId = 0) => ({
6
6
  kind,
7
7
  table: /* @__PURE__ */ new Map(),
@@ -249,5 +249,4 @@ const buildValue = (expressions) => {
249
249
  return result;
250
250
  };
251
251
 
252
- //#endregion
253
252
  export { analyze, buildValue };
@@ -2,7 +2,7 @@ import { RawTomlError } from "./diagnostics.js";
2
2
  import { GuardExceeded } from "./limits.js";
3
3
  import { TomlLocalDate, TomlLocalDateTime, TomlLocalTime, TomlOffsetDateTime } from "../TomlDateTime.js";
4
4
 
5
- //#region src/internal/stringifyValue.ts
5
+ // src/internal/stringifyValue.ts
6
6
  const INT64_MIN = -(2n ** 63n);
7
7
  const INT64_MAX = 2n ** 63n - 1n;
8
8
  const INT64_FLOAT_BOUND = 2 ** 63;
@@ -187,5 +187,4 @@ const stringifyValue = (value, newline) => {
187
187
  return lines.length === 0 ? "" : `${lines.join(newline)}${newline}`;
188
188
  };
189
189
 
190
- //#endregion
191
190
  export { renderInlineValue, renderKey, stringifyValue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effected/toml",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "private": false,
5
5
  "description": "TOML 1.1.0 parsing, editing and formatting as Effect schemas: typed diagnostics, a lossless CST and first-class date-time values.",
6
6
  "keywords": [