wikimedia/mediawiki-extensions-Wikibase

View on GitHub
client/data-bridge/src/change-op/statement-mutation/statementMutationFactory.ts

Summary

Maintainability
A
0 mins
Test Coverage
import EditDecision from '@/definitions/EditDecision';
import StatementMutationStrategy from './strategies/StatementMutationStrategy';
import ReplaceMutationStrategy from './strategies/ReplaceMutationStrategy';
import UpdateMutationStrategy from '@/change-op/statement-mutation/strategies/UpdateMutationStrategy';

export default function statementMutationFactory( strategy: EditDecision ): StatementMutationStrategy {
    switch ( strategy ) {
        case EditDecision.REPLACE:
            return new ReplaceMutationStrategy();
        case EditDecision.UPDATE:
            return new UpdateMutationStrategy();
    }
}