@dereekb/util 13.11.1 → 13.11.3

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 (102) hide show
  1. package/eslint/index.cjs.default.js +1 -0
  2. package/eslint/index.cjs.js +607 -0
  3. package/eslint/index.cjs.mjs +2 -0
  4. package/eslint/index.d.ts +1 -0
  5. package/eslint/index.esm.js +603 -0
  6. package/eslint/package.json +23 -0
  7. package/eslint/src/index.d.ts +1 -0
  8. package/eslint/src/lib/comments.d.ts +54 -0
  9. package/eslint/src/lib/index.d.ts +3 -0
  10. package/eslint/src/lib/plugin.d.ts +18 -0
  11. package/eslint/src/lib/prefer-no-side-effects-in-jsdoc.rule.d.ts +42 -0
  12. package/eslint/src/lib/require-no-side-effects.rule.d.ts +54 -0
  13. package/fetch/package.json +2 -2
  14. package/index.cjs.js +1203 -23
  15. package/index.esm.js +1203 -23
  16. package/package.json +7 -1
  17. package/src/lib/array/array.factory.d.ts +2 -0
  18. package/src/lib/array/array.filter.d.ts +50 -17
  19. package/src/lib/array/array.find.d.ts +1 -0
  20. package/src/lib/array/array.index.d.ts +7 -0
  21. package/src/lib/array/array.indexed.d.ts +21 -0
  22. package/src/lib/array/array.make.d.ts +7 -0
  23. package/src/lib/array/array.random.d.ts +1 -0
  24. package/src/lib/array/array.unique.d.ts +3 -0
  25. package/src/lib/array/array.value.d.ts +7 -0
  26. package/src/lib/auth/auth.role.claims.d.ts +7 -0
  27. package/src/lib/boolean.d.ts +1 -0
  28. package/src/lib/contact/random.d.ts +14 -0
  29. package/src/lib/date/date.d.ts +6 -0
  30. package/src/lib/date/time.d.ts +7 -0
  31. package/src/lib/date/week.d.ts +7 -0
  32. package/src/lib/error/error.d.ts +7 -0
  33. package/src/lib/filter/filter.d.ts +7 -0
  34. package/src/lib/function/function.boolean.d.ts +7 -0
  35. package/src/lib/function/function.forward.d.ts +14 -0
  36. package/src/lib/getter/getter.cache.d.ts +7 -0
  37. package/src/lib/getter/getter.d.ts +34 -0
  38. package/src/lib/getter/getter.map.d.ts +7 -0
  39. package/src/lib/getter/getter.util.d.ts +7 -0
  40. package/src/lib/grouping.d.ts +8 -0
  41. package/src/lib/hash.d.ts +1 -0
  42. package/src/lib/key.d.ts +16 -0
  43. package/src/lib/map/map.key.d.ts +14 -0
  44. package/src/lib/model/id.batch.d.ts +7 -0
  45. package/src/lib/model/id.factory.d.ts +7 -0
  46. package/src/lib/model/model.conversion.d.ts +35 -0
  47. package/src/lib/model/model.copy.d.ts +7 -0
  48. package/src/lib/model/model.d.ts +19 -0
  49. package/src/lib/model/model.modify.d.ts +14 -0
  50. package/src/lib/nodejs/stream.d.ts +7 -0
  51. package/src/lib/number/bound.d.ts +3 -0
  52. package/src/lib/number/dollar.d.ts +7 -0
  53. package/src/lib/number/factory.d.ts +7 -0
  54. package/src/lib/number/random.d.ts +1 -0
  55. package/src/lib/number/round.d.ts +22 -0
  56. package/src/lib/number/sort.d.ts +7 -0
  57. package/src/lib/number/transform.d.ts +7 -0
  58. package/src/lib/object/object.array.delta.d.ts +7 -0
  59. package/src/lib/object/object.equal.d.ts +7 -0
  60. package/src/lib/object/object.filter.pojo.d.ts +87 -0
  61. package/src/lib/object/object.filter.tuple.d.ts +16 -0
  62. package/src/lib/object/object.key.d.ts +14 -0
  63. package/src/lib/object/object.map.d.ts +14 -0
  64. package/src/lib/path/path.d.ts +9 -0
  65. package/src/lib/promise/promise.d.ts +21 -0
  66. package/src/lib/promise/promise.factory.d.ts +7 -0
  67. package/src/lib/promise/promise.task.d.ts +7 -0
  68. package/src/lib/service/handler.config.d.ts +28 -0
  69. package/src/lib/service/handler.d.ts +14 -0
  70. package/src/lib/set/set.d.ts +21 -0
  71. package/src/lib/set/set.decision.d.ts +7 -0
  72. package/src/lib/set/set.delta.d.ts +7 -0
  73. package/src/lib/set/set.selection.d.ts +7 -0
  74. package/src/lib/sort.d.ts +8 -0
  75. package/src/lib/string/char.d.ts +7 -0
  76. package/src/lib/string/dencoder.d.ts +35 -0
  77. package/src/lib/string/factory.d.ts +22 -1
  78. package/src/lib/string/replace.d.ts +78 -0
  79. package/src/lib/string/search.d.ts +7 -0
  80. package/src/lib/string/sort.d.ts +7 -0
  81. package/src/lib/string/string.d.ts +1 -0
  82. package/src/lib/string/transform.d.ts +53 -0
  83. package/src/lib/string/tree.d.ts +7 -0
  84. package/src/lib/string/url.d.ts +7 -0
  85. package/src/lib/tree/tree.array.d.ts +1 -0
  86. package/src/lib/tree/tree.explore.d.ts +3 -0
  87. package/src/lib/type.d.ts +3 -2
  88. package/src/lib/value/bound.d.ts +28 -0
  89. package/src/lib/value/comparator.d.ts +16 -0
  90. package/src/lib/value/decision.d.ts +5 -0
  91. package/src/lib/value/equal.d.ts +2 -0
  92. package/src/lib/value/indexed.d.ts +127 -0
  93. package/src/lib/value/map.d.ts +22 -0
  94. package/src/lib/value/maybe.type.d.ts +2 -2
  95. package/src/lib/value/modifier.d.ts +13 -0
  96. package/src/lib/value/point.d.ts +56 -0
  97. package/src/lib/value/use.d.ts +37 -0
  98. package/src/lib/value/vector.d.ts +7 -0
  99. package/test/index.cjs.js +17 -4
  100. package/test/index.esm.js +17 -4
  101. package/test/package.json +2 -2
  102. package/test/src/lib/shared/shared.fail.d.ts +24 -5
