df_type 0.17.3
df_type: ^0.17.3 copied to clipboard
Simplifies type conversions, inspections, nested data access, sync/async operations and more.
Changelog #
0.17.3 #
- Merge branch 'main' into prod
0.17.2 #
- Merge remote-tracking branch 'origin/prod' into prod
0.17.1 #
- fix: migrate to analyzer-plugin lints, fix CI workflows, format
0.17.0 #
- chore: standardize README and CI/CD workflows, remove donation links, update contact info and repository links
- chore: resolve analyzer issues
0.16.2 #
- fix:
letOrNull<List<dynamic>>andletOrNull<Set<dynamic>>(and their nullable forms) no longer throwArgumentError; they convert likeIterable<dynamic>. Nested conversions such asletMapOrNull<String, List<dynamic>>(...)andletListOrNull<Map<String, dynamic>>(...)work again. - fix: nullable collection targets (
letOrNull<List<dynamic>?>('[1,2]'),Map<dynamic, dynamic>?, …) now convert instead of returningnull. - fix:
letOrNullreturns an input that already isTunchanged for anyT, including specific collection types (letOrNull<List<int>>(<int>[1])), and returnsnullfor anullinput. It still throwsArgumentErrorwhen the input would need converting into a specific collection type. - feat:
letOrNull<num>dispatches throughletNumOrNull(letOrNull<num>('5')is5; it used to benull). - feat:
letOrNullthrowsArgumentErrorwhen asked to convert a non-enum input into an enum type, instead of silently returningnull; look enums up withvalueOf/valueOfOrThrow. - feat: Add
Iterable<Enum>.valueOfOrThrow— the strict sibling ofvalueOf(same case-insensitive, trimmed matching) that throwsArgumentErrornaming the unknown value and the valid names.
0.16.1 #
- feat:
letBoolOrNullacceptsint 0/int 1asfalse/truefor interop with SQLite (and other drivers) that store booleans as INTEGER. Other integer values still returnnull.
0.16.0 #
- breaking: Remove
DateTimeUtils,StreamUtils, andStringToDurationConverter. Moved to the newdf_oddpackage. - breaking: Rename extension
ValueOfOnEnumExtensiontoValueOfOnEnumExt. - breaking:
Waiter.addnow takes aWaiterOperation<T>value object; bare-function callers should switch toaddFn(fn, {id}). TheWaiterconstructor takesIterable<WaiterOperation<T>>. - breaking:
letAsStringOrNull(null)returnsnull(previously the literal four-character string'null'). - breaking:
letOrNull<T>throwsArgumentErrorin every build mode when given a specific collection subtype (e.g.List<int>). Previously a debug-onlyassertthat was stripped in release, silently returningnullin production. - breaking:
letMapOrNullrejects the conversion when two source keys coerce to the same target key. Previously the second entry silently overwrote the first. - breaking:
Function.tryCallno longer absorbsErrorsubtypes (StackOverflowError,OutOfMemoryError,AssertionError,StateError, …). It still absorbsException,TypeError, andNoSuchMethodError. - feat: Add
decodeJsonbStrings— recursively decodes JSON-shaped strings inside Maps and Lists, for normalising Postgresjsonbcolumns. Accepts an optionalmaxDepthparameter (default64) so hostile or pathological nesting cannot overflow the stack. - feat: Add
WaiterOperation<T>— immutable value-object wrapper around a deferred operation, with optionalidfor auditing. Cross-isolate sendable whenrunis a top-level orstaticfunction. - feat: Add
Waiter.addFn(fn, {id})andWaiter.removeWhere(test). - feat: Export
isJsRuntime,jsSafeIntegerBound,vmInt64Bound, anddefaultDecodeJsonbStringsMaxDepthfor callers that need to branch on runtime or align with the package's safety bounds. - fix:
letIntOrNullnow rejectsNaN,±Infinity, and values outside the runtime-correct safe-integer range —[-2^63, 2^63)on the Dart VM,[-2^53, 2^53]on the JS runtime (Flutter web / dart2js / dartdevc) whereintis backed by a 64-bit double. Previously could throwUnsupportedError, silently saturate toint64.min/int64.max, or hand back a precision-mangled value on JS. - fix:
wait/consec*now preserves positional argument order across mixed sync/async inputs. - fix:
wait/consec*/Waiter: a buggyonErrorhandler no longer masks the original incident. The handler's own failure is surfaced throughZone.current.handleUncaughtError, while the caller still sees the original error. - fix:
wait/consec*/Waiter:onCompletenow runs on every exit path, including whenonErroritself throws. - fix:
wait/consec*undereagerError: trueno longer leaks secondary rejections throughZone.current.handleUncaughtError— exactly one attributable failure reaches the caller. - fix:
Waiterconstructor and per-call error handlers are now awaited if they return aFuture, and one handler's throw no longer prevents the other from running. - fix:
letDateTimeOrNullnow trims whitespace before parsing.