@forsakringskassan/docs-generator 2.35.3 → 2.35.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/markdown.mjs CHANGED
@@ -2,8 +2,8 @@ import { createRequire as $createRequire } from "node:module";
2
2
 
3
3
  const require = $createRequire(import.meta.url);
4
4
 
5
- export { S as SoftError, c as createMarkdownRenderer } from './create-markdown-renderer-gWhxglZr.mjs';
6
- import './vendor-BtGCZQy4.mjs';
5
+ export { S as SoftError, c as createMarkdownRenderer } from './create-markdown-renderer-Bx9oXbtZ.mjs';
6
+ import './vendor-Q6b0E6UP.mjs';
7
7
  import 'node:url';
8
8
  import 'node:path';
9
9
  import 'fs';
@@ -16363,6 +16363,18 @@ function createDedent(options) {
16363
16363
  if (escapeSpecialCharacters) {
16364
16364
  result = result.replace(/\\n/g, "\n");
16365
16365
  }
16366
+
16367
+ // Workaround for Bun issue with Unicode characters
16368
+ // https://github.com/oven-sh/bun/issues/8745
16369
+ if (typeof Bun !== "undefined") {
16370
+ result = result.replace(
16371
+ // Matches e.g. \\u{1f60a} or \\u5F1F
16372
+ /\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g, (_, braced, unbraced) => {
16373
+ var _ref;
16374
+ const hex = (_ref = braced !== null && braced !== void 0 ? braced : unbraced) !== null && _ref !== void 0 ? _ref : "";
16375
+ return String.fromCodePoint(parseInt(hex, 16));
16376
+ });
16377
+ }
16366
16378
  return result;
16367
16379
  }
16368
16380
  }
@@ -22955,15 +22967,20 @@ function requireCopy$1 () {
22955
22967
  if (opts.dereference) {
22956
22968
  resolvedDest = path.resolve(process.cwd(), resolvedDest);
22957
22969
  }
22958
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
22959
- throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
22960
- }
22970
+ // If both symlinks resolve to the same target, they are still distinct symlinks
22971
+ // that can be copied/overwritten. Only check subdirectory constraints when
22972
+ // the resolved paths are different.
22973
+ if (resolvedSrc !== resolvedDest) {
22974
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
22975
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
22976
+ }
22961
22977
 
22962
- // do not copy if src is a subdir of dest since unlinking
22963
- // dest in this case would result in removing src contents
22964
- // and therefore a broken symlink would be created.
22965
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
22966
- throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
22978
+ // do not copy if src is a subdir of dest since unlinking
22979
+ // dest in this case would result in removing src contents
22980
+ // and therefore a broken symlink would be created.
22981
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
22982
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
22983
+ }
22967
22984
  }
22968
22985
 
22969
22986
  // copy the link
@@ -23131,15 +23148,20 @@ function requireCopySync () {
23131
23148
  if (opts.dereference) {
23132
23149
  resolvedDest = path.resolve(process.cwd(), resolvedDest);
23133
23150
  }
23134
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
23135
- throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
23136
- }
23151
+ // If both symlinks resolve to the same target, they are still distinct symlinks
23152
+ // that can be copied/overwritten. Only check subdirectory constraints when
23153
+ // the resolved paths are different.
23154
+ if (resolvedSrc !== resolvedDest) {
23155
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
23156
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
23157
+ }
23137
23158
 
23138
- // prevent copy if src is a subdir of dest since unlinking
23139
- // dest in this case would result in removing src contents
23140
- // and therefore a broken symlink would be created.
23141
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
23142
- throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
23159
+ // prevent copy if src is a subdir of dest since unlinking
23160
+ // dest in this case would result in removing src contents
23161
+ // and therefore a broken symlink would be created.
23162
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
23163
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
23164
+ }
23143
23165
  }
23144
23166
  return copyLink(resolvedSrc, dest)
