Skip to content
Snippets Groups Projects
Commit 59c7420c authored by Moritz Langenstein's avatar Moritz Langenstein
Browse files

(ml5717) npm run format fix

parent 4eff8c01
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,10 @@ import { ...@@ -7,7 +7,10 @@ import {
describe("erasure intervals", () => { describe("erasure intervals", () => {
it("computes simple erasure intervals", () => { it("computes simple erasure intervals", () => {
const points = [[0, 0], [100, 100]] const points = [
[0, 0],
[100, 100],
]
const erasureCenter = [50, 50] const erasureCenter = [50, 50]
const erasureRadius = 25 * Math.SQRT2 const erasureRadius = 25 * Math.SQRT2
...@@ -21,7 +24,11 @@ describe("erasure intervals", () => { ...@@ -21,7 +24,11 @@ describe("erasure intervals", () => {
}) })
it("computes complex erasure intervals", () => { it("computes complex erasure intervals", () => {
const points = [[0, 0], [100, 100], [0, 200]] const points = [
[0, 0],
[100, 100],
[0, 200],
]
const erasureCenter = [100, 100] const erasureCenter = [100, 100]
const erasureRadius = 25 * Math.SQRT2 const erasureRadius = 25 * Math.SQRT2
...@@ -35,7 +42,11 @@ describe("erasure intervals", () => { ...@@ -35,7 +42,11 @@ describe("erasure intervals", () => {
}) })
it("computes erasure intervals when point projection is not on the segment", () => { it("computes erasure intervals when point projection is not on the segment", () => {
const points = [[800, 400], [800, 450], [800, 500]] const points = [
[800, 400],
[800, 450],
[800, 500],
]
const erasureCenter = [800, 432] const erasureCenter = [800, 432]
const erasureRadius = 20 //* Math.SQRT2 const erasureRadius = 20 //* Math.SQRT2
...@@ -49,7 +60,10 @@ describe("erasure intervals", () => { ...@@ -49,7 +60,10 @@ describe("erasure intervals", () => {
}) })
it("computes erasure intervals ???", () => { it("computes erasure intervals ???", () => {
const points = [[100, 100], [1100, 100]] const points = [
[100, 100],
[1100, 100],
]
const erasureCenter = [448, 86] const erasureCenter = [448, 86]
const erasureRadius = 100 const erasureRadius = 100
...@@ -70,7 +84,10 @@ describe("erasure intervals", () => { ...@@ -70,7 +84,10 @@ describe("erasure intervals", () => {
const combined = combineErasureIntervals(i1, i2) const combined = combineErasureIntervals(i1, i2)
const expected = { const expected = {
0: [[0.1, 0.6], [0.7, 0.8]], 0: [
[0.1, 0.6],
[0.7, 0.8],
],
} }
expect(combined).toStrictEqual(expected) expect(combined).toStrictEqual(expected)
...@@ -97,12 +114,19 @@ describe("erasure intervals", () => { ...@@ -97,12 +114,19 @@ describe("erasure intervals", () => {
}) })
it("spreads flattened intervals", () => { it("spreads flattened intervals", () => {
const il = [[0.1, 1.25], [1.5, 2.0], [7.5, 7.75]] const il = [
[0.1, 1.25],
[1.5, 2.0],
[7.5, 7.75],
]
const spread = spreadErasureIntervals(il) const spread = spreadErasureIntervals(il)
const expected = { const expected = {
0: [[0.1, 1.0]], 0: [[0.1, 1.0]],
1: [[0.0, 0.25], [0.5, 1.0]], 1: [
[0.0, 0.25],
[0.5, 1.0],
],
7: [[0.5, 0.75]], 7: [[0.5, 0.75]],
} }
...@@ -110,7 +134,11 @@ describe("erasure intervals", () => { ...@@ -110,7 +134,11 @@ describe("erasure intervals", () => {
}) })
it("spreads singulatity intervals", () => { it("spreads singulatity intervals", () => {
const il = [[0.0, 0.0], [3.5, 3.5], [99.0, 99.0]] const il = [
[0.0, 0.0],
[3.5, 3.5],
[99.0, 99.0],
]
const spread = spreadErasureIntervals(il) const spread = spreadErasureIntervals(il)
const expected = { 0: [[0.0, 0.0]], 3: [[0.5, 0.5]], 99: [[0.0, 0.0]] } const expected = { 0: [[0.0, 0.0]], 3: [[0.5, 0.5]], 99: [[0.0, 0.0]] }
...@@ -121,12 +149,20 @@ describe("erasure intervals", () => { ...@@ -121,12 +149,20 @@ describe("erasure intervals", () => {
it("flattens spread intervals", () => { it("flattens spread intervals", () => {
const is = { const is = {
0: [[0.1, 1.0]], 0: [[0.1, 1.0]],
1: [[0.0, 0.3], [0.4, 1.0]], 1: [
[0.0, 0.3],
[0.4, 1.0],
],
7: [[0.35, 0.75]], 7: [[0.35, 0.75]],
} }
const flattened = flattenErasureIntervals(is) const flattened = flattenErasureIntervals(is)
const expected = [[0.1, 1.0], [1.0, 1.3], [1.4, 2.0], [7.35, 7.75]] const expected = [
[0.1, 1.0],
[1.0, 1.3],
[1.4, 2.0],
[7.35, 7.75],
]
expect(flattened).toStrictEqual(expected) expect(flattened).toStrictEqual(expected)
}) })
......
...@@ -13,16 +13,14 @@ ...@@ -13,16 +13,14 @@
/> />
<script> <script>
if (navigator.serviceWorker) { if (navigator.serviceWorker) {
navigator.serviceWorker navigator.serviceWorker.register("service-worker.js").then(
.register("service-worker.js") (registration) =>
.then( console.log(
(registration) => `Service worker registered on scope ${registration.scope}`,
console.log( ),
`Service worker registered on scope ${registration.scope}`, (reason) =>
), console.log(`Service worker failed to register ~ ${reason}`),
(reason) => )
console.log(`Service worker failed to register ~ ${reason}`),
)
} }
</script> </script>
</head> </head>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment