@helpers4/markdown 2.1.0 → 3.0.0-alpha.2

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 CHANGED
@@ -20,9 +20,11 @@ A set of helpers for working with URLs.
20
20
  <!-- AUTOMATIC-SIBLINGS -->
21
21
  - [array](../array)
22
22
  - [ci](../ci)
23
+ - [color](../color)
23
24
  - [commit](../commit)
24
25
  - [date](../date)
25
26
  - [function](../function)
27
+ - [guard](../guard)
26
28
  - [id](../id)
27
29
  - [node](../node)
28
30
  - [number](../number)
@@ -42,9 +44,11 @@ A set of helpers for working with URLs.
42
44
  |------|---------|-------------|-------------|
43
45
  | array | [@helpers4/array](https://www.npmjs.com/package/@helpers4/array) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/array) | Array manipulation utilities |
44
46
  | ci | [@helpers4/ci](https://www.npmjs.com/package/@helpers4/ci) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/ci) | CI/CD workflow status utilities |
47
+ | color | [@helpers4/color](https://www.npmjs.com/package/@helpers4/color) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/color) | Color conversion and validation utilities |
45
48
  | commit | [@helpers4/commit](https://www.npmjs.com/package/@helpers4/commit) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/commit) | Conventional Commits parsing and analysis |
46
49
  | date | [@helpers4/date](https://www.npmjs.com/package/@helpers4/date) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/date) | Date and time utility functions |
47
50
  | function | [@helpers4/function](https://www.npmjs.com/package/@helpers4/function) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/function) | Function utilities and type guards |
51
+ | guard | [@helpers4/guard](https://www.npmjs.com/package/@helpers4/guard) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/guard) | Runtime type guard utilities |
48
52
  | id | [@helpers4/id](https://www.npmjs.com/package/@helpers4/id) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/id) | Unique identifier generation utilities |
49
53
  | markdown | [@helpers4/markdown](https://www.npmjs.com/package/@helpers4/markdown) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/markdown) | Markdown formatting and escaping utilities |
50
54
  | node | [@helpers4/node](https://www.npmjs.com/package/@helpers4/node) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/node) | Node.js-specific utilities |
@@ -53,7 +57,7 @@ A set of helpers for working with URLs.
53
57
  | observable | [@helpers4/observable](https://www.npmjs.com/package/@helpers4/observable) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/observable) | Observable utilities and combinators |
54
58
  | promise | [@helpers4/promise](https://www.npmjs.com/package/@helpers4/promise) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/promise) | Promise utilities and error handling |
55
59
  | string | [@helpers4/string](https://www.npmjs.com/package/@helpers4/string) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/string) | String manipulation and formatting utilities |
56
- | type | [@helpers4/type](https://www.npmjs.com/package/@helpers4/type) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/type) | Type checking and validation utilities |
60
+ | type | [@helpers4/type](https://www.npmjs.com/package/@helpers4/type) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/type) | Compile-time TypeScript utility types |
57
61
  | url | [@helpers4/url](https://www.npmjs.com/package/@helpers4/url) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/url) | URL parsing and manipulation utilities |
58
62
  | version | [@helpers4/version](https://www.npmjs.com/package/@helpers4/version) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/version) | Version string manipulation utilities |
59
63
  <!-- /AUTOMATIC-CATEGORIES-TABLE -->
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../helpers/markdown/escape.ts"],"sourcesContent":["/**\n * This file is part of helpers4.\n * Copyright (C) 2025 baxyz\n * SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\n/**\n * Options for {@link escape}.\n */\nexport interface EscapeOptions {\n /**\n * When `true`, additionally escapes pipe characters (`|`) and replaces\n * newlines with spaces, making the result safe for use as a Markdown table\n * cell value.\n *\n * @default false\n */\n cell?: boolean;\n}\n\n/**\n * Escapes all Markdown special characters in a string so they render as\n * literal text rather than formatting syntax.\n *\n * Escaped characters: `\\ \\` * _ { } [ ] ( ) # + - . !`\n *\n * Pass `{ cell: true }` to also escape pipe characters and replace newlines\n * with spaces, making the result safe for embedding in a Markdown table cell.\n *\n * @param str - The raw string to escape\n * @param options - Optional escaping options\n * @returns The escaped string\n * @example\n * escape('**bold** and _italic_')\n * // => '\\\\*\\\\*bold\\\\*\\\\* and \\\\_italic\\\\_'\n *\n * escape('[link](url)')\n * // => '\\\\[link\\\\]\\\\(url\\\\)'\n *\n * escape('foo | bar', { cell: true })\n * // => 'foo \\\\| bar'\n * @since 2.0.0\n */\nexport function escape(str: string, options?: EscapeOptions): string {\n let result = str.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&');\n if (options?.cell) {\n result = result.replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ');\n }\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,OAAO,KAAa,SAAiC;CACnE,IAAI,SAAS,IAAI,QAAQ,yBAAyB,MAAM;CACxD,IAAI,SAAS,MACX,SAAS,OAAO,QAAQ,OAAO,KAAK,EAAE,QAAQ,OAAO,GAAG;CAE1D,OAAO;AACT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../helpers/markdown/escape.ts"],"sourcesContent":["/**\n * This file is part of helpers4.\n * Copyright (C) 2025 baxyz\n * SPDX-License-Identifier: LGPL-3.0-or-later\n */\n\n/**\n * Options for {@link escape}.\n */\nexport interface EscapeOptions {\n /**\n * When `true`, additionally escapes pipe characters (`|`) and replaces\n * newlines with spaces, making the result safe for use as a Markdown table\n * cell value.\n *\n * @default false\n */\n cell?: boolean;\n}\n\n/**\n * Escapes all Markdown special characters in a string so they render as\n * literal text rather than formatting syntax.\n *\n * Escaped characters: `\\ \\` * _ { } [ ] ( ) # + - . !`\n *\n * Pass `{ cell: true }` to also escape pipe characters and replace newlines\n * with spaces, making the result safe for embedding in a Markdown table cell.\n *\n * @param str - The raw string to escape\n * @param options - Optional escaping options\n * @returns The escaped string\n * @example\n * escape('**bold** and _italic_')\n * // => '\\\\*\\\\*bold\\\\*\\\\* and \\\\_italic\\\\_'\n *\n * escape('[link](url)')\n * // => '\\\\[link\\\\]\\\\(url\\\\)'\n *\n * escape('foo | bar', { cell: true })\n * // => 'foo \\\\| bar'\n * @since 2.0.0\n */\nexport function escape(str: string, options?: EscapeOptions): string {\n let result = str.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&');\n if (options?.cell) {\n result = result.replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ');\n }\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,OAAO,KAAa,SAAiC;CACnE,IAAI,SAAS,IAAI,QAAQ,yBAAyB,MAAM;CACxD,IAAI,SAAS,MACX,SAAS,OAAO,QAAQ,OAAO,KAAK,CAAC,CAAC,QAAQ,OAAO,GAAG;CAE1D,OAAO;AACT"}
package/llms.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  # @helpers4/markdown
2
2
 
3
3
  > Tree-shakable TypeScript utility functions for the `markdown` domain.
4
- > Package: `@helpers4/markdown` — Version: 2.1.0
4
+ > Package: `@helpers4/markdown` — Version: 3.0.0-alpha.2
5
5
  > License: LGPL-3.0-or-later
6
6
 
7
7
  ## Installation
package/meta/api.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "category": "markdown",
3
- "version": "2.1.0",
3
+ "version": "3.0.0-alpha.2",
4
4
  "functions": [
5
5
  {
6
6
  "name": "escape",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpers4/markdown",
3
- "version": "2.1.0",
3
+ "version": "3.0.0-alpha.2",
4
4
  "description": "A set of helpers in TS/JS, compatible with tree-shaking, for markdown.",
5
5
  "author": "baxyz <baxy@etik.com>",
6
6
  "license": "LGPL-3.0",
@@ -40,6 +40,6 @@
40
40
  "README.md"
41
41
  ],
42
42
  "engines": {
43
- "node": ">=18.0.0"
43
+ "node": ">=26.0.0"
44
44
  }
45
45
  }