23145
23167
  }
@@ -25069,9 +25091,6 @@ class PluralResolver {
25069
25091
  this.logger = baseLogger.create('pluralResolver');
25070
25092
  this.pluralRulesCache = {};
25071
25093
  }
25072
- addRule(lng, obj) {
25073
- this.rules[lng] = obj;
25074
- }
25075
25094
  clearCache() {
25076
25095
  this.pluralRulesCache = {};
25077
25096
  }
@@ -26227,7 +26246,19 @@ class I18n extends EventEmitter {
26227
26246
  clone.store = new ResourceStore(clonedData, mergedOptions);
26228
26247
  clone.services.resourceStore = clone.store;
26229
26248
  }
26230
- if (options.interpolation) clone.services.interpolator = new Interpolator(mergedOptions);
26249
+ if (options.interpolation) {
26250
+ const defOpts = get$1();
26251
+ const mergedInterpolation = {
26252
+ ...defOpts.interpolation,
26253
+ ...this.options.interpolation,
26254
+ ...options.interpolation
26255
+ };
26256
+ const mergedForInterpolator = {
26257
+ ...mergedOptions,
26258
+ interpolation: mergedInterpolation
26259
+ };
26260
+ clone.services.interpolator = new Interpolator(mergedForInterpolator);
26261
+ }
26231
26262
  clone.translator = new Translator(clone.services, mergedOptions);
