-
Notifications
You must be signed in to change notification settings - Fork 0
uppercase
awekrx edited this page May 29, 2026
·
1 revision
import { uppercase } from '@dev-suite/decorators/uppercase'
parameter
Normalize string argument to uppercase.
- Inline
.toUpperCase()blocks - Repeated formatting helpers
class RegionService {
set(region: string) {
return this.repo.set(region.toUpperCase());
}
}import { uppercase } from '@dev-suite/decorators/uppercase';
class RegionService {
set(@uppercase() region: string) {
return this.repo.set(region);
}
}- Centralizes cross-cutting behavior.
- Method/class/property code stays focused on domain logic.
class CurrencyService {
select(code: string) {
return this.fx.select(code.toUpperCase());
}
}import { uppercase } from '@dev-suite/decorators/uppercase';
class CurrencyService {
select(@uppercase() code: string) {
return this.fx.select(code);
}
}- Second scenario reuses same policy without duplication.
- Behavior is more consistent and easier to audit.