@forsakringskassan/docs-generator 2.35.4 → 2.35.6

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/index.mjs CHANGED
@@ -4,8 +4,8 @@ const require = $createRequire(import.meta.url);
4
4
 
5
5
  import fs from 'node:fs/promises';
6
6
  import path from 'node:path/posix';
7
- import { g as globSync, m as minimatch, M as MarkdownIt, d as dedent, b as closest, e as distance, f as fm, i as isCI, h as glob, j as moduleImporter, k as cliProgress, t as tinylr, w as watch, l as createInstance, n as fse, o as inter } from './vendor-Dd3EDAs1.mjs';
8
- import { g as generateId, p as parseInfostring, i as isDocumentPage, n as normalizePath, a as getFingerprint, h as hasTag, f as findTag, b as getOutputFilePath, d as htmlencode, e as exampleWorkerUrl, c as createMarkdownRenderer, j as generateExample } from './create-markdown-renderer-C3-r8Xp9.mjs';
7
+ import { g as globSync, m as minimatch, M as MarkdownIt, d as dedent, b as closest, e as distance, f as fm, i as isCI, h as glob, j as moduleImporter, k as cliProgress, t as tinylr, w as watch, l as createInstance, n as fse, o as inter } from './vendor-D4BVkQg8.mjs';
8
+ import { g as generateId, p as parseInfostring, i as isDocumentPage, n as normalizePath, a as getFingerprint, h as hasTag, f as findTag, b as getOutputFilePath, d as htmlencode, e as exampleWorkerUrl, c as createMarkdownRenderer, j as generateExample } from './create-markdown-renderer-Ci_APMYD.mjs';
9
9
  import sp__default from 'node:path';
10
10
  import require$$1 from 'crypto';
11
11
  import 'node:crypto';
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-C3-r8Xp9.mjs';
6
- import './vendor-Dd3EDAs1.mjs';
5
+ export { S as SoftError, c as createMarkdownRenderer } from './create-markdown-renderer-Ci_APMYD.mjs';
6
+ import './vendor-D4BVkQg8.mjs';
7
7
  import 'node:url';
8
8
  import 'node:path';
9
9
  import 'fs';
@@ -25091,9 +25091,6 @@ class PluralResolver {
25091
25091
  this.logger = baseLogger.create('pluralResolver');
25092
25092
  this.pluralRulesCache = {};
25093
25093
  }
25094
- addRule(lng, obj) {
25095
- this.rules[lng] = obj;
25096
- }
25097
25094
  clearCache() {
25098
25095
  this.pluralRulesCache = {};
25099
25096
  }
