eslint-plugin-jsdoc 39.3.5 → 39.3.12

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.
Files changed (124) hide show
  1. package/README.md +273 -52
  2. package/dist/WarnSettings.js +0 -5
  3. package/dist/WarnSettings.js.map +1 -1
  4. package/dist/alignTransform.js +69 -61
  5. package/dist/alignTransform.js.map +1 -1
  6. package/dist/bin/generateRule.js +7 -26
  7. package/dist/bin/generateRule.js.map +1 -1
  8. package/dist/defaultTagOrder.js +30 -14
  9. package/dist/defaultTagOrder.js.map +1 -1
  10. package/dist/exportParser.js +34 -143
  11. package/dist/exportParser.js.map +1 -1
  12. package/dist/generateRule.js +7 -26
  13. package/dist/generateRule.js.map +1 -1
  14. package/dist/getDefaultTagStructureForMode.js +189 -93
  15. package/dist/getDefaultTagStructureForMode.js.map +1 -1
  16. package/dist/index.js +0 -51
  17. package/dist/index.js.map +1 -1
  18. package/dist/iterateJsdoc.js +44 -207
  19. package/dist/iterateJsdoc.js.map +1 -1
  20. package/dist/jsdocUtils.js +72 -221
  21. package/dist/jsdocUtils.js.map +1 -1
  22. package/dist/rules/checkAccess.js +0 -8
  23. package/dist/rules/checkAccess.js.map +1 -1
  24. package/dist/rules/checkAlignment.js +0 -8
  25. package/dist/rules/checkAlignment.js.map +1 -1
  26. package/dist/rules/checkExamples.js +25 -63
  27. package/dist/rules/checkExamples.js.map +1 -1
  28. package/dist/rules/checkIndentation.js +0 -7
  29. package/dist/rules/checkIndentation.js.map +1 -1
  30. package/dist/rules/checkLineAlignment.js +9 -30
  31. package/dist/rules/checkLineAlignment.js.map +1 -1
  32. package/dist/rules/checkParamNames.js +9 -47
  33. package/dist/rules/checkParamNames.js.map +1 -1
  34. package/dist/rules/checkPropertyNames.js +1 -18
  35. package/dist/rules/checkPropertyNames.js.map +1 -1
  36. package/dist/rules/checkSyntax.js +2 -5
  37. package/dist/rules/checkSyntax.js.map +1 -1
  38. package/dist/rules/checkTagNames.js +0 -18
  39. package/dist/rules/checkTagNames.js.map +1 -1
  40. package/dist/rules/checkTypes.js +17 -46
  41. package/dist/rules/checkTypes.js.map +1 -1
  42. package/dist/rules/checkValues.js +0 -18
  43. package/dist/rules/checkValues.js.map +1 -1
  44. package/dist/rules/emptyTags.js +6 -11
  45. package/dist/rules/emptyTags.js.map +1 -1
  46. package/dist/rules/implementsOnClasses.js +0 -6
  47. package/dist/rules/implementsOnClasses.js.map +1 -1
  48. package/dist/rules/matchDescription.js +0 -20
  49. package/dist/rules/matchDescription.js.map +1 -1
  50. package/dist/rules/matchName.js +2 -17
  51. package/dist/rules/matchName.js.map +1 -1
  52. package/dist/rules/multilineBlocks.js +10 -34
  53. package/dist/rules/multilineBlocks.js.map +1 -1
  54. package/dist/rules/newlineAfterDescription.js +0 -8
  55. package/dist/rules/newlineAfterDescription.js.map +1 -1
  56. package/dist/rules/noBadBlocks.js +2 -16
  57. package/dist/rules/noBadBlocks.js.map +1 -1
  58. package/dist/rules/noDefaults.js +0 -7
  59. package/dist/rules/noDefaults.js.map +1 -1
  60. package/dist/rules/noMissingSyntax.js +2 -16
  61. package/dist/rules/noMissingSyntax.js.map +1 -1
  62. package/dist/rules/noMultiAsterisks.js +2 -16
  63. package/dist/rules/noMultiAsterisks.js.map +1 -1
  64. package/dist/rules/noRestrictedSyntax.js +3 -9
  65. package/dist/rules/noRestrictedSyntax.js.map +1 -1
  66. package/dist/rules/noTypes.js +0 -7
  67. package/dist/rules/noTypes.js.map +1 -1
  68. package/dist/rules/noUndefinedTypes.js +13 -34
  69. package/dist/rules/noUndefinedTypes.js.map +1 -1
  70. package/dist/rules/requireAsteriskPrefix.js +2 -26
  71. package/dist/rules/requireAsteriskPrefix.js.map +1 -1
  72. package/dist/rules/requireDescription.js +0 -17
  73. package/dist/rules/requireDescription.js.map +1 -1
  74. package/dist/rules/requireDescriptionCompleteSentence.js +13 -34
  75. package/dist/rules/requireDescriptionCompleteSentence.js.map +1 -1
  76. package/dist/rules/requireExample.js +0 -9
  77. package/dist/rules/requireExample.js.map +1 -1
  78. package/dist/rules/requireFileOverview.js +0 -16
  79. package/dist/rules/requireFileOverview.js.map +1 -1
  80. package/dist/rules/requireHyphenBeforeParamDescription.js +2 -16
  81. package/dist/rules/requireHyphenBeforeParamDescription.js.map +1 -1
  82. package/dist/rules/requireJsdoc.js +13 -58
  83. package/dist/rules/requireJsdoc.js.map +1 -1
  84. package/dist/rules/requireParam.js +6 -53
  85. package/dist/rules/requireParam.js.map +1 -1
  86. package/dist/rules/requireParamDescription.js +0 -4
  87. package/dist/rules/requireParamDescription.js.map +1 -1
  88. package/dist/rules/requireParamName.js +0 -4
  89. package/dist/rules/requireParamName.js.map +1 -1
  90. package/dist/rules/requireParamType.js +0 -4
  91. package/dist/rules/requireParamType.js.map +1 -1
  92. package/dist/rules/requireProperty.js +0 -9
  93. package/dist/rules/requireProperty.js.map +1 -1
  94. package/dist/rules/requirePropertyDescription.js +0 -4
  95. package/dist/rules/requirePropertyDescription.js.map +1 -1
  96. package/dist/rules/requirePropertyName.js +0 -4
  97. package/dist/rules/requirePropertyName.js.map +1 -1
  98. package/dist/rules/requirePropertyType.js +0 -4
  99. package/dist/rules/requirePropertyType.js.map +1 -1
  100. package/dist/rules/requireReturns.js +13 -23
  101. package/dist/rules/requireReturns.js.map +1 -1
  102. package/dist/rules/requireReturnsCheck.js +12 -20
  103. package/dist/rules/requireReturnsCheck.js.map +1 -1
  104. package/dist/rules/requireReturnsDescription.js +0 -6
  105. package/dist/rules/requireReturnsDescription.js.map +1 -1
  106. package/dist/rules/requireReturnsType.js +0 -4
  107. package/dist/rules/requireReturnsType.js.map +1 -1
  108. package/dist/rules/requireThrows.js +6 -15
  109. package/dist/rules/requireThrows.js.map +1 -1
  110. package/dist/rules/requireYields.js +13 -29
  111. package/dist/rules/requireYields.js.map +1 -1
  112. package/dist/rules/requireYieldsCheck.js +8 -29
  113. package/dist/rules/requireYieldsCheck.js.map +1 -1
  114. package/dist/rules/sortTags.js +17 -30
  115. package/dist/rules/sortTags.js.map +1 -1
  116. package/dist/rules/tagLines.js +0 -26
  117. package/dist/rules/tagLines.js.map +1 -1
  118. package/dist/rules/validTypes.js +22 -53
  119. package/dist/rules/validTypes.js.map +1 -1
  120. package/dist/tagNames.js +7 -4
  121. package/dist/tagNames.js.map +1 -1
  122. package/dist/utils/hasReturnValue.js +22 -66
  123. package/dist/utils/hasReturnValue.js.map +1 -1
  124. package/package.json +16 -16
