mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
refactor: remove dead code (#3337)
This commit is contained in:
1 parent
a19002652b
commit
93d1f8af46
1527 files changed
+21170
-73846
No files matched your search
@@ -1,16 +1,11 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {LimitKey} from '@fluxer/constants/src/LimitConfigMetadata';
|
||||
import type {ILimitConfigCodec} from '@fluxer/limits/src/ILimitConfigCodec';
|
||||
import {LimitConfigCodec} from '@fluxer/limits/src/LimitConfigCodec';
|
||||
import type {LimitConfigSnapshot, LimitConfigWireFormat} from '@fluxer/limits/src/LimitTypes';
|
||||
|
||||
const defaultLimitConfigCodec = new LimitConfigCodec();
|
||||
|
||||
export function createLimitConfigCodec(): ILimitConfigCodec {
|
||||
return new LimitConfigCodec();
|
||||
}
|
||||
|
||||
export function computeOverrides(
|
||||
fullLimits: Partial<Record<LimitKey, number>>,
|
||||
defaults: Record<LimitKey, number>,
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {ruleMatches as evaluateRuleMatch} from '@fluxer/limits/src/LimitRuleRuntime';
|
||||
import type {LimitFilter, LimitMatchContext} from '@fluxer/limits/src/LimitTypes';
|
||||
|
||||
export function ruleMatches(filters: LimitFilter | undefined, ctx: LimitMatchContext): boolean {
|
||||
return evaluateRuleMatch(filters, ctx);
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {LimitKey} from '@fluxer/constants/src/LimitConfigMetadata';
|
||||
import {applyRuleToResolvedLimits} from '@fluxer/limits/src/LimitRuleRuntime';
|
||||
import type {EvaluationContext, LimitRule} from '@fluxer/limits/src/LimitTypes';
|
||||
|
||||
export function mergeRuleIntoResolved(
|
||||
resolved: Record<LimitKey, number>,
|
||||
rule: LimitRule,
|
||||
evaluationContext: EvaluationContext,
|
||||
): void {
|
||||
applyRuleToResolvedLimits(resolved, rule, evaluationContext);
|
||||
}
|
||||
@@ -74,10 +74,6 @@ export function calculateSpecificity(filters: LimitFilter | undefined): number {
|
||||
return traitCount + guildFeatureCount;
|
||||
}
|
||||
|
||||
export function compareSpecificity(a: LimitFilter | undefined, b: LimitFilter | undefined): number {
|
||||
return calculateSpecificity(a) - calculateSpecificity(b);
|
||||
}
|
||||
|
||||
export function sortRulesBySpecificity(rules: Array<LimitRule>): Array<LimitRule> {
|
||||
const rankedRules: Array<RankedRule> = rules.map((rule, index) => ({
|
||||
rule,
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {
|
||||
calculateSpecificity as calculateRuntimeSpecificity,
|
||||
compareSpecificity as compareRuntimeSpecificity,
|
||||
} from '@fluxer/limits/src/LimitRuleRuntime';
|
||||
import type {LimitFilter} from '@fluxer/limits/src/LimitTypes';
|
||||
|
||||
export function calculateSpecificity(filters: LimitFilter | undefined): number {
|
||||
return calculateRuntimeSpecificity(filters);
|
||||
}
|
||||
|
||||
export function compareSpecificity(a: LimitFilter | undefined, b: LimitFilter | undefined): number {
|
||||
return compareRuntimeSpecificity(a, b);
|
||||
}
|
||||
Reference in new issue
Block a user