@@ -25834,6 +25831,9 @@ class I18n extends EventEmitter {
25834
25831
  if (typeof this.options.overloadTranslationOptionHandler !== 'function') {
25835
25832
  this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
25836
25833
  }
25834
+ if (this.options.debug === true) {
25835
+ if (typeof console !== 'undefined') console.warn('i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com');
25836
+ }
25837
25837
  const createClassOnDemand = ClassOrObject => {
25838
25838
  if (!ClassOrObject) return null;
25839
25839
  if (typeof ClassOrObject === 'function') return new ClassOrObject();
@@ -26249,7 +26249,19 @@ class I18n extends EventEmitter {
26249
26249
  clone.store = new ResourceStore(clonedData, mergedOptions);
26250
26250
  clone.services.resourceStore = clone.store;
26251
26251
  }
26252
- if (options.interpolation) clone.services.interpolator = new Interpolator(mergedOptions);
26252
+ if (options.interpolation) {
26253
+ const defOpts = get$1();
26254
+ const mergedInterpolation = {
26255
+ ...defOpts.interpolation,
26256
+ ...this.options.interpolation,
26257
+ ...options.interpolation
26258
+ };
26259
+ const mergedForInterpolator = {
26260
+ ...mergedOptions,
26261
+ interpolation: mergedInterpolation
26262
+ };
26263
+ clone.services.interpolator = new Interpolator(mergedForInterpolator);
26264
+ }
26253
26265
  clone.translator = new Translator(clone.services, mergedOptions);
26254
26266
  clone.translator.on('*', (event, ...args) => {
26255
26267
  clone.emit(event, ...args);
@@ -29001,6 +29013,11 @@ function canonicalize(obj, stack, replacementStack, replacer, key) {
29001
29013
  return canonicalizedObj;
29002
29014
  }
29003
29015
 
29016
+ const INCLUDE_HEADERS = {
29017
+ includeIndex: true,
29018
+ includeUnderline: true,
29019
+ includeFileHeaders: true
29020
+ };
29004
29021
  function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
29005
29022
  let optionsObj;
29006
29023
  if (!options) {
@@ -29130,17 +29147,29 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
29130
29147
  * creates a unified diff patch.
29131
29148
  * @param patch either a single structured patch object (as returned by `structuredPatch`) or an array of them (as returned by `parsePatch`)
29132
29149
  */
29133
- function formatPatch(patch) {
29150
+ function formatPatch(patch, headerOptions) {
29151
+ if (!headerOptions) {
29152
+ headerOptions = INCLUDE_HEADERS;
29153
+ }
29134
29154
  if (Array.isArray(patch)) {
29135
- return patch.map(formatPatch).join('\n');
29155
+ if (patch.length > 1 && !headerOptions.includeFileHeaders) {
29156
+ throw new Error('Cannot omit file headers on a multi-file patch. '
29157
+ + '(The result would be unparseable; how would a tool trying to apply '
29158
+ + 'the patch know which changes are to which file?)');
29159
+ }
29160
+ return patch.map(p => formatPatch(p, headerOptions)).join('\n');
29136
29161
  }
29137
29162
  const ret = [];
29138
- if (patch.oldFileName == patch.newFileName) {
29163
+ if (headerOptions.includeIndex && patch.oldFileName == patch.newFileName) {
29139
29164
  ret.push('Index: ' + patch.oldFileName);
29140
29165
  }
29141
- ret.push('===================================================================');
29142
- ret.push('--- ' + patch.oldFileName + (typeof patch.oldHeader === 'undefined' ? '' : '\t' + patch.oldHeader));
29143
- ret.push('+++ ' + patch.newFileName + (typeof patch.newHeader === 'undefined' ? '' : '\t' + patch.newHeader));
29166
+ if (headerOptions.includeUnderline) {
29167
+ ret.push('===================================================================');
29168
+ }
29169
+ if (headerOptions.includeFileHeaders) {
29170
+ ret.push('--- ' + patch.oldFileName + (typeof patch.oldHeader === 'undefined' ? '' : '\t' + patch.oldHeader));
29171
+ ret.push('+++ ' + patch.newFileName + (typeof patch.newHeader === 'undefined' ? '' : '\t' + patch.newHeader));
29172
+ }
29144
29173
  for (let i = 0; i < patch.hunks.length; i++) {
29145
29174
  const hunk = patch.hunks[i];
29146
29175
  // Unified Diff Format quirk: If the chunk size is 0,
@@ -29170,7 +29199,7 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader
29170
29199
  if (!patchObj) {
29171
29200
  return;
29172
29201
  }
29173
- return formatPatch(patchObj);
29202
+ return formatPatch(patchObj, options === null || options === void 0 ? void 0 : options.headerOptions);
29174
29203
  }
29175
29204
  else {
29176
29205
  const { callback } = options;
@@ -29179,7 +29208,7 @@ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader
29179
29208
  callback(undefined);
29180
29209
  }
29181
29210
  else {
29182
- callback(formatPatch(patchObj));
29211
+ callback(formatPatch(patchObj, options.headerOptions));
29183
29212
  }
29184
29213
  } }));
29185
29214
  }
@@ -54893,10 +54922,32 @@ function requireUtils () {
54893
54922
  hasRequiredUtils = 1;
54894
54923
 
54895
54924
  var formats = requireFormats();
54925
+ var getSideChannel = requireSideChannel();
54896
54926
 
54897
54927
  var has = Object.prototype.hasOwnProperty;
54898
54928
  var isArray = Array.isArray;
54899
54929
 
54930
+ // Track objects created from arrayLimit overflow using side-channel
54931
+ // Stores the current max numeric index for O(1) lookup
54932
+ var overflowChannel = getSideChannel();
54933
+
54934
+ var markOverflow = function markOverflow(obj, maxIndex) {
54935
+ overflowChannel.set(obj, maxIndex);
54936
+ return obj;
54937
+ };
54938
+
54939
+ var isOverflow = function isOverflow(obj) {
54940
+ return overflowChannel.has(obj);
54941
+ };
54942
+
54943
+ var getMaxIndex = function getMaxIndex(obj) {
54944
+ return overflowChannel.get(obj);
54945
+ };
54946
+
54947
+ var setMaxIndex = function setMaxIndex(obj, maxIndex) {
54948
+ overflowChannel.set(obj, maxIndex);
54949
+ };
54950
+
54900
54951
  var hexTable = (function () {
54901
54952
  var array = [];
54902
54953
  for (var i = 0; i < 256; ++i) {
@@ -54946,7 +54997,12 @@ function requireUtils () {
54946
54997
  if (isArray(target)) {
54947
54998
  target.push(source);
54948
54999
  } else if (target && typeof target === 'object') {
54949
- if (
55000
+ if (isOverflow(target)) {
55001
+ // Add at next numeric index for overflow objects
55002
+ var newIndex = getMaxIndex(target) + 1;
55003
+ target[newIndex] = source;
55004
+ setMaxIndex(target, newIndex);
55005
+ } else if (
54950
55006
  (options && (options.plainObjects || options.allowPrototypes))
54951
55007
  || !has.call(Object.prototype, source)
54952
55008
  ) {
@@ -54960,6 +55016,18 @@ function requireUtils () {
54960
55016
  }
54961
55017
 
54962
55018
  if (!target || typeof target !== 'object') {
55019
+ if (isOverflow(source)) {
55020
+ // Create new object with target at 0, source values shifted by 1
55021
+ var sourceKeys = Object.keys(source);
55022
+ var result = options && options.plainObjects
55023
+ ? { __proto__: null, 0: target }
55024
+ : { 0: target };
55025
+ for (var m = 0; m < sourceKeys.length; m++) {
55026
+ var oldKey = parseInt(sourceKeys[m], 10);
55027
+ result[oldKey + 1] = source[sourceKeys[m]];
55028
+ }
55029
+ return markOverflow(result, getMaxIndex(source) + 1);
55030
+ }
54963
55031
  return [target].concat(source);
54964
55032
  }
54965
55033
 
@@ -55131,8 +55199,20 @@ function requireUtils () {
55131
55199
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
55132
55200
  };
55133
55201
 
55134
- var combine = function combine(a, b) {
55135
- return [].concat(a, b);
55202
+ var combine = function combine(a, b, arrayLimit, plainObjects) {
55203
+ // If 'a' is already an overflow object, add to it
55204
+ if (isOverflow(a)) {
55205
+ var newIndex = getMaxIndex(a) + 1;
55206
+ a[newIndex] = b;
55207
+ setMaxIndex(a, newIndex);
55208
+ return a;
55209
+ }
55210
+
55211
+ var result = [].concat(a, b);
55212
+ if (result.length > arrayLimit) {
55213
+ return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1);
55214
+ }
55215
+ return result;
55136
55216
  };
55137
55217
 
55138
55218
  var maybeMap = function maybeMap(val, fn) {
@@ -55154,6 +55234,7 @@ function requireUtils () {
55154
55234
  decode: decode,
55155
55235
  encode: encode,
55156
55236
  isBuffer: isBuffer,
55237
+ isOverflow: isOverflow,
55157
55238
  isRegExp: isRegExp,
55158
55239
  maybeMap: maybeMap,
55159
55240
  merge: merge
@@ -55640,16 +55721,18 @@ function requireParse () {
55640
55721
  } else {
55641
55722
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
55642
55723
 
55643
- val = utils.maybeMap(
55644
- parseArrayValue(
55645
- part.slice(pos + 1),
55646
- options,
55647
- isArray(obj[key]) ? obj[key].length : 0
55648
- ),
55649
- function (encodedVal) {
55650
- return options.decoder(encodedVal, defaults.decoder, charset, 'value');
55651
- }
55652
- );
55724
+ if (key !== null) {
55725
+ val = utils.maybeMap(
55726
+ parseArrayValue(
55727
+ part.slice(pos + 1),
55728
+ options,
55729
+ isArray(obj[key]) ? obj[key].length : 0
55730
+ ),
55731
+ function (encodedVal) {
55732
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
55733
+ }
55734
+ );
55735
+ }
55653
55736
  }
55654
55737
 
55655
55738
  if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
@@ -55660,11 +55743,18 @@ function requireParse () {
55660
55743
  val = isArray(val) ? [val] : val;
55661
55744
  }
55662
55745
 
55663
- var existing = has.call(obj, key);
55664
- if (existing && options.duplicates === 'combine') {
55665
- obj[key] = utils.combine(obj[key], val);
55666
- } else if (!existing || options.duplicates === 'last') {
55667
- obj[key] = val;
55746
+ if (key !== null) {
55747
+ var existing = has.call(obj, key);
55748
+ if (existing && options.duplicates === 'combine') {
55749
+ obj[key] = utils.combine(
55750
+ obj[key],
55751
+ val,
55752
+ options.arrayLimit,
55753
+ options.plainObjects
55754
+ );
55755
+ } else if (!existing || options.duplicates === 'last') {
55756
+ obj[key] = val;
55757
+ }
55668
55758
  }
55669
55759
  }
55670
55760
 
@@ -55685,9 +55775,19 @@ function requireParse () {
55685
55775
  var root = chain[i];
55686
55776
 
55687
55777
  if (root === '[]' && options.parseArrays) {
55688
- obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
55689
- ? []
55690
- : utils.combine([], leaf);
55778
+ if (utils.isOverflow(leaf)) {
55779
+ // leaf is already an overflow object, preserve it
55780
+ obj = leaf;
55781
+ } else {
55782
+ obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
55783
+ ? []
55784
+ : utils.combine(
55785
+ [],
55786
+ leaf,
55787
+ options.arrayLimit,
55788
+ options.plainObjects
55789
+ );
55790
+ }
55691
55791
  } else {
55692
55792
  obj = options.plainObjects ? { __proto__: null } : {};
55693
55793
  var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
@@ -55715,29 +55815,28 @@ function requireParse () {
55715
55815
  return leaf;
55716
55816
  };
55717
55817
 
55718
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
55719
- if (!givenKey) {
55720
- return;
55721
- }
55722
-
55723
- // Transform dot notation to bracket notation
55818
+ var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
55724
55819
  var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
55725
55820
 
55726
- // The regex chunks
55821
+ if (options.depth <= 0) {
55822
+ if (!options.plainObjects && has.call(Object.prototype, key)) {
55823
+ if (!options.allowPrototypes) {
55824
+ return;
55825
+ }
55826
+ }
55827
+
55828
+ return [key];
55829
+ }
55727
55830
 
55728
55831
  var brackets = /(\[[^[\]]*])/;
55729
55832
  var child = /(\[[^[\]]*])/g;
55730
55833
 
55731
- // Get the parent
55732
-
55733
- var segment = options.depth > 0 && brackets.exec(key);
55834
+ var segment = brackets.exec(key);
55734
55835
  var parent = segment ? key.slice(0, segment.index) : key;
55735
55836
 
55736
- // Stash the parent if it exists
55737
-
55738
55837
  var keys = [];
55838
+
55739
55839
  if (parent) {
55740
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
55741
55840
  if (!options.plainObjects && has.call(Object.prototype, parent)) {
55742
55841
  if (!options.allowPrototypes) {
55743
55842
  return;
@@ -55747,28 +55846,42 @@ function requireParse () {
55747
55846
  keys.push(parent);
55748
55847
  }
55749
55848
 
55750
- // Loop through children appending to the array until we hit depth
55751
-
55752
55849
  var i = 0;
55753
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
55850
+ while ((segment = child.exec(key)) !== null && i < options.depth) {
55754
55851
  i += 1;
55755
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
55852
+
55853
+ var segmentContent = segment[1].slice(1, -1);
55854
+ if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
55756
55855
  if (!options.allowPrototypes) {
55757
55856
  return;
55758
55857
  }
55759
55858
  }
55859
+
55760
55860
  keys.push(segment[1]);
55761
55861
  }
55762
55862
 
55763
- // If there's a remainder, check strictDepth option for throw, else just add whatever is left
55764
-
55765
55863
  if (segment) {
55766
55864
  if (options.strictDepth === true) {
55767
55865
  throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
55768
55866
  }
55867
+
55769
55868
  keys.push('[' + key.slice(segment.index) + ']');
55770
55869
  }
55771
55870
 
55871
+ return keys;
55872
+ };
55873
+
55874
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
55875
+ if (!givenKey) {
55876
+ return;
55877
+ }
55878
+
55879
+ var keys = splitKeyIntoSegments(givenKey, options);
55880
+
55881
+ if (!keys) {
55882
+ return;
55883
+ }
55884
+
55772
55885
  return parseObject(keys, val, options, valuesParsed);
55773
55886
  };
55774
55887
 
@@ -56359,4 +56472,4 @@ var srcExports = requireSrc();
56359
56472
  var tinylr = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
56360
56473
 
56361
56474
  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 };
56362
- //# sourceMappingURL=vendor-Dd3EDAs1.mjs.map
56475
+ //# sourceMappingURL=vendor-D4BVkQg8.mjs.map