package/README.md CHANGED
@@ -2403,17 +2403,28 @@ const fn = ( lorem, sit ) => {}
2403
2403
  // Message: Expected JSDoc block lines to not be aligned.
2404
2404
 
2405
2405
 
2406
- /**
2407
- * Function description.
2408
- *
2409
- * @param {string} lorem Description.
2410
- * @param {int} sit Description multi words.
2411
- * @param {string} sth Multi
2412
- * line description.
2413
- */
2406
+ /**\r
2407
+ * Function description.\r
2408
+ *\r
2409
+ * @param {string} lorem Description.\r
2410
+ * @param {int} sit Description multi words.\r
2411
+ * @param {string} sth Multi\r
2412
+ * line description.\r
2413
+ */\r
2414
2414
  const fn = ( lorem, sit ) => {}
2415
2415
  // "jsdoc/check-line-alignment": ["error"|"warn", "always"]
2416
2416
  // Message: Expected JSDoc block lines to be aligned.
2417
+
2418
+ /**
2419
+ * Function description.
2420
+ *
2421
+ * @param {string} lorem Description.
2422
+ * @param {int} sit Description multi
2423
+ * line with asterisks.
2424
+ */
2425
+ const fn = ( lorem, sit ) => {}
2426
+ // "jsdoc/check-line-alignment": ["error"|"warn", "always"]
2427
+ // Message: Expected JSDoc block lines to be aligned.
2417
2428
  ````
