0.0.2 • Published 6 years ago

funny-types-fixed-array-size v0.0.2

Weekly downloads
6
License
-
Repository
-
Last release
6 years ago

Fixed Size Array

Based on this comment

import {FixedSizeArray} from 'funny-types/fixed-array-size'

const goodArray: FixedSizeArray<number, 2> = [1, 2]

And you'll have type error if:

import {FixedSizeArray} from 'funny-types/fixed-array-size'

const array: FixedSizeArray<number, 2> = [1, 2, 3]

or

import {FixedSizeArray} from 'funny-types/fixed-array-size'

const array: FixedSizeArray<number, 2> = [1, 2]
array[2] = 5
0.0.2

6 years ago

0.0.1

6 years ago