( contextValue: ContextValue, thingOrThingId: UsedThing | Id | undefined, offset: number, )
| 185 | getContext(TINYBASE_CONTEXT_KEY) ?? []; |
| 186 | |
| 187 | const getThing = <UsedThing extends Thing>( |
| 188 | contextValue: ContextValue, |
| 189 | thingOrThingId: UsedThing | Id | undefined, |
| 190 | offset: number, |
| 191 | ): UsedThing | undefined => |
| 192 | isUndefined(thingOrThingId) |
| 193 | ? (contextValue[offset * 2] as UsedThing | undefined) |
| 194 | : isString(thingOrThingId) |
| 195 | ? (objGet( |
| 196 | contextValue[offset * 2 + 1] as IdObj<UsedThing>, |
| 197 | thingOrThingId, |
| 198 | ) as UsedThing | undefined) |
| 199 | : (thingOrThingId as UsedThing); |
| 200 | |
| 201 | const getProvidedThing = <UsedThing extends Thing>( |
| 202 | thingOrThingId: UsedThing | Id | undefined, |
no test coverage detected
searching dependent graphs…