2418
2429
 
2419
2430
  The following patterns are not considered problems:
@@ -2671,14 +2682,14 @@ const fn = ({ids}) => {}
2671
2682
  // "jsdoc/check-line-alignment": ["error"|"warn", "always"]
2672
2683
 
2673
2684
 
2674
- /**
2675
- * Function description.
2676
- *
2677
- * @param {string} lorem Description.
2678
- * @param {int} sit Description multi words.
2679
- * @param {string} sth Multi
2680
- * line description.
2681
- */
2685
+ /**\r
2686
+ * Function description.\r
2687
+ *\r
2688
+ * @param {string} lorem Description.\r
2689
+ * @param {int} sit Description multi words.\r
2690
+ * @param {string} sth Multi\r
2691
+ * line description.\r
2692
+ */\r
2682
2693
  const fn = ( lorem, sit ) => {}
2683
2694
  // "jsdoc/check-line-alignment": ["error"|"warn", "always"]
2684
2695
 
@@ -2697,6 +2708,79 @@ const fn = ( lorem, sit ) => {};
2697
2708
  */
2698
2709
  const fn2 = () => {}
2699
2710
  // "jsdoc/check-line-alignment": ["error"|"warn", "always"]
2711
+
2712
+ /**
2713
+ * Function description.
2714
+ *
2715
+ * @param lorem Description.
2716
+ * @param sit Description multi words.
2717
+ * @return Return description.
2718
+ */
2719
+ const fn = ( lorem, sit ) => {};
2720
+
2721
+ /**
2722
+ * Function description.
2723
+ *
2724
+ * @param lorem Description.
2725
+ * @param sit Description multi words.
2726
+ * @returns Return description.
2727
+ */
2728
+ const fn2 = ( lorem, sit ) => {};
2729
+
2730
+ /**
2731
+ * Function description.
2732
+ *
2733
+ * @param a Description.
2734
+ * @param b Description multi words.
2735
+ * @returns Return description.
2736
+ */
2737
+ const fn3 = ( a, b ) => {};
2738
+ // "jsdoc/check-line-alignment": ["error"|"warn", "always"]
2739
+
2740
+ /**
2741
+ * Function description.
2742
+ *
2743
+ * @argument lorem Description.
2744
+ * @return Return description.
2745
+ */
2746
+ const fn = ( lorem ) => {};
2747
+
2748
+ /**
2749
+ * Function description.
2750
+ *
2751
+ * @argument lorem Description.
2752
+ * @returns Return description.
2753
+ */
2754
+ const fn2 = ( lorem ) => {};
2755
+ // "jsdoc/check-line-alignment": ["error"|"warn", "always"]
2756
+
2757
+ /**
2758
+ * Function description.
2759
+ *
2760
+ * @arg a Description.
2761
+ * @returns Return description.
2762
+ */
2763
+ const fn = ( a ) => {};
2764
+ // "jsdoc/check-line-alignment": ["error"|"warn", "always"]
2765
+
2766
+ /**
2767
+ * Function description.
2768
+ *
2769
+ * @arg lorem Description.
2770
+ * @param sit Return description.
2771
+ */
2772
+ const fn = ( lorem, sit ) => {};
2773
+ // "jsdoc/check-line-alignment": ["error"|"warn", "always"]
2774
+
2775
+ /**
2776
+ * Function description.
2777
+ *
2778
+ * @arg a Description.
2779
+ * @argument b Second description.
2780
+ * @returns Return description.
2781
+ */
2782
+ const fn = ( a, b ) => {};
2783
+ // "jsdoc/check-line-alignment": ["error"|"warn", "always"]
2700
2784
  ````
