swiss_knife 3.4.2
swiss_knife: ^3.4.2 copied to clipboard
Dart Useful Tools - collections, math, date, uri, json, events, resources, regexp, etc...
3.4.2 #
Fixes the 28 behaviours the 3.4.1 tests pinned as "possibly a bug". Changes of visible output are marked (output change).
Geolocation:formatLatitude/formatLongitude(andformatGeolocation/toString) (output change): latitude usesN/Sand longitudeE/W(they were swapped), and a negative value is shown without the minus sign (formatLatitude(-10)is10°S, it was-10°W). The output now parses back withfromCoords.parseLatitudeOrLongitudeValue(andfromCoords): a plain number parses fully ('123'was12),,is a decimal separator ('10,5N'is10.5, it threw),+is a sign, and an invalid value returnsnull('=10.5N'threw aFormatException; trailing garbage was ignored): the whole trimmed value must matchgeolocationFormat, whose cardinal is now optional (it required a trailing word char).fromCoordsalso accepts,and;between the values ('10.5N, 20.3E','-23,5;-46,6').
MimeType.parse:mp3,audio/mp3andaudio/mpegreturnaudio/mpeg(=MimeType.mp3); they returned the non-standardaudio/mp3(output change).byExtension('mp3')too.- The
jpeg/jpgandtext/txtaliases keep the charset ('image/jpeg; charset=utf-8'dropped it) (output change). - A MIME type without a type before the
/('/foo') is invalid: returns thedefaultMimeTypeornull(it returnedapplication//foo).
Dimension.subtract(other, [maximumDifferences])(output change): returns the minimum of the width/height differences by default and the maximum withmaximumDifferences = true, as documented (min and max were swapped). The signature is unchanged (maximumDifferencesis still positional).getPathWithoutFileName('file.txt'): returns''(no directory part) (output change); it returned the file name.- JSON:
isEncodedJSONNumber(andisEncodedJSON/isEncodedJSONPrimitive): only valid JSON numbers are accepted (output change):NaN,Infinity,0x1F,+1,.5,1.and01returnfalse(they returnedtrue).parseJSON: a blank string of any length returnsdef(a blank string of 100+ chars threw aFormatException).toEncodableJSONMap: aMap<String, dynamic>/Map<String, Object>with homogeneous values returns a typed copy (Map<String, int>,Map<String, double>,Map<String, num>,Map<String, bool>,Map<String, String>); it returned aMap<dynamic, dynamic>(type change: adding a value of another type to the result now throws). Mixedint/doublevalues (maps and lists) are now detected asnum(that branch was dead).
deepCopy:- Typed maps (
Map<String, int>,<String, Object>{}, ...) keep their types and no longer throw aTypeError(they were rebuilt asMap<dynamic, dynamic>and then cast). This also fixesParameter*.copy()with typed maps. Limit: Dart can't create a map with another map's type arguments, so the copy reproduces keys of typeString,int,Objectordynamicand values of the common JSON-like types; a map with other types is copied with a wider type when that satisfies the requested type, otherwise the original instance is returned (shared, not copied) instead of throwing. Nested in a typed list, such a map is kept as is. - A typed-data list (
Uint8List, ...) is copied with its class (it threw aTypeErrorfor aUint8ListT). deepCopyListacceptsnullelements (it threw).
- Typed maps (
CachedComputation:- Keys are compared deeply (with a collision-resistant deep hash), so
List/Mapinputs hit the cache (with the default key generator aListinput was never found and the cache grew on every call). nullresults are cached (they were recomputed every time).
- Keys are compared deeply (with a collision-resistant deep hash), so
Parameter/Parameters2/Parameters3/Parameters4:==is symmetric and consistent withhashCode: parameters of different arities are never equal (Parameter(1) == Parameters2(1, 2)wastrue, the reversefalse).isListOfListValuesAllEqualswithouteqValueIndex: compares every value of every sub-list, as documented (it always returnedfalse, and threw aStateErrorwhen all the sub-lists were empty).EventStream.listenOneShot: honourssingletonIdentifier/singletonIdentifyByInstancelikelisten(they were ignored) (behaviour change): while a listener with the same identifier is registered, it returnsnulland doesn't register a new one. The singleton is released after the one shot.ListenerWrapper.cancel: also unregisters its singleton subscription (also through anEventStreamDelegator), so a new listener with the same identifier can be registered (the identifier stayed bound to a cancelled subscription).EventStreamDelegator.listenwhile buffering: returns a single subscription, bound to the one registered on flush (events are delivered once;pause/resume/cancel/handlers act on it, including calls made before the flush). It was a lazy proxy that calledlistenagain on first use (duplicated events;canceldidn't cancel the flushed listener). Cancelling it before the flush drops the buffered listener;clearUnflusheddrops them too.AsyncValue.from: a function declared with another return type (dynamic,Object,FutureOr<T>) or aFuture<dynamic>holding aTworks (that branch always threw aTypeError); a result that isn't aTcompletes thefuturewith theTypeError(seeerror) instead of throwing from the constructor.ResourceContentCache.contains: a pure check (it inserted the resource when absent, so it was alwaystrue).ResourceContentCache.get: content transferred into a cached instance marks it as loaded (isLoaded,getContentIfLoaded).ContextualResource.compareContext: compares the contexts (it returned-1for any non-null context).ContextualResourceResolver.resolve: returns the exact match or the next greater context, and the greatest option for a context greater than all (it threw aRangeError, even for an exact match without acontextComparator). With acontextComparator, options are sorted with it andnullcontexts no longer throw.DualWeakMap.purge: also drops the reverse entry of a live value whose key was collected.RegExpDialect.withParameters: the copy keeps the compilation errors (hasErrors,errorWords, and theStateErrorfromgetWordPattern); it reported none and failed with a rawFormatException.LazyWeakReferenceManager: any positiveweakenDelayis kept (a 1 ms delay became the 1 s default); zero or negative uses the default.LoadController: generated ids are sequential (they skipped a number), andload()no longer prints the controller (debug leftover).- Tests: every pinning test now asserts the fixed behaviour, with regression tests.
3.4.1 #
Math.ceil,Math.floor,Math.round: fixed negative non-integer values (they truncated toward zero:ceil(-2.3)was-1,floor(-2.3)was-2,round(-2.7)was-2). Ties still round toward positive infinity.parsePercent: honour thedefparameter (it was ignored).maxInIterable: fixed iterables with only negative values (it returned0).TreeReferenceMap.getParentValue: forwardincludePurgedEntriestogetParentKey.FlatHashMap:- Fixed keys with a negative (or wider than 32-bit)
hashCode, such as negativeintkeys: they could not be found, replaced or removed, and re-putting them added duplicates. containsValue(null)returnsfalse(it wastrue, even for an empty map).
- Fixed keys with a negative (or wider than 32-bit)
WeakKeyMap/DualWeakMap(and the lazy variants): overwriting a key now replaces the stored entry, sokeys/values/entries/containsValuesee the new value and the dual map drops the previous value's reverse mapping. The overwritten key moves to the end of the iteration order.decodeQueryString: split each pair on the first=only ('a=b=c'decoded to{'a': 'b'}).Parameters2/Parameters3/Parameters4:hashCodenow includes all fields (the extra fields cancelled out).MimeType.parse('xhtml')(andapplication/xhtml+xml): returnsapplication/xhtml+xmlwith its charset (it returnedapplication/xhtml, soisXHTMLwasfalse).MimeType.fileExtensionforvideo/mpeg:mpg(it wasmp3g).EventStreamDelegator.listenOneShot:cancelOnErrordefaults tofalse(it threw aTypeErrorwhen omitted, including when flushing a buffered call).ResourceContent.fromURI(null, content): creates a content-only instance (it created aResource('null')).ResourceContentCache: content-onlyResourceContentinstances can be cached (it threw aTypeError).- Tests:
- New unit tests for math, regexp, uri, loader, data, json, utils, string, collections, events, resources,
weak maps, lazy weak references,
FlatHashMapandExpandoWithFinalizer. - New integration tests (JSON → paging → collections, events, resources from real temp files).
- Coverage: 71% -> 99%.
- New unit tests for math, regexp, uri, loader, data, json, utils, string, collections, events, resources,
weak maps, lazy weak references,
3.4.0 #
-
AsyncValue:- Fixed the
onErrorhandler ofFuture.thenreturningvoid: a non-nullableTnow fails with the original error (it was replaced by anArgumentError); a nullableTstill completes withnull. - Fixed a null-check error when a nullable future completed with
null. - Fixed
dispose(it always threw, reassigning alate finalfield).
- Fixed the
-
MapDelegate.update: passifAbsentto the delegated map (it was ignored). -
MapProperties.parseValue: parse a list of doubles asList<double>(it was parsed as bools). -
findKeyPathValue: honourkeyDelimiter(it always split by/). -
listContainsType: fixed aTypeErrorwith typed lists. -
deepCopy: typed lists (e.g.List<int>) keep their type (it threw aTypeError). -
parseNumsFromInlineList,parseDoublesFromInlineList,parseBoolsFromInlineList,parseDateTimeFromInlineList: fixed aTypeError(invalid casts) when parsing lists and strings. -
getDateTimeStartOf/getDateTimeEndOfwithUnit.quarters: return the real quarter start/end (January quarter started in the previous December, and the end was the end of the quarter's first month). -
dateFormat_YYYY_MM_dd_HH: usedelimiterbetween month and day too. -
ColossusPaging.matches/SpringBootPaging.matches: returnfalsefor non-Mapvalues (they threw), soJSONPaging.fromworks with any value. -
SpringBootPaging.pagingRequestURL: fixed anUnsupportedError(modifying unmodifiable query parameters). -
InteractionCompleter.interact:noTriggeringis now typedbool?. -
WeakKeyMap:autoPurgeuses an initializing formal (same public parameter name). -
Fixed new lints (
strict_top_level_inference,unnecessary_underscores,prefer_initializing_formals). -
dart formatwith the new (tall) style. -
Tests:
swiss_knife_flat_hash_map.dartrenamed toswiss_knife_flat_hash_map_test.dart(it was not being run).- New tests for paging, events, date and collections (coverage: 44% -> 71%).
-
GitHub Actions:
actions/checkout@v7,codecov/codecov-action@v7. -
sdk: ^3.13.0
-
intl: ^0.20.3
-
resource_portable: ^3.1.4
-
lints: ^6.1.0
-
test: ^1.33.0
-
dependency_validator: ^5.1.0
-
coverage: ^1.16.0
3.3.14 #
-
TreeReferenceMap:- Replaced
_purgedfield type fromDualLazyWeakMaptoMap<K, _PurgedValue<V>>. - Updated purged entries handling to store
(value, time)records instead ofMapEntry<DateTime, V>. - Improved purged entries timeout checking and scheduling with delayed future.
- Replaced
-
LazyWeakReference:- Added
strongIfWeak({bool keepWeakRef = true})method to promote a weak reference to strong if possible.
- Added
-
weak_map.dart:- Modified
_Entryequality to support comparison with raw keys using identity. - Updated
_EntryKeyequality to use identity comparison and consistent hash code checks. - Changed
_EntryLazyRefand_EntryLazyRefValueto usestrongIfWeak()for key and value retrieval. - Made
_keyLazyRefManagerand_valueLazyRefManagernon-nullable inLazyWeakKeyMapandDualLazyWeakMap. - Simplified
_createEntrymethods inLazyWeakKeyMapandDualLazyWeakMapto always create lazy weak entries with non-null managers. - Improved docs for
WeakKeyMap,DualWeakMap.- Added doc to
LazyWeakKeyMap,DualLazyWeakMap
- Added doc to
- Modified
3.3.13 #
-
TreeReferenceMap:- Replaced
_purgedfield type fromDualWeakMaptoDualLazyWeakMap. - Use global
LazyWeakReferenceManagerByTypeto createDualLazyWeakMapinstances for purged entries.
- Replaced
-
ExpandoWithFinalizer:- Refactored to extend generic
WithFinalizerbase class. - Introduced strongly typed
FinalizerValueWrapperabstraction and concrete implementations:SimpleFinalizerWrapper,SimpleFinalizerWrapperDebugExpandoValueWrapper,ExpandoValueWrapperDebug
- Added
AttachOnlyFinalizerclass for write-only finalizer usage. - Added
debugmode to retain weak references to keys for inspection. - Improved finalizer attach/detach logic and wrapper management.
- Refactored to extend generic
-
lazy_weak_reference.dart:- Added
GenericReferenceinterface for strong/weak reference abstraction. - Added
LazyWeakReferenceManagerByTypesingleton managing per-typeLazyWeakReferenceManagerinstances. - Added
toStringandcompareToimprovements toLazyWeakReference. - Added
LazyWeakReferenceManagerByTypeclass for centralized management. - Added
toStringoverride toLazyWeakReferenceManager.
- Added
-
weak_map.dart:- Refactored internal entry classes to support lazy weak references:
- Added
_EntryLazyRef,_EntryLazyRef1,_EntryLazyRef2,_EntryLazyRefValue.
- Added
WeakKeyMap: include _autoPurge in isAutoPurgeRequired and centralize auto-purge check.- Added
LazyWeakKeyMapsubclass using lazy weak references for keys. - Added
DualLazyWeakMapsubclass using lazy weak references for keys and values. - Added factory constructors
WeakKeyMap.configuredandDualWeakMap.configuredto create lazy weak reference variants. - Added
removeWhereKeyextension method onMapandWeakKeyMap. - Updated purge logic to use
removeWhereKey. - Updated
DualWeakMapto optionally use lazy weak references for keys and values.
- Refactored internal entry classes to support lazy weak references:
-
resource.dart:- Changed
ResourceContentCacheto use private_onLoadEventStreaminstead of publiconLoadfield. - Updated
ResourceContentto lazily initialize_onLoadEventStreamand use it internally. - Changed event notification to use
_onLoadEventStream?.addinstead ofonLoad.add.
- Changed
3.3.12 #
-
LazyWeakReference:- Added intrusive doubly-linked list fields
_prevand_nextfor internal queue management. - Simplified
targetandtargetIfStronggetters using null-coalescing.
- Added intrusive doubly-linked list fields
-
LazyWeakReferenceManager:- Replaced
SplayTreeSetwith an intrusive doubly-linked aging queue (_head,_tail) for strong references. - Added
_pushBackand_removemethods for O(1) insertion and removal in the aging queue. - Updated
_handleNewStrongRefand_handleAccessStrongRefto use the intrusive queue. - Updated
_handleNewWeakRefand_handleDisposedRefto remove references from the queue using_remove. - Refactored
_weakenStrongRefsto process references from the queue head and schedule next weakening based on precise delay. - Improved queue management to avoid allocations and maintain ordering by last strong access time.
- Replaced
Performance Improvements #
- Replaced the internal
SplayTreeSetused for aging strong references with an intrusive doubly-linked aging queue. - Benchmark (300k operations, steady set ≈20k items):
| Structure | Avg Time |
|---|---|
| Intrusive aging queue | ~22 ms |
| Queue | ~35 ms |
| WeakRef queue | ~60 ms |
| SplayTreeSet (previous) | ~205 ms |
-
Impact:
- ~9× faster than the previous
SplayTreeSetimplementation - ~35% faster than
Queue - Lower GC pressure and allocation overhead
- Constant-time weaken cycles with stable latency under high churn
- ~9× faster than the previous
3.3.11 #
-
GitHub Actions workflow (
.github/workflows/dart.yml):- Updated
actions/checkoutfrom v2 to v6. - Split test jobs into separate
test_vmandtest_chromejobs for VM and Chrome platforms respectively. - Updated
codecov/codecov-actionfrom v1 to v5. - Added
dart pub publish --dry-runstep to the main build job.
- Updated
-
LazyWeakReference:- Implemented
Comparable<LazyWeakReference>with a strict total order based on_unixTimeMsand uniqueid. - Added
idfield as a unique sequence identifier assigned by the manager. - Exposed
unixTimeMsgetter. - Removed direct
_unixTimeMsupdates fromstrong()method; now managed byLazyWeakReferenceManager. - Updated constructors to accept
idand defer_unixTimeMsassignment to manager.
- Implemented
-
LazyWeakReferenceManager:- Added
_refIdCountto assign uniqueids to references. - Changed internal strong reference queue from
QueuetoSplayTreeSetordered byLazyWeakReference.compareTo. - Updated
_handleNewStrongRefand_handleAccessStrongRefto update_unixTimeMsand maintain ordering in_strongRefs. - Updated
_handleNewWeakRefand_handleDisposedRefto remove references from_strongRefs. - Updated
_weakenStrongRefsto process references from_strongRefsin order, removing the oldest eligible references first. - Improved scheduling logic to debounce weakening with precise timing based on reference age.
- Added
3.3.10 #
-
Added
LazyWeakReference<T>:- Holds a reference that starts strong and automatically degrades to weak after a delay.
- Provides
target,targetIfStrong,isStrong,isWeak,isAlive,isLost,isDisposedproperties. - Supports promotion to strong via
strong()and weakening viaweak(). - Manages lifecycle with a
LazyWeakReferenceManager. - Implements disposal and elapsed time tracking.
-
Added
LazyWeakReferenceManager<T>:- Controls automatic weakening of strong references after a configurable delay.
- Supports batching with configurable batch size and interval to avoid blocking.
- Manages queues of strong references and schedules weakening tasks.
- Provides
strong()andweak()factory methods to create managed references.
-
Updated
lib/swiss_knife.dart:- Exported
src/lazy_weak_reference.dart.
- Exported
3.3.9 #
TreeReferenceMap:- Rollback: avoid
WeakReferenceissues with WASM on Android/Chrome:- Replaced internal
_mapfromWeakKeyMap<K, V>to standardMap<K, V>. - Updated all
_mapmethod calls fromcontainsKeyNoPurgeto standardcontainsKey. - Adjusted
put,get,addAll,containsKey, andcontainsValuemethods to work with the new_maptype. - Removed usage of weak key map features and related purging logic tied to it.
- Replaced internal
- Rollback: avoid
3.3.8 #
-
Added new
DualMap<K, V>class inlib/src/dual_map.dart:- Bidirectional map maintaining two internal maps for O(1) lookup in both directions.
- Supports insertion, removal, clear, and lookup by key or value.
- Implements
MapBase<K, V>interface. - Methods:
put(K key, V value): associates value with key, replacing existing mappings.get(Object? key): returns value for key.getKeyFromValue(V value): returns key for value.putIfAbsent(K key, V Function() ifAbsent): inserts if key absent.putValueIfAbsent(K key, V value): inserts value if key absent, returns bool.remove(Object? key): removes key and reverse mapping.clear(): clears all mappings.
- Properties:
keys,values,entriesprovide iterable views.
-
Updated
lib/swiss_knife.dart:- Exported new
src/dual_map.dart.
- Exported new
3.3.7 #
WeakKeyMap:putValueIfAbsent: updated to call_onPutEntryand increment_unpurgedCountwhen a new entry is inserted.
3.3.6 #
-
TreeReferenceMap:getParentKey: fixed handling of purged entries by using_map.containsKeyNoPurgeand nullable_purged.containsKey: changed to use_map.containsKeyNoPurgeto avoid purging during lookup.
-
New
ExpandoWithFinalizer. -
WeakKeyMapandDualWeakMap:- Added
containsKeyNoPurgeandcontainsValueNoPurgemethods to check presence without purging collected entries. - Added
getNoPurgemethod to get value without purging. - Added
putValueIfAbsentmethod to insert a value only if absent. - Improved equality and hashCode implementations in
_EntryKeyfor consistent behavior. - Updated
containsValueinDualWeakMapto properly check presence with purging logic.
- Added
-
swiss_knife.dart:- Exported
ExpandoWithFinalizerfrom the public API.
- Exported
3.3.5 #
-
EventStream:- Changed
_controllerfield to nullable_controllerObjand lazily initialized it. - Changed
_streamfield to nullable_streamObjand lazily initialized it as a broadcast stream. - Updated
addandaddErrormethods to checkisUsed(based on_streamObjpresence) before adding events. - Updated
close,isClosed, andisPausedto handle nullable_controllerObj. - Added
isUsedgetter to indicate if the stream has been used (initialized).
- Changed
-
New
FlatHashMap:- Flat, index-based hash map with contiguous storage, free-list reuse, and adaptive unsigned chain pointers for reduced memory and improved cache locality.
-
pubspec.yaml:- Updated
dependency_validatorversion from^5.0.3to^5.0.4.
- Updated
3.3.4 #
-
Added
WeakKeyMapandDualWeakMapclasses inweak_map.dart:- Implemented weakly-referenced keys map with auto-purge support.
- Added dual weak map with weakly-referenced keys and values.
- Added
SwappedDualWeakMapview for key-value swapped access. - Improved internal entry handling with
_EntryRefclasses. - Added iterable and iterator implementations for weak maps.
-
Updated
TreeReferenceMapincollections.dart:- Replaced internal map with
WeakKeyMapfor weak key references. - Added
autoPurgeThresholdfield and logic to control auto-purge frequency. - Added
onPurgedEntriescallback for purged entries notification. - Changed purged entries storage to use
DualWeakMap. - Improved purge logic to batch purged entries and notify via callback.
- Optimized auto-purge to trigger only after threshold of unpurged operations.
- Added
keysReversedgetter returning reversed keys list. - Improved cache expiration and purged entries revalidation logic.
- Replaced internal map with
-
Updated
EventStreaminevents.dart:- Changed
_listenSignaturesfrom non-nullable to nullableSet. - Added null checks and lazy initialization for
_listenSignatures. - Improved singleton subscription management to handle null safely.
- Changed
-
Updated
swiss_knife.dart:- Exported new
weak_map.dart.
- Exported new
-
Updated
pubspec.yaml:- Bumped
testdependency to ^1.29.0. - Bumped
dependency_validatorto ^5.0.3.
- Bumped
3.3.3 #
TreeReferenceMap:getSubValues: added parametertraverseSubValues.
3.3.2 #
TreeReferenceMap:- Optimize
getSubValuesImpland_walkTreeImplto avoid self-recursion and use a stack-based algorithm.
- Optimize
3.3.1 #
-
MimeType:- Fix parsing for
XML: change result fromtext/xmltoapplication/xml(oficial).
- Fix parsing for
-
test: ^1.26.2
-
dependency_validator: ^5.0.2
-
collection: ^1.19.1
-
coverage: ^1.15.0
3.3.0 #
-
sdk: '>=3.6.0 <4.0.0'
-
intl: ^0.20.2
-
resource_portable: ^3.1.2
-
lints: ^5.1.1
-
test: ^1.25.15
-
collection: ^1.19.0
3.2.3 #
-
Optimize
toFlatListOfStrings. -
Added
trimListOfStrings. -
sdk: '>=3.4.0 <4.0.0'
-
lints: ^4.0.0
-
test: ^1.25.14
-
dependency_validator: ^4.1.2
-
coverage: ^1.11.1
3.2.2 #
MimeType:- Added
isYAML,isFont,isPDF,isDart,isOctetStream, - Added
isZip,isGZip,isBZip2,isXZ,isCompressed. - Added
isTar,isTarGZip,isTarBZip2,isTarXZ,isTarCompressed.
3.2.1 #
-
MimeType:- Added
applicationOctetStreamandbytes.
- Added
-
test: ^1.25.8
-
coverage: ^1.9.0
3.2.0 #
-
sdk: '>=3.3.0 <4.0.0'
-
intl: ^0.19.0
-
lints: ^3.0.0
-
test: ^1.25.2
-
dependency_validator: ^3.2.3
-
collection: ^1.18.0
-
coverage: ^1.7.2
3.1.6 #
-
MimeType: fix charset for
text/htmltype. -
sdk: '>=2.18.0 <4.0.0'
-
intl: ^0.18.1
-
resource_portable: ^3.1.0
3.1.5 #
MimeType:parse: optimize and update recognized types.byExtension: add more extensions.
- Added
getCharsetEncoding.
3.1.4 #
EventStream:listen: new parameteroverwriteSingletonSubscription.cancelSingletonSubscription: now ensures that the previous subscription is removed from internal handler.
- coverage: ^1.6.3
3.1.3 #
- Code adjustments for
lints: ^2.0.1. - intl: ^0.18.0
- resource_portable: ^3.0.1
- lints: ^2.0.1
- test: ^1.22.1
3.1.2 #
DataURLBase64:- Added constructor
DataURLBase64.from. - Improved Null Safety code.
- Added constructor
- Fix typo.
- test: ^1.17.12
- dependency_validator: ^3.2.2
- collection: ^1.17.0
- coverage: ^1.6.1
3.1.1 #
parseBool:- Improve possible valid values.
3.1.0 #
- Migrate to
lints:- NOTE: some constants were renamed to lowercase camel case.
- Improved GitHub CI.
- Added browser tests.
- lints: ^1.0.1
- coverage: ^1.0.4
3.0.8 #
- Fixed
ResourceContentload with errors. - Test coverage.
- Added FOSSA Status.
3.0.7 #
- Added
Math.clamp. - Fixed
formatDecimalfor scientific notation.
3.0.6 #
- Added
UniqueCallerandparseIntList. - Null safety migration adjustments.
3.0.5 #
- Null safety migration adjustments.
3.0.4 #
collections: improve Null Safety usage.
3.0.3 #
- Null safety migration adjustments.
3.0.2 #
- Null safety migration adjustments.
3.0.1 #
- Null safety migration adjustments.
3.0.0 #
- Dart 2.12.0:
- Sound null safety compatibility.
- Update CI dart commands.
- sdk: '>=2.12.0 <3.0.0'
- intl: ^0.17.0
- resource_portable: ^3.0.0
- collection: ^1.15.0
- pedantic: ^1.11.0
- test: ^1.16.5
2.5.26 #
- Optimize:
parseInt,parseDoubleandparseNum. - Fix:
listNotMatchesAllandlistMatchesAnywhen leading with lists withnullelements. - Dart 2.12.0+ compliant:
dartfmtanddartanalyzer.
2.5.25 #
TreeReferenceMap: ensure thatrootis not null.EventStream: AddedlistenOneShot.
2.5.24 #
TreeReferenceMap:- fix
getParentKey.
- fix
2.5.23 #
- Added
TreeReferenceMap: an alternative to Weak References (nonexistent in Dart).
2.5.22 #
MimeType.byExtension: Added parameterdefaultAsApplication.
2.5.21 #
MimeType: AddedhtmlTagandisAudio.- Added
unquoteString.
2.5.20 #
- Added
ObjectCache. - Added
Dimension. - Added
ContextualResourceandContextualResourceResolver:- Resolves a resource based into a context, like screen dimension.
- Added:
parseFromInlinePropertiesanddateFormat_YYYY_MM. EventStream:- Added
eventValidator.
- Added
Math:minMax,maxInListandminInList: added optionalcomparatorparameter.
2.5.19 #
MimeType: AddedisCharsetUTF16,isText,isXML,isXHTML,isFormURLEncoded,isStringType.dateFormat_YY*: added optional parameterdelimiter.InteractionCompleter: Added fieldtriggerDelayLimit.Math:- Added collection methods:
subtract,multiplyanddivide.
- Added collection methods:
2.5.18 #
- Improve API Documentation.
2.5.17 #
- Added
resolveURL, similar toresolveUri. - Added
replaceStringMarks. buildStringPatternusingreplaceStringMarksand now returns empty string for null parameters.- Added
EventStreamDelegator, to point to instances ofEventStreamnot instantiated yet. - Added
ListenerWrapper, to handleStreamSubscriptionrelated to a listener and useful to create one shot listeners.
2.5.16 #
- New
AsyncValue: to handle values that comes fromFuture. - Added
isEncodedJSON,isEncodedJSONListandisEncodedJSONMap: to check if aStringis an encoded JSON. - ADded
isDigit,isAlphaNumeric,isDigitString,isAlphaNumericString. - Added
listMatchesAny,isListValuesIdentical,listContainsAll,ensureNotEmptyString,deepCatchesValues. MimeType.fileExtension: support forsvg,xhtml,mpeg,mp3,ico.- Changed method signature:
getUriRootURL,getUriBaseHostAndPort,resolveUri.
2.5.15 #
- Added:
isEmptyString,isNotEmptyString,isListEntriesAllOfType. - Added
deepCopyMap. deepCopy: added parametercopier.NNField: Addedresolver.MimeType: added SVG support.InteractionCompleter:interact: Added parametersinteractionParametersandignoreConsecutiveEqualsParameters.- Added
dispose.
encodeJSON: Added parametertoEncodable.- Added:
toEncodableJSON. parseInt,parseDoubleandparseNumnow returns default value (def) in case of parsing error.- isDouble now can parse
.00pattern. - Fix:
dataSizeFormat.
2.5.14 #
MimeType: Added new types.- Added constructor
MimeType.byExtension. MimeType: Fixed parsing ofgif.EventStream: AddedcancelAllSingletonSubscriptions,cancelSingletonSubscription,getSingletonSubscription.- Added
listenStreamWithInteractionCompleter. - pedantic: ^1.9.2
2.5.13 #
removeUriQueryString: avoid blank fragment in the URL.
2.5.12 #
- Added
isPositiveNumber,isNegativeNumber. - Added
MimeType.APPLICATION_ZIP. - Added
maxInIterable,minInIterable. - Added
deepReplaceValues,deepReplaceListValues,deepReplaceMapValues. - Added
parseComparable,removeEmptyEntries,sortMapEntries,sortMapEntriesByValue,sortMapEntriesByKey.
2.5.11 #
- Added
NNField. - Added
clipNumber. parseBool: if value is a num: true = v > 0- More tests.
2.5.10 #
- Fix typo.
2.5.9 #
MimeType: Addedcharset.- Added:
parseJSON,isBlankString,isBlankStringInRange,isEqualsSet,isEqualsIterable. - Added:
asTreeOfKeyString,parseMapEntry,groupIterableBy,sumIterable,averageIterable. - Added:
parseJSON,encodeJSON. - Removed
splitRegExp.splitnow acceptsPattern(StringandRegExp). - Optimized
isBlankCodeUnit.
2.5.8 #
- Added string helpers:
isBlankChar,isBlankCodeUnit,hasBlankChar,hasBlankCharInRange. - IO:
catFile,catFileBytes,saveFile,saveFileBytes. InteractionCompleter:cancel- `MimeType``: equals and hashcode.
- Added:
isEqualsList,isEqualsMap.
2.5.7 #
- Added:
isInUnixEpochRange - New event handler:
InteractionCompleter.
2.5.6 #
- dartfmt
- test_coverage: ^0.4.2
2.5.5 #
- Change
isEmptyValueto isisEmptyObject. - Added
isNotEmptyObject.
2.5.4 #
- Fix
MimeType.parsewhen parametermimeTypeis empty anddefaultMimeTypeis null. - Fix
DataURLBase64.asDataURLString - dartfmt.
2.5.3 #
- fix buildStringPattern() extraParameters issue.
2.5.2 #
- Math.mean() returns 0 on empty lists.
- dartfmt.
- Add badges to README.md
2.5.1 #
- Math.sum()
- More API Documentation.
2.5.0 #
- dartfmt.
2.4.2 #
- Added API Documentation.
- dataSizeFormat() now accepts decimalBase and binaryBase parameters.
- Pair.swapAB().
- Scale and ScaleNum.
- getPathWithoutFileName(...).
- MimeType: added alias and file extension for gzip.
- (FIX) LoadController: _idCounter to private.
- (FIX) EventStream.listenAsFuture(): ensure that completer is called only once.
2.4.1 #
- isIPAddress()
- parseDateTime() accepts
int: parsing withDateTime.fromMillisecondsSinceEpoch(v). - parseDuration()
- enum Unit: getUnitByIndex(), getUnitByName(), parseUnit(), getUnitAsMilliseconds(), getMillisecondsAsUnit()
- getDateTimeWeekDayByName(), getDateTimeStartOf(), getDateTimeEndOf()
2.4.0 #
- date.dart:
- parseDateTime(...), parseDateTimeFromInlineList(...)
- formatTimeMillis() change form to be ISO compliant.
- DateTimeWeekDay: getDateTimeWeekDay(), getDateTimeWeekDay_from_ISO_8601_index().
- getDateTimeDayStart(), getDateTimeDayEnd(), getDateTimeYesterday(), getDateTimeLastNDays(), getDateTimeThisWeek().
- getDateTimeLastWeek(), getDateTimeThisMonth(), getDateTimeLastMonth(), getDateTimePreviousMonth(), getDateTimeWeekStart(), getDateTimeWeekEnd().
- DateRangeType: getDateTimeRange(rangeType, ...)
- uri.dart:
- getUriBase(), getUriRoot(), getUriBaseScheme(), getUriBaseHost(), getUriBasePort(),
- getUriBaseHostAndPort(suppressPort80), getUriBaseURL(), buildUri(), resolveUri(), removeUriFragment().
- removeUriQueryString(), isUriBaseLocalhost(), isUriBaseIP(), isIPv4Address(), getPathFileName().
- utils.dart: toCamelCase()
- math.dart:
- events.dart: EventStream.isUsed: non used EventStream won't broadcast events (add() and addError() suppressed for optimization).
- data.dart:
- MimeType
- Base64: encodeArrayBuffer(), decodeAsArrayBuffer()
- DataURLBase64: parsePayloadAsBase64(), parsePayloadAsArrayBuffer(), parsePayloadAsString(), DataURLBase64.mimeType.
- collections.dart:
- Pair
- MapProperties: getPropertyAsDateTime(), findPropertyAsDateTime(), getPropertyAsDateTimeList(), findPropertyAsDateTimeList(), getPropertyAsStringMap(), findPropertyAsStringMap().
- sortMapEntries()
- toFlatListOfStrings()
- isListOfNum(), isListOfType
- parseListOf(...), parseListOfList(...)
- isMapOfStringKeysAndListValues(), isMapOfStringKeysAndNumValues().
- isEmptyValue(val).
- loader.dart: LoadController
2.3.10 #
- MapDelegate ; MapProperties
- isEmail()
- ResourceContent.isLoadedWithError
2.3.9 #
- deepCopy()
- buildStringPattern(), isHttpURL(), getPathExtension(), isAllEquals()
- findKeyPathValue(), parseFromInlineMap()
- ResourceContent, ResourceContentCache (moved from intl_messages)
- fix default value of parseNum().
- remove swiss_knife_browser.dart: moved to package 'dom_tools'.
- resource_portable: ^2.1.7
2.3.8 #
- Accepts dynamic value as input: parseStringFromInlineList, parseIntsFromInlineList, parseNumsFromInlineList, parseDoublesFromInlineList, parseBoolsFromInlineList
- New: isInt, isIntList, isNum, isNumList, isDouble, isDoubleList, isBool, isBoolList
2.3.7 #
- regExpReplaceAll(): allow ${1} marks (previously was only $1).
- fix regExpReplaceAll() when group match is optional.
- regExpDialect()
- isEqualsAsString()
- swiss_knife_vm.dart: catFile(), saveFile()
2.3.6 #
- regExpHasMatch
- regExpReplaceAll
2.3.5 #
- Fix return of parseIntsFromInlineList().
- Added default value for parseXXFromInlineList().
2.3.4 #
- deepHashCode
2.3.3 #
- splitRegExp().
- Tests: split() and splitRegExp() (limits: Java compliant).
2.3.2 #
- isEqualsDeep() ; parseFromInlineList() ;
- parseString() ; parseStringFromInlineList() ;
- parseBool() ; parseNumsFromInlineList() ; parseIntsFromInlineList() ; parseBoolsFromInlineList() ;
2.3.1 #
- Clean code.
2.3.0 #
- More tests.
- Math.min/max/ceil/floor/round/mean/standardDeviation
- parseNum(), parseInt(), parseDouble(), parsePercent(), getEntryIgnoreCase(), putIgnoreCase().
- dataSizeFormat()
- Base64 and DataURLBase64.
2.2.1 #
- Organize code in different dart files.
- Code analysis.
- Upgrade dependencies:
- intl: ^0.16.1
- remove "enum_to_string".
2.2.0 #
- Remove locales to package intl_messages.
- Remove rest_client to package mercury_client.
2.1.2 #
- Add LocalesManager.onDefineLocale and LocalesManager.onDefineLocaleGlobal
2.1.1 #
- Small fixes.
2.1.0 #
- Added Authorization and Credential/Token handling to REST Client.
2.0.0 #
- Update to Dart 2.0.1 and small fixes. Now able to import only utils (swiss_knife_utils.dart)
1.0.1 #
- Fix swiss_knife_browser.dart exports.
1.0.0 #
- Added events example.
- Initial version, created by Stagehand