Conversation
…t currency to USD - Change formatCurrency default currency from EUR to USD across all platforms (TypeScript, Kotlin, Dart) - Add validation to throw on NaN/Infinity amounts in formatCurrency (RangeError in TypeScript, IllegalArgumentException in Kotlin, ArgumentError in Dart) - Update all version references from 0.3.0-alpha to 0.3.1-alpha.0 across README, docs, package files, and SECURITY.md - Update formatCurrency examples
- Add clamp(value, min, max) function to TypeScript, Kotlin, and Dart implementations - Validate all arguments are finite numbers and min ≤ max, throwing on invalid input - Add comprehensive unit tests for clamp across all platforms (normal range, edge cases, NaN/Infinity validation) - Update documentation: README feature list, ARCHITECTURE.md API contract, platform guides (web.md, android.md, flutter.md), getting-started.md, and recipes.md
… and error handling
…amp and throttle examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new cross-platform utilities (
clampandthrottle) to KompKit Core0.4.0-alpha.0, and fixesformatCurrencydefault currency fromEURtoUSDacross all platforms. All utilities maintain full API parity across Web (TypeScript), Android (Kotlin), and Flutter (Dart) with comprehensive unit tests, full documentation updates, and consistent error handling.clamp— constrain a number within an inclusive[min, max]range. Pure, synchronous, no dependencies.throttle— limit a function to execute at most once per wait period. Fires immediately on first call, ignores subsequent calls during the cooldown. Returns aThrottled<T>object withcancel(), mirroring the existingDebounced<T>shape. Kotlin requires aCoroutineScope(same pattern asdebounce); Dart usesDurationinstead of bare milliseconds.formatCurrencydefault — changed fromEURtoUSDto align with theen-USdefault locale. Breaking change at alpha; documented in CHANGELOG.Type of Change
Platforms Affected
Checklist
npm run test:web && npm run build:web)cd packages/core/android && ./gradlew test)cd packages/core/flutter && flutter test)Test counts: