@forsakringskassan/docs-generator 2.13.0 → 2.14.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.
|
@@ -171,9 +171,19 @@ function stripEslintComments(code) {
|
|
|
171
171
|
const matchEmbedded = /[ \t]*(\/\* eslint-disable[^*]*\*\/|\/\/ eslint-disable.*)/g;
|
|
172
172
|
return code.replace(matchLine, "").replace(matchEmbedded, "");
|
|
173
173
|
}
|
|
174
|
+
function maybeDedent(value) {
|
|
175
|
+
if (/^\s*$/.test(value)) {
|
|
176
|
+
return value;
|
|
177
|
+
}
|
|
178
|
+
if (/^\s/.test(value)) {
|
|
179
|
+
return vendor.dedent(value);
|
|
180
|
+
} else {
|
|
181
|
+
return value;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
174
184
|
const transformations = {
|
|
175
|
-
javascript: [cutSnippets, stripEslintComments],
|
|
176
|
-
typescript: [cutSnippets, stripEslintComments]
|
|
185
|
+
javascript: [cutSnippets, stripEslintComments, maybeDedent],
|
|
186
|
+
typescript: [cutSnippets, stripEslintComments, maybeDedent]
|
|
177
187
|
};
|
|
178
188
|
function transformCode(code, lang) {
|
|
179
189
|
const fns = transformations[lang] ?? [];
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var vendor = require('./vendor-Bb38Rlio.js');
|
|
|
6
6
|
var path$1 = require('node:path');
|
|
7
7
|
var require$$1 = require('crypto');
|
|
8
8
|
require('node:crypto');
|
|
9
|
-
var createMarkdownRenderer = require('./create-markdown-renderer-
|
|
9
|
+
var createMarkdownRenderer = require('./create-markdown-renderer-DVss8WXD.js');
|
|
10
10
|
var node_child_process = require('node:child_process');
|
|
11
11
|
var util = require('node:util');
|
|
12
12
|
var vueDocgenApi = require('vue-docgen-api');
|
package/dist/markdown.js
CHANGED