Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 3x 4x 3x 3x 3x 3x 3x 26x 8x 5x 8x | export function assert(condition: any, message?: string): asserts condition {
if (!condition) {
const error = new Error(message || "Assertion failed")
error.name = "Assertion Failure"
// @ts-ignore
error.framesToPop = 1
throw error
}
}
export function removeUndefined<O extends { [key: string]: any }>(
obj: O
): Partial<O> {
return Object.keys(obj).reduce((acc, key) => {
if (obj[key] !== undefined) {
acc[key] = obj[key]
}
return acc
}, {} as { [key: string]: any }) as Partial<O>
}
|