Skip to content

Commit

Permalink
feat(geom-resample): 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 1af6f78 commit c4b0919
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/geom-resample/src/sampler.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { closestPointSegment, closestT } from "@thi.ng/geom-closest-point";
import { fit01 } from "@thi.ng/math";
import {
dist,
Expand All @@ -11,7 +12,6 @@ import {
Vec,
VecPair
} from "@thi.ng/vectors";
import { closestPointSegment, closestT } from "@thi.ng/geom-closest-point";

export class Sampler {
points: ReadonlyVec[];
Expand Down Expand Up @@ -59,8 +59,8 @@ export class Sampler {

closestPoint(p: ReadonlyVec) {
const pts = this.points;
const tmp = [];
const closest = [];
const tmp: Vec = [];
const closest: Vec = [];
let minD = Infinity;
for (let i = 0, n = pts.length - 1; i < n; i++) {
if (closestPointSegment(p, pts[i], pts[i + 1], tmp)) {
Expand All @@ -77,8 +77,8 @@ export class Sampler {
closestT(p: ReadonlyVec) {
const pts = this.points;
const idx = this.index;
const tmp = [];
const closest = [];
const tmp: Vec = [];
const closest: Vec = [];
let minD = Infinity;
let minI;
for (let i = 0, n = idx.length - 1; i < n; i++) {
Expand Down

0 comments on commit c4b0919

Please sign in to comment.