diff --git a/typescript/option/src/helpers/withDefault.ts b/typescript/option/src/helpers/withDefault.ts index b1c9934..ca855db 100644 --- a/typescript/option/src/helpers/withDefault.ts +++ b/typescript/option/src/helpers/withDefault.ts @@ -2,6 +2,12 @@ import { match } from './match' import { identity } from '@thi.ng/compose' import { Option } from '../types' +/** + * Provide a default value, turning an optional value into a normal value. + * + * @param _default The default value to use. + * @param option The option to get the default of. + */ export const withDefault = (_default: T, option: Option) => { return match(identity, _default, option) }