2701
2785
 
2702
2786
 
@@ -3280,6 +3364,12 @@ function quux (foo) {
3280
3364
  }
3281
3365
  // "jsdoc/check-param-names": ["error"|"warn", {"enableFixer":true}]
3282
3366
  // Message: Duplicate @param "foo"
3367
+
3368
+ /**
3369
+ * @param barr This is the description of bar. Oops, we misspelled "bar" as "barr".
3370
+ */
3371
+ declare function foo(bar: number) {}
3372
+ // Message: Expected @param names to be "bar". Got "barr".
3283
3373
  ````
3284
3374
 
3285
3375
  The following patterns are not considered problems:
@@ -3654,6 +3744,18 @@ class A {
3654
3744
  * @param root."1" Our "b"
3655
3745
  */
3656
3746
  const foo = ([, b]) => b;
3747
+
3748
+ /**
3749
+ * @param arg1 This is the description for arg1.
3750
+ */
3751
+ function foo(this: void, arg1: number): void;
3752
+
3753
+ declare global {
3754
+ /**
3755
+ * @param arg1 This is the number for foo.
3756
+ */
3757
+ function foo(this: void, arg1: number): void;
3758
+ }
3657
3759
  ````
3658
3760
 
3659
3761
 
@@ -6277,7 +6379,7 @@ function quux (foo) {
6277
6379
 
6278
6380
  /**
6279
6381
  * @module test
6280
- * @license MIT
6382
+ * @license MIT\r
6281
6383
  */
6282
6384
  'use strict';
6283
6385
 
@@ -8354,14 +8456,14 @@ function quux () {
8354
8456
  // Message: There must be no newline after the description of the JSDoc block.
8355
8457
 
8356
8458
 
8357
- /**
8358
- * Bar.
8359
- *
8360
- * Bar.
8361
- *
8362
- * @bar
8363
- */
8364
- function quux () {
8459
+ /**\r
8460
+ * Bar.\r
8461
+ *\r
8462
+ * Bar.\r
8463
+ *\r
8464
+ * @bar\r
8465
+ */\r
8466
+ function quux () {\r
8365
8467
 
8366
8468
  }
8367
8469
  // "jsdoc/newline-after-description": ["error"|"warn", "never"]
@@ -8385,12 +8487,12 @@ function quux () {
8385
8487
  // Message: There must be a newline after the description of the JSDoc block.
8386
8488
 
8387
8489
 
8388
- /**
8389
- * Service for fetching symbols.
8390
- * @param {object} $http - Injected http helper.
8391
- * @param {object} $q - Injected Promise api helper.
8392
- * @param {object} $location - Injected window location object.
8393
- * @param {object} REPORT_DIALOG_CONSTANTS - Injected handle.
8490
+ /**\r
8491
+ * Service for fetching symbols.\r
8492
+ * @param {object} $http - Injected http helper.\r
8493
+ * @param {object} $q - Injected Promise api helper.\r
8494
+ * @param {object} $location - Injected window location object.\r
8495
+ * @param {object} REPORT_DIALOG_CONSTANTS - Injected handle.\r
8394
8496
  */
8395
8497
  // Message: There must be a newline after the description of the JSDoc block.
8396
8498
 
@@ -8453,20 +8555,20 @@ function quux () {
8453
8555
  // "jsdoc/newline-after-description": ["error"|"warn", "never"]
8454
8556
 
8455
8557
 
8456
- /**
8457
- * @foo
8458
- * Test 
8459
- * abc 
8460
- * @bar 
8558
+ /**\r
8559
+ * @foo\r
8560
+ * Test \r
8561
+ * abc \r
8562
+ * @bar \r
8461
8563
  */
8462
8564
 
8463
8565
 
8464
- /**
8465
- *
8466
- * @foo
8467
- * Test 
8468
- * abc 
8469
- * @bar 
8566
+ /**\r
8567
+ * \r
8568
+ * @foo\r
8569
+ * Test \r
8570
+ * abc \r
8571
+ * @bar \r
8470
8572
  */
8471
8573
 
8472
8574
  /***
@@ -8477,16 +8579,16 @@ function quux () {
8477
8579
  }
8478
8580
  // "jsdoc/newline-after-description": ["error"|"warn", "always"]
8479
8581
 
8480
- /**
8481
- * Parses query string to object containing URL parameters
8482
- *
8483
- * @param queryString
8484
- * Input string
8485
- *
8486
- * @returns
8487
- * Object containing URL parameters
8488
- */
8489
- export function parseQueryString(queryString: string): { [key: string]: string } { // <-- Line 10 that fails
8582
+ /**\r
8583
+ * Parses query string to object containing URL parameters\r
8584
+ * \r
8585
+ * @param queryString\r
8586
+ * Input string\r
8587
+ * \r
8588
+ * @returns\r
8589
+ * Object containing URL parameters\r
8590
+ */\r
8591
+ export function parseQueryString(queryString: string): { [key: string]: string } { // <-- Line 10 that fails\r
8490
8592
 
8491
8593
  }
8492
8594
 
@@ -17298,6 +17400,41 @@ function quux (foo) {
17298
17400
  return foo;
17299
17401
  }
17300
17402
  // Message: JSDoc @returns declaration set with "never" but return expression is present in function.
17403
+
17404
+ /**
17405
+ * Reads a test fixture.
17406
+ *
17407
+ * @param path The path to resolve relative to the fixture base. It will be normalized for the
17408
+ * operating system.
17409
+ *
17410
+ * @returns The file contents as buffer.
17411
+ */
17412
+ export function readFixture(path: string): void;
17413
+ // Message: JSDoc @returns declaration present but return expression not available in function.
17414
+
17415
+ /**
17416
+ * Reads a test fixture.
17417
+ *
17418
+ * @param path The path to resolve relative to the fixture base. It will be normalized for the
17419
+ * operating system.
17420
+ *
17421
+ * @returns The file contents as buffer.
17422
+ */
17423
+ export function readFixture(path: string);
17424
+ // Message: JSDoc @returns declaration present but return expression not available in function.
17425
+
17426
+ /**
17427
+ * Reads a test fixture.
17428
+ *
17429
+ * @param path The path to resolve relative to the fixture base. It will be normalized for the
17430
+ * operating system.
17431
+ *
17432
+ * @returns The file contents as buffer.
17433
+ */
17434
+ export function readFixture(path: string): void {
17435
+ return;
17436
+ };
17437
+ // Message: JSDoc @returns declaration present but return expression not available in function.
17301
17438
  ````
17302
17439
 
17303
17440
  The following patterns are not considered problems:
@@ -17674,6 +17811,46 @@ function * quux() {}
17674
17811
  function * quux() {}
17675
17812
  // Settings: {"jsdoc":{"mode":"jsdoc"}}
17676
17813
  // "jsdoc/require-returns-check": ["error"|"warn", {"exemptGenerators":true}]
17814
+
17815
+ /**
17816
+ * @param {unknown} val
17817
+ * @returns { asserts val is number }
17818
+ */
17819
+ function assertNumber(val) {
17820
+ assert(typeof val === 'number');
17821
+ }
17822
+
17823
+ /**
17824
+ * Reads a test fixture.
17825
+ *
17826
+ * @param path The path to resolve relative to the fixture base. It will be normalized for the
17827
+ * operating system.
17828
+ *
17829
+ * @returns The file contents as buffer.
17830
+ */
17831
+ export function readFixture(path: string): Promise<Buffer>;
17832
+
17833
+ /**
17834
+ * Reads a test fixture.
17835
+ *
17836
+ * @param path The path to resolve relative to the fixture base. It will be normalized for the
17837
+ * operating system.
17838
+ *
17839
+ * @returns The file contents as buffer.
17840
+ */
17841
+ export function readFixture(path: string): Promise<Buffer> {
17842
+ return new Promise(() => {});
17843
+ }
17844
+
17845
+ /**
17846
+ * Reads a test fixture.
17847
+ *
17848
+ * @param path The path to resolve relative to the fixture base. It will be normalized for the
17849
+ * operating system.
17850
+ *
17851
+ * @returns {void} The file contents as buffer.
17852
+ */
17853
+ export function readFixture(path: string);
17677
17854
  ````
17678
17855
 
17679
17856
 
@@ -18548,6 +18725,26 @@ export const sleep = (ms: number) => {
18548
18725
  return new Promise<string>((res) => setTimeout(res, ms));
18549
18726
  };
18550
18727
  // Message: Missing JSDoc @returns declaration.
18728
+
18729
+ /**
18730
+ * Reads a test fixture.
18731
+ */
18732
+ export function readFixture(path: string): Promise<Buffer>;
18733
+ // Message: Missing JSDoc @returns declaration.
18734
+
18735
+ /**
18736
+ * Reads a test fixture.
18737
+ */
18738
+ export function readFixture(path: string): void;
18739
+ // "jsdoc/require-returns": ["error"|"warn", {"forceRequireReturn":true}]
18740
+ // Message: Missing JSDoc @returns declaration.
18741
+
18742
+ /**
18743
+ * Reads a test fixture.
18744
+ */
18745
+ export function readFixture(path: string);
18746
+ // "jsdoc/require-returns": ["error"|"warn", {"forceRequireReturn":true}]
18747
+ // Message: Missing JSDoc @returns declaration.
18551
18748
  ````
18552
18749
 
18553
18750
  The following patterns are not considered problems:
@@ -19051,6 +19248,30 @@ export const sleep = (ms: number) =>
19051
19248
  export const sleep = (ms: number) => {
19052
19249
  return new Promise<void>((res) => setTimeout(res, ms));
19053
19250
  };
19251
+
19252
+ /**
19253
+ * Reads a test fixture.
19254
+ *
19255
+ * @returns The file contents as buffer.
19256
+ */
19257
+ export function readFixture(path: string): Promise<Buffer>;
19258
+
19259
+ /**
19260
+ * Reads a test fixture.
19261
+ *
19262
+ * @returns {void}.
19263
+ */
19264
+ export function readFixture(path: string): void;
19265
+
19266
+ /**
19267
+ * Reads a test fixture.
19268
+ */
19269
+ export function readFixture(path: string): void;
19270
+
19271
+ /**
19272
+ * Reads a test fixture.
19273
+ */
19274
+ export function readFixture(path: string);
19054
19275
  ````
19055
19276
 
19056
19277
 
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  const WarnSettings = function () {
9
8
  /** @type {WeakMap<object, Set<string>>} */
10
9
  const warnedSettings = new WeakMap();
@@ -18,19 +17,15 @@ const WarnSettings = function () {
18
17
  hasBeenWarned(context, setting) {
19
18
  return warnedSettings.has(context) && warnedSettings.get(context).has(setting);
20
19
  },
21
-
22
20
  markSettingAsWarned(context, setting) {
23
21
  // istanbul ignore else
24
22
  if (!warnedSettings.has(context)) {
25
23
  warnedSettings.set(context, new Set());
26
24
  }
27
-
28
25
  warnedSettings.get(context).add(setting);
29
26
  }
30
-
31
27
  };
32
28
  };
33
-
34
29
  var _default = WarnSettings;
35
30
  exports.default = _default;
36
31
  module.exports = exports.default;
@@ -1 +1 @@
1
- {"version":3,"file":"WarnSettings.js","names":["WarnSettings","warnedSettings","WeakMap","hasBeenWarned","context","setting","has","get","markSettingAsWarned","set","Set","add"],"sources":["../src/WarnSettings.js"],"sourcesContent":["const WarnSettings = function () {\n /** @type {WeakMap<object, Set<string>>} */\n const warnedSettings = new WeakMap();\n\n return {\n /**\n * Warn only once for each context and setting\n *\n * @param {object} context\n * @param {string} setting\n */\n hasBeenWarned (context, setting) {\n return warnedSettings.has(context) && warnedSettings.get(context).has(setting);\n },\n\n markSettingAsWarned (context, setting) {\n // istanbul ignore else\n if (!warnedSettings.has(context)) {\n warnedSettings.set(context, new Set());\n }\n\n warnedSettings.get(context).add(setting);\n },\n };\n};\n\nexport default WarnSettings;\n"],"mappings":";;;;;;;AAAA,MAAMA,YAAY,GAAG,YAAY;EAC/B;EACA,MAAMC,cAAc,GAAG,IAAIC,OAAJ,EAAvB;EAEA,OAAO;IACL;AACJ;AACA;AACA;AACA;AACA;IACIC,aAAa,CAAEC,OAAF,EAAWC,OAAX,EAAoB;MAC/B,OAAOJ,cAAc,CAACK,GAAf,CAAmBF,OAAnB,KAA+BH,cAAc,CAACM,GAAf,CAAmBH,OAAnB,EAA4BE,GAA5B,CAAgCD,OAAhC,CAAtC;IACD,CATI;;IAWLG,mBAAmB,CAAEJ,OAAF,EAAWC,OAAX,EAAoB;MACrC;MACA,IAAI,CAACJ,cAAc,CAACK,GAAf,CAAmBF,OAAnB,CAAL,EAAkC;QAChCH,cAAc,CAACQ,GAAf,CAAmBL,OAAnB,EAA4B,IAAIM,GAAJ,EAA5B;MACD;;MAEDT,cAAc,CAACM,GAAf,CAAmBH,OAAnB,EAA4BO,GAA5B,CAAgCN,OAAhC;IACD;;EAlBI,CAAP;AAoBD,CAxBD;;eA0BeL,Y"}
1
+ {"version":3,"file":"WarnSettings.js","names":["WarnSettings","warnedSettings","WeakMap","hasBeenWarned","context","setting","has","get","markSettingAsWarned","set","Set","add"],"sources":["../src/WarnSettings.js"],"sourcesContent":["const WarnSettings = function () {\n /** @type {WeakMap<object, Set<string>>} */\n const warnedSettings = new WeakMap();\n\n return {\n /**\n * Warn only once for each context and setting\n *\n * @param {object} context\n * @param {string} setting\n */\n hasBeenWarned (context, setting) {\n return warnedSettings.has(context) && warnedSettings.get(context).has(setting);\n },\n\n markSettingAsWarned (context, setting) {\n // istanbul ignore else\n if (!warnedSettings.has(context)) {\n warnedSettings.set(context, new Set());\n }\n\n warnedSettings.get(context).add(setting);\n },\n };\n};\n\nexport default WarnSettings;\n"],"mappings":";;;;;;AAAA,MAAMA,YAAY,GAAG,YAAY;EAC/B;EACA,MAAMC,cAAc,GAAG,IAAIC,OAAO,EAAE;EAEpC,OAAO;IACL;AACJ;AACA;AACA;AACA;AACA;IACIC,aAAa,CAAEC,OAAO,EAAEC,OAAO,EAAE;MAC/B,OAAOJ,cAAc,CAACK,GAAG,CAACF,OAAO,CAAC,IAAIH,cAAc,CAACM,GAAG,CAACH,OAAO,CAAC,CAACE,GAAG,CAACD,OAAO,CAAC;IAChF,CAAC;IAEDG,mBAAmB,CAAEJ,OAAO,EAAEC,OAAO,EAAE;MACrC;MACA,IAAI,CAACJ,cAAc,CAACK,GAAG,CAACF,OAAO,CAAC,EAAE;QAChCH,cAAc,CAACQ,GAAG,CAACL,OAAO,EAAE,IAAIM,GAAG,EAAE,CAAC;MACxC;MAEAT,cAAc,CAACM,GAAG,CAACH,OAAO,CAAC,CAACO,GAAG,CAACN,OAAO,CAAC;IAC1C;EACF,CAAC;AACH,CAAC;AAAC,eAEaL,YAAY;AAAA;AAAA"}