sysprom 1.2.1 → 1.2.3

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/src/text.js CHANGED
@@ -2,6 +2,11 @@
2
2
  * Normalise a text field (string | string[]) to a single string, joining with newlines.
3
3
  * @param value - The text field to normalise.
4
4
  * @returns A single string.
5
+ * @example
6
+ * ```ts
7
+ * textToString(["line 1", "line 2"]) // => "line 1\nline 2"
8
+ * textToString("hello") // => "hello"
9
+ * ```
5
10
  */
6
11
  export function textToString(value) {
7
12
  return Array.isArray(value) ? value.join("\n") : value;
@@ -10,6 +15,11 @@ export function textToString(value) {
10
15
  * Normalise a text field to an array of lines.
11
16
  * @param value - The text field to normalise.
12
17
  * @returns An array of lines.
18
+ * @example
19
+ * ```ts
20
+ * textToLines("hello") // => ["hello"]
21
+ * textToLines(["a", "b"]) // => ["a", "b"]
22
+ * ```
13
23
  */
14
24
  export function textToLines(value) {
15
25
  return Array.isArray(value) ? value : [value];
@@ -18,6 +28,10 @@ export function textToLines(value) {
18
28
  * Format a text field for Markdown output — each line becomes a paragraph.
19
29
  * @param value - The text field to format.
20
30
  * @returns Markdown-formatted string.
31
+ * @example
32
+ * ```ts
33
+ * textToMarkdown(["para 1", "para 2"]) // => "para 1\npara 2"
34
+ * ```
21
35
  */
22
36
  export function textToMarkdown(value) {
23
37
  return textToLines(value).join("\n");
@@ -27,6 +41,11 @@ export function textToMarkdown(value) {
27
41
  * Single-line content stays as a string; multiline becomes an array.
28
42
  * @param block - The Markdown text block to parse.
29
43
  * @returns A string for single-line content, or an array of lines for multiline.
44
+ * @example
45
+ * ```ts
46
+ * markdownToText("single line") // => "single line"
47
+ * markdownToText("line 1\nline 2") // => ["line 1", "line 2"]
48
+ * ```
30
49
  */
31
50
  export function markdownToText(block) {
32
51
  const lines = block.split("\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sysprom",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "SysProM — System Provenance Model CLI and library",
5
5
  "author": "ExaDev",
6
6
  "homepage": "https://exadev.github.io/SysProM",