@dereekb/util 13.11.2 → 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.
- package/eslint/index.cjs.default.js +1 -0
- package/eslint/index.cjs.js +607 -0
- package/eslint/index.cjs.mjs +2 -0
- package/eslint/index.d.ts +1 -0
- package/eslint/index.esm.js +603 -0
- package/eslint/package.json +23 -0
- package/eslint/src/index.d.ts +1 -0
- package/eslint/src/lib/comments.d.ts +54 -0
- package/eslint/src/lib/index.d.ts +3 -0
- package/eslint/src/lib/plugin.d.ts +18 -0
- package/eslint/src/lib/prefer-no-side-effects-in-jsdoc.rule.d.ts +42 -0
- package/eslint/src/lib/require-no-side-effects.rule.d.ts +54 -0
- package/fetch/package.json +2 -2
- package/index.cjs.js +1203 -23
- package/index.esm.js +1203 -23
- package/package.json +7 -1
- package/src/lib/array/array.factory.d.ts +2 -0
- package/src/lib/array/array.filter.d.ts +50 -17
- package/src/lib/array/array.find.d.ts +1 -0
- package/src/lib/array/array.index.d.ts +7 -0
- package/src/lib/array/array.indexed.d.ts +21 -0
- package/src/lib/array/array.make.d.ts +7 -0
- package/src/lib/array/array.random.d.ts +1 -0
- package/src/lib/array/array.unique.d.ts +3 -0
- package/src/lib/array/array.value.d.ts +7 -0
- package/src/lib/auth/auth.role.claims.d.ts +7 -0
- package/src/lib/boolean.d.ts +1 -0
- package/src/lib/contact/random.d.ts +14 -0
- package/src/lib/date/date.d.ts +6 -0
- package/src/lib/date/time.d.ts +7 -0
- package/src/lib/date/week.d.ts +7 -0
- package/src/lib/error/error.d.ts +7 -0
- package/src/lib/filter/filter.d.ts +7 -0
- package/src/lib/function/function.boolean.d.ts +7 -0
- package/src/lib/function/function.forward.d.ts +14 -0
- package/src/lib/getter/getter.cache.d.ts +7 -0
- package/src/lib/getter/getter.d.ts +34 -0
- package/src/lib/getter/getter.map.d.ts +7 -0
- package/src/lib/getter/getter.util.d.ts +7 -0
- package/src/lib/grouping.d.ts +8 -0
- package/src/lib/hash.d.ts +1 -0
- package/src/lib/key.d.ts +16 -0
- package/src/lib/map/map.key.d.ts +14 -0
- package/src/lib/model/id.batch.d.ts +7 -0
- package/src/lib/model/id.factory.d.ts +7 -0
- package/src/lib/model/model.conversion.d.ts +35 -0
- package/src/lib/model/model.copy.d.ts +7 -0
- package/src/lib/model/model.d.ts +19 -0
- package/src/lib/model/model.modify.d.ts +14 -0
- package/src/lib/nodejs/stream.d.ts +7 -0
- package/src/lib/number/bound.d.ts +3 -0
- package/src/lib/number/dollar.d.ts +7 -0
- package/src/lib/number/factory.d.ts +7 -0
- package/src/lib/number/random.d.ts +1 -0
- package/src/lib/number/round.d.ts +22 -0
- package/src/lib/number/sort.d.ts +7 -0
- package/src/lib/number/transform.d.ts +7 -0
- package/src/lib/object/object.array.delta.d.ts +7 -0
- package/src/lib/object/object.equal.d.ts +7 -0
- package/src/lib/object/object.filter.pojo.d.ts +87 -0
- package/src/lib/object/object.filter.tuple.d.ts +16 -0
- package/src/lib/object/object.key.d.ts +14 -0
- package/src/lib/object/object.map.d.ts +14 -0
- package/src/lib/path/path.d.ts +9 -0
- package/src/lib/promise/promise.d.ts +21 -0
- package/src/lib/promise/promise.factory.d.ts +7 -0
- package/src/lib/promise/promise.task.d.ts +7 -0
- package/src/lib/service/handler.config.d.ts +28 -0
- package/src/lib/service/handler.d.ts +14 -0
- package/src/lib/set/set.d.ts +21 -0
- package/src/lib/set/set.decision.d.ts +7 -0
- package/src/lib/set/set.delta.d.ts +7 -0
- package/src/lib/set/set.selection.d.ts +7 -0
- package/src/lib/sort.d.ts +8 -0
- package/src/lib/string/char.d.ts +7 -0
- package/src/lib/string/dencoder.d.ts +35 -0
- package/src/lib/string/factory.d.ts +22 -1
- package/src/lib/string/replace.d.ts +78 -0
- package/src/lib/string/search.d.ts +7 -0
- package/src/lib/string/sort.d.ts +7 -0
- package/src/lib/string/string.d.ts +1 -0
- package/src/lib/string/transform.d.ts +53 -0
- package/src/lib/string/tree.d.ts +7 -0
- package/src/lib/string/url.d.ts +7 -0
- package/src/lib/tree/tree.array.d.ts +1 -0
- package/src/lib/tree/tree.explore.d.ts +3 -0
- package/src/lib/type.d.ts +3 -2
- package/src/lib/value/bound.d.ts +28 -0
- package/src/lib/value/comparator.d.ts +16 -0
- package/src/lib/value/decision.d.ts +5 -0
- package/src/lib/value/equal.d.ts +2 -0
- package/src/lib/value/indexed.d.ts +127 -0
- package/src/lib/value/map.d.ts +22 -0
- package/src/lib/value/maybe.type.d.ts +2 -2
- package/src/lib/value/modifier.d.ts +13 -0
- package/src/lib/value/point.d.ts +56 -0
- package/src/lib/value/use.d.ts +37 -0
- package/src/lib/value/vector.d.ts +7 -0
- package/test/index.cjs.js +17 -4
- package/test/index.esm.js +17 -4
- package/test/package.json +2 -2
- 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 {};
|
package/fetch/package.json
CHANGED