26232
26263
  clone.translator.on('*', (event, ...args) => {
26233
26264
  clone.emit(event, ...args);
@@ -28979,6 +29010,11 @@ function canonicalize(obj, stack, replacementStack, replacer, key) {
28979
29010
  return canonicalizedObj;
28980
29011
  }
28981
29012
 
29013
+ const INCLUDE_HEADERS = {
29014
+ includeIndex: true,
29015
+ includeUnderline: true,
29016
+ includeFileHeaders: true
29017
+ };
28982
29018
  function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
28983
29019
  let optionsObj;
28984
29020
  if (!options) {
@@ -29108,17 +29144,29 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
29108
29144
  * creates a unified diff patch.
29109
29145
  * @param patch either a single structured patch object (as returned by `structuredPatch`) or an array of them (as returned by `parsePatch`)
29110
29146
  */
29111
- function formatPatch(patch) {
29147
+ function formatPatch(patch, headerOptions) {
29148
+ if (!headerOptions) {
29149
+ headerOptions = INCLUDE_HEADERS;
29150
+ }
29112
29151
  if (Array.isArray(patch)) {
29113
- return patch.map(formatPatch).join('\n');
29152
+ if (patch.length > 1 && !headerOptions.includeFileHeaders) {
29153
+ throw new Error('Cannot omit file headers on a multi-file patch. '
29154
+ + '(The result would be unparseable; how would a tool trying to apply '
29155
+ + 'the patch know which changes are to which file?)');
29156
+ }
29157
+ return patch.map(p => formatPatch(p, headerOptions)).join('\n');
29114
29158
  }
29115
29159
  const ret = [];
29116
- if (patch.oldFileName == patch.newFileName) {
29160
+ if (headerOptions.includeIndex && patch.oldFileName == patch.newFileName) {
29117
29161
  ret.push('Index: ' + patch.oldFileName);
29118
29162
  }
29119
- ret.push('===================================================================');
29120
- ret.push('--- ' + patch.oldFileName + (typeof patch.oldHeader === 'undefined' ? '' : '\t' + patch.oldHeader));
29121
- ret.push('+++ ' + patch.newFileName + (typeof patch.newHeader === 'undefined' ? '' : '\t' + patch.newHeader));
29163
+ if (headerOptions.includeUnderline) {
29164
+ ret.push('===================================================================');
29165
+ }
29166
+ if (headerOptions.includeFileHeaders) {
29167
+ ret.push('--- ' + patch.oldFileName + (typeof patch.oldHeader === 'undefined' ? '' : '\t' + patch.oldHeader));
29168
+ ret.push('+++ ' + patch.newFileName + (typeof patch.newHeader === 'undefined' ? '' : '\t' + patch.newHeader));
29169
+ }
29122
29170
  for (let i = 0; i < patch.hunks.length; i++) {
29123
29171
  const hunk = patch.hunks[i];
29124
29172
  // Unified Diff Format quirk: If the chunk size is 0,
@@ -29148,7 +29196,7 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader
29148
29196
  if (!patchObj) {
29149
29197
  return;
29150
29198
  }
29151
- return formatPatch(patchObj);
29199
+ return formatPatch(patchObj, options === null || options === void 0 ? void 0 : options.headerOptions);
29152
29200
  }
29153
29201
  else {
29154
29202
  const { callback } = options;
@@ -29157,7 +29205,7 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader
29157
29205
  callback(undefined);
29158
29206
  }
29159
29207
  else {
29160
- callback(formatPatch(patchObj));
29208
+ callback(formatPatch(patchObj, options.headerOptions));
29161
29209
  }
29162
29210
  } }));
29163
29211
  }
@@ -54871,10 +54919,32 @@ function requireUtils () {
54871
54919
  hasRequiredUtils = 1;
54872
54920
 
54873
54921
  var formats = requireFormats();
54922
+ var getSideChannel = requireSideChannel();
54874
54923
 
54875
54924
  var has = Object.prototype.hasOwnProperty;
54876
54925
  var isArray = Array.isArray;
54877
54926
 
54927
+ // Track objects created from arrayLimit overflow using side-channel
54928
+ // Stores the current max numeric index for O(1) lookup
54929
+ var overflowChannel = getSideChannel();
54930
+
54931
+ var markOverflow = function markOverflow(obj, maxIndex) {
54932
+ overflowChannel.set(obj, maxIndex);
54933
+ return obj;
54934
+ };
54935
+
54936
+ var isOverflow = function isOverflow(obj) {
54937
+ return overflowChannel.has(obj);
54938
+ };
54939
+
54940
+ var getMaxIndex = function getMaxIndex(obj) {
54941
+ return overflowChannel.get(obj);
54942
+ };
54943
+
54944
+ var setMaxIndex = function setMaxIndex(obj, maxIndex) {
54945
+ overflowChannel.set(obj, maxIndex);
54946
+ };
54947
+
54878
54948
  var hexTable = (function () {
54879
54949
  var array = [];
54880
54950
  for (var i = 0; i < 256; ++i) {
@@ -54924,7 +54994,12 @@ function requireUtils () {
54924
54994
  if (isArray(target)) {
54925
54995
  target.push(source);
54926
54996
  } else if (target && typeof target === 'object') {
54927
- if (
54997
+ if (isOverflow(target)) {
54998
+ // Add at next numeric index for overflow objects
54999
+ var newIndex = getMaxIndex(target) + 1;
55000
+ target[newIndex] = source;
55001
+ setMaxIndex(target, newIndex);
55002
+ } else if (
54928
55003
  (options && (options.plainObjects || options.allowPrototypes))
54929
55004
  || !has.call(Object.prototype, source)
54930
55005
  ) {
@@ -54938,6 +55013,18 @@ function requireUtils () {
54938
55013
  }
54939
55014
 
54940
55015
  if (!target || typeof target !== 'object') {
55016
+ if (isOverflow(source)) {
55017
+ // Create new object with target at 0, source values shifted by 1
55018
+ var sourceKeys = Object.keys(source);
55019
+ var result = options && options.plainObjects
55020
+ ? { __proto__: null, 0: target }
55021
+ : { 0: target };
55022
+ for (var m = 0; m < sourceKeys.length; m++) {
55023
+ var oldKey = parseInt(sourceKeys[m], 10);
55024
+ result[oldKey + 1] = source[sourceKeys[m]];
55025
+ }
55026
+ return markOverflow(result, getMaxIndex(source) + 1);
55027
+ }
54941
55028
  return [target].concat(source);
54942
55029
  }
54943
55030
 
@@ -55109,8 +55196,20 @@ function requireUtils () {
55109
55196
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
55110
55197
  };
55111
55198
 
55112
- var combine = function combine(a, b) {
55113
- return [].concat(a, b);
55199
+ var combine = function combine(a, b, arrayLimit, plainObjects) {
55200
+ // If 'a' is already an overflow object, add to it
55201
+ if (isOverflow(a)) {
55202
+ var newIndex = getMaxIndex(a) + 1;
55203
+ a[newIndex] = b;
55204
+ setMaxIndex(a, newIndex);
55205
+ return a;
55206
+ }
55207
+
55208
+ var result = [].concat(a, b);
55209
+ if (result.length > arrayLimit) {
55210
+ return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1);
55211
+ }
55212
+ return result;
55114
55213
  };
55115
55214
 
55116
55215
  var maybeMap = function maybeMap(val, fn) {
@@ -55132,6 +55231,7 @@ function requireUtils () {
55132
55231
  decode: decode,
55133
55232
  encode: encode,
55134
55233
  isBuffer: isBuffer,
55234
+ isOverflow: isOverflow,
55135
55235
  isRegExp: isRegExp,
55136
55236
  maybeMap: maybeMap,
55137
55237
  merge: merge
@@ -55618,16 +55718,18 @@ function requireParse () {
55618
55718
  } else {
55619
55719
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
55620
55720
 
55621
- val = utils.maybeMap(
55622
- parseArrayValue(
55623
- part.slice(pos + 1),
55624
- options,
55625
- isArray(obj[key]) ? obj[key].length : 0
55626
- ),
55627
- function (encodedVal) {
55628
- return options.decoder(encodedVal, defaults.decoder, charset, 'value');
55629
- }
55630
- );
55721
+ if (key !== null) {
55722
+ val = utils.maybeMap(
55723
+ parseArrayValue(
55724
+ part.slice(pos + 1),
55725
+ options,
55726
+ isArray(obj[key]) ? obj[key].length : 0
55727
+ ),
55728
+ function (encodedVal) {
55729
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
55730
+ }
55731
+ );
55732
+ }
55631
55733
  }
55632
55734
 
55633
55735
  if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
@@ -55638,11 +55740,18 @@ function requireParse () {
55638
55740
  val = isArray(val) ? [val] : val;
55639
55741
  }
55640
55742
 
55641
- var existing = has.call(obj, key);
55642
- if (existing && options.duplicates === 'combine') {
55643
- obj[key] = utils.combine(obj[key], val);
55644
- } else if (!existing || options.duplicates === 'last') {
55645
- obj[key] = val;
55743
+ if (key !== null) {
55744
+ var existing = has.call(obj, key);
55745
+ if (existing && options.duplicates === 'combine') {
55746
+ obj[key] = utils.combine(
55747
+ obj[key],
55748
+ val,
55749
+ options.arrayLimit,
55750
+ options.plainObjects
55751
+ );
55752
+ } else if (!existing || options.duplicates === 'last') {
55753
+ obj[key] = val;
55754
+ }
55646
55755
  }
55647
55756
  }
55648
55757
 
@@ -55663,9 +55772,19 @@ function requireParse () {
55663
55772
  var root = chain[i];
55664
55773
 
55665
55774
  if (root === '[]' && options.parseArrays) {
55666
- obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
55667
- ? []
55668
- : utils.combine([], leaf);
55775
+ if (utils.isOverflow(leaf)) {
55776
+ // leaf is already an overflow object, preserve it
55777
+ obj = leaf;
55778
+ } else {
55779
+ obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
55780
+ ? []
55781
+ : utils.combine(
55782
+ [],
55783
+ leaf,
55784
+ options.arrayLimit,
55785
+ options.plainObjects
55786
+ );
55787
+ }
55669
55788
  } else {
55670
55789
  obj = options.plainObjects ? { __proto__: null } : {};
55671
55790
  var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
@@ -55693,29 +55812,28 @@ function requireParse () {
55693
55812
  return leaf;
55694
55813
  };
55695
55814
 
55696
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
55697
- if (!givenKey) {
55698
- return;
55699
- }
55700
-
55701
- // Transform dot notation to bracket notation
55815
+ var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
55702
55816
  var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
55703
55817
 
55704
- // The regex chunks
55818
+ if (options.depth <= 0) {
55819
+ if (!options.plainObjects && has.call(Object.prototype, key)) {
55820
+ if (!options.allowPrototypes) {
55821
+ return;
55822
+ }
55823
+ }
55824
+
55825
+ return [key];
55826
+ }
55705
55827
 
55706
55828
  var brackets = /(\[[^[\]]*])/;
55707
55829
  var child = /(\[[^[\]]*])/g;
55708
55830
 
55709
- // Get the parent
55710
-
55711
- var segment = options.depth > 0 && brackets.exec(key);
55831
+ var segment = brackets.exec(key);
55712
55832
  var parent = segment ? key.slice(0, segment.index) : key;
55713
55833
 
55714
- // Stash the parent if it exists
55715
-
55716
55834
  var keys = [];
55835
+
55717
55836
  if (parent) {
55718
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
55719
55837
  if (!options.plainObjects && has.call(Object.prototype, parent)) {
55720
55838
  if (!options.allowPrototypes) {
55721
55839
  return;
@@ -55725,28 +55843,42 @@ function requireParse () {
55725
55843
  keys.push(parent);
55726
55844
  }
55727
55845
 
55728
- // Loop through children appending to the array until we hit depth
55729
-
55730
55846
  var i = 0;
55731
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
55847
+ while ((segment = child.exec(key)) !== null && i < options.depth) {
55732
55848
  i += 1;
55733
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
55849
+
55850
+ var segmentContent = segment[1].slice(1, -1);
55851
+ if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
55734
55852
  if (!options.allowPrototypes) {
55735
55853
  return;
55736
55854
  }
55737
55855
  }
55856
+
55738
55857
  keys.push(segment[1]);
55739
55858
  }
55740
55859
 
55741
- // If there's a remainder, check strictDepth option for throw, else just add whatever is left
55742
-
55743
55860
  if (segment) {
55744
55861
  if (options.strictDepth === true) {
55745
55862
  throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
55746
55863
  }
55864
+
55747
55865
  keys.push('[' + key.slice(segment.index) + ']');
55748
55866
  }
55749
55867
 
55868
+ return keys;
55869
+ };
55870
+
55871
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
55872
+ if (!givenKey) {
55873
+ return;
55874
+ }
55875
+
55876
+ var keys = splitKeyIntoSegments(givenKey, options);
55877
+
55878
+ if (!keys) {
55879
+ return;
55880
+ }
55881
+
55750
55882
  return parseObject(keys, val, options, valuesParsed);
55751
55883
  };
55752
55884
 
@@ -56337,4 +56469,4 @@ var srcExports = requireSrc();
56337
56469
  var tinylr = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
56338
56470
 
56339
56471
  export { HighlightJS as H, MarkdownIt as M, deflist_plugin as a, closest as b, createTwoFilesPatch as c, dedent as d, distance as e, fm as f, globSync as g, glob as h, isCI as i, moduleImporter as j, cliProgress as k, createInstance as l, minimatch as m, fse as n, inter as o, tinylr as t, watch$1 as w };
56340
- //# sourceMappingURL=vendor-BtGCZQy4.mjs.map
56472
+ //# sourceMappingURL=vendor-Q6b0E6UP.mjs.map