@ricardomatias/ring
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

ring Build Status

Your average array made cyclical by using Proxy

import ring from '@ricardomatias/ring';

const AM7 = [ 'A', 'C', 'E', 'G' ];
const am7 = ring(AM7);

const first = am7[0]; // 'A'
const firstAgain = am7[4]; // 'A'
const firstYetAgain = am7[-4]; // 'A'

AM7 === am7 // => false

Install

Use npm to install.

npm install @ricardomatias/ring --save

Usage

ring([Array])

Returns a new proxied array. Provides access to all the native Array methods and properties.

License

MIT, see LICENSE.md for details.

Readme

Keywords

Package Sidebar

Install

npm i @ricardomatias/ring

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

5.22 kB

Total Files

6

Last publish

Collaborators

  • ricardomatias