From 34fda0e455a59bdeda256df124d7c7845141b808 Mon Sep 17 00:00:00 2001 From: Jack Schofield Date: Mon, 15 Feb 2021 10:29:06 +0000 Subject: [PATCH 1/2] adding a silly whoops file --- src/whoops.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/whoops.ts diff --git a/src/whoops.ts b/src/whoops.ts new file mode 100644 index 0000000..ad5bc34 --- /dev/null +++ b/src/whoops.ts @@ -0,0 +1,24 @@ +export const complicatedThingUntestedThing = (apples: Object[], pears: Object[]) => { + if (apples) { + if (pears) { + if (apples.length > 1) { + if (pears.length > 1) { + for (const apple of apples) { + if (apple) { + if (pears.includes(apple)) { + const pear = pears.find(p => p === apple); + if (!pear) { + throw new Error('cannot compare apples and pears'); + } else { + return pear === apple; + } + } else { + throw new Error('cannot compare apples and pears'); + } + } + } + } + } + } + } +}; From 9aae225bf0191741bd2b00c99d58becf924560b4 Mon Sep 17 00:00:00 2001 From: Jack Schofield Date: Mon, 15 Feb 2021 10:32:50 +0000 Subject: [PATCH 2/2] getting it past the silly linter --- src/whoops.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/whoops.ts b/src/whoops.ts index ad5bc34..90a51f6 100644 --- a/src/whoops.ts +++ b/src/whoops.ts @@ -1,3 +1,6 @@ +/* tslint:disable */ +// TODO - I know this is a mess but I don't have time to do it properly atm +// FIXME - we keep getting bugs here, should probably fix it export const complicatedThingUntestedThing = (apples: Object[], pears: Object[]) => { if (apples) { if (pears) {