@cbortech/cbor 0.26.4 → 0.26.5

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/dist/types.d.ts CHANGED
@@ -451,6 +451,11 @@ export interface ToCDNOptions {
451
451
  * - `number`: number of spaces
452
452
  * - `string`: literal indent string (e.g. `'\t'`)
453
453
  * - omit for single-line output
454
+ *
455
+ * Like `JSON.stringify`, `0` and `''` are equivalent to omitting the
456
+ * option: the output is a single line. Single-line output is guaranteed
457
+ * to contain no newlines; layout-dependent options (`preserveComments`,
458
+ * `splitCdn`, `splitNewline`, `preserveConcatenation`) are ignored.
454
459
  */
455
460
  indent?: number | string;
456
461
  /**
@@ -465,8 +470,9 @@ export interface ToCDNOptions {
465
470
  * kept as-is.
466
471
  * - `false` / omitted: strip all comments from the output.
467
472
  *
468
- * When enabled for containers, comment-bearing arrays/maps are emitted in
469
- * multi-line form even if `indent` is omitted.
473
+ * Only effective when `indent` enables pretty-printing: single-line
474
+ * output strips all comments, since line comments (`#`, `//`) can only
475
+ * be terminated by a newline.
470
476
  *
471
477
  * @default false
472
478
  */
@@ -485,6 +491,10 @@ export interface ToCDNOptions {
485
491
  * When enabled, this takes precedence over `bstrEncoding` and `sqstr` for
486
492
  * byte strings that carry original EDN source text.
487
493
  *
494
+ * In single-line output (no `indent`), an original spelling that spans
495
+ * multiple lines (e.g. a byte string literal with interior line comments)
496
+ * falls back to normal serialization; single-line spellings are kept.
497
+ *
488
498
  * @default false
489
499
  */
490
500
  preserveByteString?: boolean;
@@ -501,6 +511,9 @@ export interface ToCDNOptions {
501
511
  * Raw byte string forms (e.g. `` h`...` ``) are covered by
502
512
  * `preserveByteString`, not this option.
503
513
  *
514
+ * In single-line output (no `indent`), a spelling that spans multiple
515
+ * lines falls back to normal escaping; single-line spellings are kept.
516
+ *
504
517
  * @default false
505
518
  */
506
519
  preserveRawString?: boolean;
@@ -556,7 +569,7 @@ export interface ToCDNOptions {
556
569
  floatFormat?: 'decimal' | 'hex';
557
570
  /**
558
571
  * Split long text strings using CDN string concatenation syntax (`"a" + "b"`).
559
- * Only effective when `indent` is specified.
572
+ * Only effective when `indent` enables pretty-printing.
560
573
  *
561
574
  * - `'newline'`: split at newline characters
562
575
  * - `'cdn'`: split according to CDN structure when the string content
@@ -612,7 +625,8 @@ export interface ToCDNOptions {
612
625
  * text strings whose content parses as CDN, while `splitNewline` combines
613
626
  * with this option by further splitting the preserved parts at newline
614
627
  * characters. Has no effect on values that did not originate from a CDN
615
- * concatenation.
628
+ * concatenation, and only takes effect when `indent` enables
629
+ * pretty-printing (single-line output joins the parts into one literal).
616
630
  *
617
631
  * @default false
618
632
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cbortech/cbor",
3
- "version": "0.26.4",
3
+ "version": "0.26.5",
4
4
  "description": "Convert between CBOR, CDN (CBOR-EDN), and JavaScript values",
5
5
  "keywords": [
6
6
  "cbor",