@@ -0,0 +1,3 @@
1
+ export { utilRequireNoSideEffectsRule, type UtilRequireNoSideEffectsRuleOptions, type UtilRequireNoSideEffectsRuleDefinition } from './require-no-side-effects.rule';
2
+ export { utilPreferNoSideEffectsInJsdocRule, type UtilPreferNoSideEffectsInJsdocRuleDefinition } from './prefer-no-side-effects-in-jsdoc.rule';
3
+ export { utilEslintPlugin, type UtilEslintPlugin } from './plugin';
@@ -0,0 +1,18 @@
1
+ import { type UtilRequireNoSideEffectsRuleDefinition } from './require-no-side-effects.rule';
2
+ import { type UtilPreferNoSideEffectsInJsdocRuleDefinition } from './prefer-no-side-effects-in-jsdoc.rule';
3
+ /**
4
+ * ESLint plugin interface for @dereekb/util rules.
5
+ */
6
+ export interface UtilEslintPlugin {
7
+ readonly rules: {
8
+ readonly 'require-no-side-effects': UtilRequireNoSideEffectsRuleDefinition;
9
+ readonly 'prefer-no-side-effects-in-jsdoc': UtilPreferNoSideEffectsInJsdocRuleDefinition;
10
+ };
11
+ }
12
+ /**
13
+ * ESLint plugin for @dereekb/util rules.
14
+ *
15
+ * Register as a plugin in your flat ESLint config, then enable individual rules
16
+ * under the chosen plugin prefix (e.g. 'dereekb-util/require-no-side-effects').
17
+ */
18
+ export declare const utilEslintPlugin: UtilEslintPlugin;
@@ -0,0 +1,42 @@
1
+ type AstNode = any;
2
+ /**
3
+ * ESLint rule definition for prefer-no-side-effects-in-jsdoc.
4
+ */
5
+ export interface UtilPreferNoSideEffectsInJsdocRuleDefinition {
6
+ readonly meta: {
7
+ readonly type: 'suggestion';
8
+ readonly fixable: 'code';
9
+ readonly docs: {
10
+ readonly description: string;
11
+ readonly recommended: boolean;
12
+ };
13
+ readonly messages: {
14
+ readonly preferJsdocPlacement: string;
15
+ };
16
+ readonly schema: readonly object[];
17
+ };
18
+ create(context: {
19
+ options: unknown[];
20
+ report: (descriptor: {
21
+ node: AstNode;
22
+ messageId: string;
23
+ data?: Record<string, string>;
24
+ fix?: (fixer: AstNode) => AstNode | AstNode[];
25
+ }) => void;
26
+ sourceCode: AstNode;
27
+ }): Record<string, (node: AstNode) => void>;
28
+ }
29
+ /**
30
+ * ESLint rule that flags functions with both a JSDoc block and a separate
31
+ * `// @__NO_SIDE_EFFECTS__` (or block-comment equivalent) line comment between
32
+ * the JSDoc and the declaration. Auto-fix migrates the annotation into the JSDoc
33
+ * (last tag before the closing) and removes the standalone comment, since the
34
+ * JSDoc form is the workspace's preferred placement.
35
+ *
36
+ * Unlike `require-no-side-effects`, this rule does not require the function to
37
+ * be tagged as a factory — it triggers purely on the presence of an existing
38
+ * line-comment annotation alongside a JSDoc, so it can sweep all 688 historical
39
+ * annotations through `eslint --fix`.
40
+ */
41
+ export declare const utilPreferNoSideEffectsInJsdocRule: UtilPreferNoSideEffectsInJsdocRuleDefinition;
42
+ export {};
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Options for the require-no-side-effects rule.
3
+ */
4
+ export interface UtilRequireNoSideEffectsRuleOptions {
5
+ /**
6
+ * When true, also flag functions whose names match the factory naming patterns
7
+ * in addition to JSDoc-tag detection.
8
+ */
9
+ readonly checkNamePatterns?: boolean;
10
+ /**
11
+ * Additional name pattern source strings (compiled to RegExp) when `checkNamePatterns` is true.
12
+ */
13
+ readonly additionalNamePatterns?: readonly string[];
14
+ }
15
+ type AstNode = any;
16
+ /**
17
+ * ESLint rule definition for require-no-side-effects.
18
+ */
19
+ export interface UtilRequireNoSideEffectsRuleDefinition {
20
+ readonly meta: {
21
+ readonly type: 'suggestion';
22
+ readonly fixable: 'code';
23
+ readonly docs: {
24
+ readonly description: string;
25
+ readonly recommended: boolean;
26
+ };
27
+ readonly messages: {
28
+ readonly missingNoSideEffectsJsdoc: string;
29
+ readonly missingJsdocForFactory: string;
30
+ };
31
+ readonly schema: readonly object[];
32
+ };
33
+ create(context: {
34
+ options: UtilRequireNoSideEffectsRuleOptions[];
35
+ report: (descriptor: {
36
+ node: AstNode;
37
+ messageId: string;
38
+ data?: Record<string, string>;
39
+ fix?: (fixer: AstNode) => AstNode | AstNode[];
40
+ }) => void;
41
+ sourceCode: AstNode;
42
+ }): Record<string, (node: AstNode) => void>;
43
+ }
44
+ /**
45
+ * ESLint rule requiring the side-effect-free annotation inside the JSDoc of every
46
+ * factory function — that is, declarations carrying the dbxUtilKind factory JSDoc tag,
47
+ * and optionally functions matching factory name patterns.
48
+ *
49
+ * Auto-fix inserts the annotation as the last line of the JSDoc, removes any
50
+ * redundant standalone-comment annotation between the JSDoc and the declaration,
51
+ * and (when matched by name with no JSDoc) creates a minimal JSDoc carrying both tags.
52
+ */
53
+ export declare const utilRequireNoSideEffectsRule: UtilRequireNoSideEffectsRuleDefinition;
54
+ export {};
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@dereekb/util/fetch",
3
- "version": "13.11.1",
3
+ "version": "13.11.3",
4
4
  "peerDependencies": {
5
- "@dereekb/util": "13.11.1",
5
+ "@dereekb/util": "13.11.3",
6
6
  "make-error": "^1.3.6",
7
7
  "fast-content-type-parse": "^3.0.0"
8
8
  },