From dc4ac7742690f8f2bd759d57108ac4455e717fe9 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 20 Jul 2025 13:03:39 -0700 Subject: Mount src directory from path on host running worker container --- u/types/fn/optional.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'u/types/fn/optional.ts') diff --git a/u/types/fn/optional.ts b/u/types/fn/optional.ts index 3396a45..504e496 100644 --- a/u/types/fn/optional.ts +++ b/u/types/fn/optional.ts @@ -1,4 +1,4 @@ -import { type Mapper, type Supplier, Tagged, isTagged } from '@emprespresso/pengueno'; +import { type Mapper, Predicate, type Supplier, Tagged, isTagged } from '@emprespresso/pengueno'; export type MaybeGiven = T | undefined | null; @@ -9,7 +9,7 @@ export class IOptionalEmptyError extends Error {} export interface IOptional = NonNullable> extends Tagged, Iterable { readonly move: <_T>(t: MaybeGiven<_T>) => IOptional<_T>; readonly map: <_T>(mapper: Mapper>) => IOptional<_T>; - readonly filter: (mapper: Mapper) => IOptional; + readonly filter: (mapper: Predicate) => IOptional; readonly flatMap: <_T>(mapper: Mapper>>) => IOptional<_T>; readonly orSome: (supplier: Supplier>) => IOptional; readonly get: Supplier; @@ -48,11 +48,11 @@ export class Optional = NonNullable> extends _Tag } public get(): T { - if (isNone(this.self)) throw new IOptionalEmptyError('empty value'); + if (isNone(this.self)) throw new IOptionalEmptyError('called get() on None optional'); return this.self.value; } - public filter(mapper: Mapper): IOptional { + public filter(mapper: Predicate): IOptional { if (isNone(this.self) || !mapper(this.self.value)) return Optional.none(); return Optional.some(this.self.value); } -- cgit v1.2.3-70-g09d2