@readme/markdown 15.0.1 → 15.0.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.
@@ -4,7 +4,20 @@ interface Default {
4
4
  }
5
5
  export interface Variables {
6
6
  defaults: Default[];
7
- user: Record<string, string>;
7
+ user: Record<string, unknown>;
8
8
  }
9
- declare const User: (variables?: Variables) => Record<string, string>;
9
+ /**
10
+ * Coerce a user variable value to a string for substitution into markdown text.
11
+ * Non-string values (arrays, objects, numbers) are stringified via JSON or `String()`
12
+ * so that `<<var>>` syntax doesn't produce `[object Object]` for structured data like
13
+ * JWT `keys`.
14
+ */
15
+ export declare const stringifyVariableValue: (value: unknown) => string;
16
+ /**
17
+ * Flatten `variables.user` into a string-keyed string-valued record by coercing
18
+ * each value. Used by markdown substitution paths that need a plain
19
+ * `Record<string, string>` lookup.
20
+ */
21
+ export declare const flattenUserVariables: (user: Record<string, unknown>) => Record<string, string>;
22
+ declare const User: (variables?: Variables) => Record<string, unknown>;
10
23
  export default User;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@readme/markdown",
3
3
  "description": "ReadMe's React-based Markdown parser",
4
4
  "author": "Rafe Goldberg <rafe@readme.io>",
5
- "version": "15.0.1",
5
+ "version": "15.0.2",
6
6
  "main": "dist/main.node.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "browser": "dist/main.js",
@@ -198,7 +198,7 @@
198
198
  },
199
199
  {
200
200
  "path": "dist/main.node.js",
201
- "maxSize": "975KB"
201
+ "maxSize": "980KB"
202
202
  },
203
203
  {
204
204
  "path": "dist/render-diff.node.js",
package/types.d.ts CHANGED
@@ -297,7 +297,7 @@ interface TocList extends Element {
297
297
 
298
298
  interface Variables {
299
299
  defaults: { default: string; name: string }[];
300
- user: Record<string, string>;
300
+ user: Record<string, unknown>;
301
301
  }
302
302
 
303
303
  interface TocListItem extends Element {