df_collection 0.10.1
df_collection: ^0.10.1 copied to clipboard
A package designed to extend Dart collections by offering additional functionality.
Changelog #
0.10.1 #
- fix:
unique()withoutequalsreturns an iterable that can be iterated more than once. Previously every pass after the first was empty, because all passes shared one "seen" set. The result is still lazy. - fix:
JsonUtility.mapToJsonthrowsArgumentErrornaming the key when two keys of one map convert to the same JSON key (e.g.{1: 'a', '1': 'b'}, or akeyConvertercollision). Previously one entry was silently dropped. - feat: Add
JsonUtility.unflattenJson, the inverse offlattenJsonfor nested maps:{'a.b': 1}becomes{'a': {'b': 1}}. A key that is both a value and a parent ({'a': 1, 'a.b': 2}) throwsStateErrorinstead of silently losing one. - docs:
expandJson/expandFlattenedJsonare documented as what they are: they add shortened suffix alias keys ({'a.b': 1}→{'a.b': 1, 'b': 1}), they do not un-flatten. Behaviour unchanged (df_config's relative-key lookup depends on it).
0.10.0 #
- breaking:
mergeDataDeepnow deep-copies all mutable substructure into its result — mutating the merged result no longer mutates the input data. Same guarantee formergeListsSetsOrQueuesandmergeIterables. Prior versions silently sharedMap/List/Set/Queuereferences between the result and the inputs, which was a data-integrity hazard. - breaking:
JsonUtility.flattenJsonnow throwsStateErrorwhen (a) any key contains the separator (would produce an ambiguous flat path) or (b) two distinct source paths would flatten to the same flat key (silent overwrite of data). Previously the colliding entry was silently dropped. - breaking:
JsonUtility.mapToJsonnow rejectsNaNand±Infinitydoubles withUnsupportedError— not representable in standard JSON, previously slipped through only to breakjsonEncodedownstream. - breaking:
setNestedValueon a non-Mapintermediate now throwsStateErrorinstead of silently overwriting the existing value. PassoverwriteIntermediates: trueto opt into the old behaviour. An emptykeyPathis now a safe no-op instead of throwing. - breaking:
tryToJson/tryToMapnow only swallowNoSuchMethodError(the "no such member" case). Exceptions thrown by a presenttoJson/toMappropagate. - breaking:
tryReduce/tryMergenow only convert the "empty iterable" case intonull. Exceptions from the user's combine/merge function propagate (previouslyErrorsubclasses includingStackOverflowErrorwere silently swallowed). - breaking:
combinedOrderedStringIdnow throwsArgumentErrorwhen an ID is empty, contains the separator (would otherwise yield silent ID collisions), or when an empty separator is passed. New optionalseparatorparameter (default_). - breaking:
deepGetFromSegmentsrefuses to index into non-Listiterables (notablySet) — element order is implementation-defined there. Also refuses fractional indices (e.g."3.5") instead of silently truncating. - breaking:
chunkedthrowsArgumentErrorfor non-positivechunkSizeinstead of silently yielding a single chunk. - fix:
CsvUtility.csvToMapis now an RFC 4180 parser: handles CRLF / bare-CR line terminators, newlines inside quoted fields, escaped quotes, and preserves significant leading/trailing whitespace. Blank lines no longer renumber subsequent rows. - fix:
CsvUtility.mapToCsvnow quotes fields containing\rper RFC 4180. - fix:
deepGetFromSegmentsnow returns the resolved value instead of alwaysnull. - fix:
takeLast(count)no longer throws whencountexceeds the iterable's length; returns the full iterable. - fix:
traverseMapwrite returns the written value, and no longer throws when the intermediate path crosses a non-map node. - fix:
mergeIterablesno longer throws aTypeErrorwhen one argument is a scalar and the other is a typed iterable. - fix:
JsonUtility.mapToJsonnow acceptsnullvalues (was throwingUnsupportedError). - fix:
JsonUtility.flattenJsonno longer silently drops keys whose values are empty maps or lists. - fix:
mergeListsSetsOrQueuesnow applieselseFilterto the b-side in theSetbranch (was previously skipped). MaybeAddToIterableExt.maybeAddreturn type tightened fromIterable<T>?toIterable<T>.