Record43
Constructors
emptyconstCreates a new, empty record.fromEntriesconstBuilds a record from an iterable of key-value pairs.fromIterableByconstCreates a new record from an iterable, utilizing the provided function to determine the key for each element.fromIterableWithconstTakes an iterable and a projection function and returns a record.singletonconstCreate a non-empty record from a single element.Models
Guards
Getters
Elements
Mapping
mapconstMaps a record into another record by applying a transformation function to each of its values.mapEntriesconstMaps entries of a ReadonlyRecord using the provided function, allowing modification of both keys and corresponding values.mapKeysconstMaps the keys of a ReadonlyRecord while preserving the corresponding values.Filtering
filterconstSelects properties from a record whose values match the given predicate.filterMapconstTransforms a record by applying the function f to each key and value in the original record.getFailuresconstReturns a new record containing only the Err values from a record of Result values, preserving the original keys.getSomesconstReturns a new record containing only the Some values from a record of Option values, preserving the original keys.getSuccessesconstReturns a new record containing only the Ok values from a record of Result values, preserving the original keys.partitionconstApplies a function to each record entry and partitions the returned Result values into two records.separateconstPartitions a record of Result values into two separate records, one with the Err values and one with the Ok values.Mutations
modifyconstApplies a function to the element at the specified key safely, creating a new record, or return Option.none() if the key doesn't exist.popconstRetrieves the value of the property with the given key from a record safely and returns an Option of a tuple with the value and the record with the removed property.removeconstRemoves a key from a record.replaceconstReplaces the value at an existing key safely and returns the updated record in Option.some.setconstAdds a new key-value pair or update an existing key's value in a record.Combining
differenceconstMerges two records, preserving only the entries that are unique to each record.intersectionconstMerges two records, retaining only the entries that exist in both records.makeReducerIntersectionfunctionCreates a Reducer whose combine operation intersects two records and combines values for keys present in both records.makeReducerUnionfunctionCreates a Reducer for combining Records using union, with values for keys that exist in both records combined using the provided Combiner.unionconstMerges two records, preserving entries that exist in either of the records.Converting
Folding
Instances
Predicates
everyconstChecks whether all entries in a record meet a specific condition.isSubrecordconstChecks whether the first record is a subrecord of the second record.isSubrecordByconstChecks whether all the keys and values in one record are also found in another record.someconstChecks whether any entry in a record meets a specific condition.