Skip to content

Commit

Permalink
chore: fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
ken0x0a committed Dec 11, 2019
1 parent 7827762 commit 74cd793
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/utils/get-loop-interpolate-range.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { range } from './array'

interface GetLoopInterpolateRangesOptions {
type GetLoopInterpolateRangesOptions = {
/**
* - number
* - ~~string => color | degrees~~
Expand All @@ -9,10 +9,14 @@ interface GetLoopInterpolateRangesOptions {
count: number
}

type GetLoopInterpolateRangesResult = {
inputRange: number[]
outputRange: number[]
}
export function getLoopInterpolateRanges({
count,
calcOutputRange,
}: GetLoopInterpolateRangesOptions) {
}: GetLoopInterpolateRangesOptions): GetLoopInterpolateRangesResult {
const inputRange = getLoopInterpolateInputRange({ count })

const outputRange = getLoopInterpolateOutputRange({ count, calcRange: calcOutputRange })
Expand All @@ -24,9 +28,11 @@ interface GetLoopInterpolateInputRangesOptions {
count: number
}
/**
* [0..count]
* @return [0..count]
*/
export function getLoopInterpolateInputRange({ count }: GetLoopInterpolateInputRangesOptions) {
export function getLoopInterpolateInputRange({
count,
}: GetLoopInterpolateInputRangesOptions): number[] {
return range(count + 1).map((__, idx) => idx / count)
}

Expand All @@ -44,7 +50,7 @@ interface GetLoopInterpolateOutputRangesOptions {
export function getLoopInterpolateOutputRange({
count,
calcRange,
}: GetLoopInterpolateOutputRangesOptions) {
}: GetLoopInterpolateOutputRangesOptions): number[] {
const outputRange = range(count).map((__, idx) => calcRange(idx))
outputRange.unshift(outputRange.slice(-1)[0])

Expand Down

0 comments on commit 74cd793

Please sign in to comment.