Skip to content

Commit

Permalink
feat(geom-accel): enable TS strict compiler flags (refactor)
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jun 4, 2019
1 parent c4b0919 commit e19e6bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/geom-accel/src/kdtree.ts
Expand Up @@ -5,7 +5,7 @@ import { Heap } from "@thi.ng/heaps";
import { EPS } from "@thi.ng/math";
import { distSq, ReadonlyVec, Vec } from "@thi.ng/vectors";

const CMP = (a, b) => b[0] - a[0];
const CMP = (a: [number, any], b: [number, any]) => b[0] - a[0];

export class KdNode<K extends ReadonlyVec, V> {
parent: KdNode<K, V>;
Expand Down Expand Up @@ -45,7 +45,7 @@ export class KdNode<K extends ReadonlyVec, V> {
}
}

height() {
height(): number {
return (
1 +
Math.max(this.l ? this.l.height() : 0, this.r ? this.r.height() : 0)
Expand Down Expand Up @@ -277,7 +277,7 @@ const find = <K extends ReadonlyVec, V>(
p: K,
node: KdNode<K, V>,
epsSq: number
) => {
): KdNode<K, V> | undefined => {
if (!node) return;
return distSq(p, node.k) <= epsSq
? node
Expand Down

0 comments on commit e19e6bc

Please sign in to comment.