(tag: C.Tag<any, any>)
| 170 | } |
| 171 | |
| 172 | const serviceNotFoundError = (tag: C.Tag<any, any>) => { |
| 173 | const error = new Error(`Service not found${tag.key ? `: ${String(tag.key)}` : ""}`) |
| 174 | if (tag.stack) { |
| 175 | const lines = tag.stack.split("\n") |
| 176 | if (lines.length > 2) { |
| 177 | const afterAt = lines[2].match(/at (.*)/) |
| 178 | if (afterAt) { |
| 179 | error.message = error.message + ` (defined at ${afterAt[1]})` |
| 180 | } |
| 181 | } |
| 182 | } |
| 183 | if (error.stack) { |
| 184 | const lines = error.stack.split("\n") |
| 185 | lines.splice(1, 3) |
| 186 | error.stack = lines.join("\n") |
| 187 | } |
| 188 | return error |
| 189 | } |
| 190 | |
| 191 | /** @internal */ |
| 192 | export const isContext = (u: unknown): u is C.Context<never> => hasProperty(u, TypeId) |
no test coverage detected
searching dependent graphs…