flat-grid

0.1.1 • Public • Published

Introduction

Flat grid allows you to deal with 2 dimentional data while it is stored in a flat (1D) array.

Example

const fg = FlatGrid(5, 4); // create grid of 5 rows and 4 columns
fg.set(4, 3, 1); // set last element of last row to 1
fg.get(4, 3); // get previously set element
 

API

Development

Run yarn install and then yarn run build or yarn run watch

Runing tests

  • yarn run test

Tests are run against the code in the dist folder to avoid transpilation. Hence if there is a change in ts code you need to make sure the code is rebuild before running tests.

Node version > 12 is necessary to be able to run tests (due to ES import/export features)

Package Sidebar

Install

npm i flat-grid

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

6.53 kB

Total Files

8

Last publish

Collaborators

  • etsvet