swizz

1.0.0 • Public • Published

swizz Build Status

Provide swizzles for arrays, like GLSL.

npm install swizz

import swizzle from 'swizz'
 
let arr = swizzle([0, 1, 2, 3])
 
arr.zyx = arr.xyz
 
arr // [2, 1, 0, 3]

Supported swizzles: xyzw, stpd, rgba. Uses Proxy under the hood.

Related art

Refs

HK

Package Sidebar

Install

npm i swizz

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

6.38 kB

Total Files

5

Last publish

Collaborators

  • dy