Record overview
A simple extension to the Effect Record module
Table of contents
Utils
tryZeroParamFunction
Tries to call method functionName
on self
with no parameters. Returns a some
of the result if such a function exists, is different from exception (if defined), and takes no parameter. Returns a none
otherwise
Signature
export declare const tryZeroParamFunction: ({
functionName,
exception
}: {
readonly functionName: string | symbol
readonly exception?: MTypes.AnyFunction
}) => (self: MTypes.NonPrimitive) => Option.Option<unknown>
tryZeroParamStringFunction
Same as tryZeroParamStringFunction
but returns a none
if the result of the function is not a string
Signature
export declare const tryZeroParamStringFunction: (params: {
readonly functionName: string | symbol
readonly exception?: MTypes.AnyFunction
}) => MTypes.OneArgFunction<MTypes.NonPrimitive, Option.Option<string>>
unsafeGet
Unsafe get an element from a record. No checks, faster than the Effect version
Signature
export declare const unsafeGet: (key: string | symbol) => <A>(self: Record.ReadonlyRecord<string, A>) => A