funny-types-fixed-array-size
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i funny-types-fixed-array-size

Weekly Downloads

0

Version

0.0.2

License

none

Unpacked Size

976 B

Total Files

3

Last publish

Collaborators

  • zavodnoyapl