1.0.0 • Published 2 years ago

nv-facutil-simple-illusion v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

nv-facutil-simple-illusion

  • simple util to create a multi-value class
  • for feature test in nvlang, USELESS

install

  • npm install nv-facutil-simple-illusion

usage

  const x = require("nv-facutil-simple-illusion");

example

    const Fakes = x(
        {
            next:(data)=>data+1,
            prev:(data)=>data-1,
            pow2:(data)=>data**2
        }
    )

    var o = new Fakes(100)
    > o
    Fakes(4) [ 100, 101, 99, 10000 ]
    >

    > o.orig_
    100
    > o.next
    101
    > o.prev
    99
    > o.pow2
    10000
    >

    > o.set(8)
    > o
    Fakes(4) [ 8, 9, 7, 64 ]
    >

METHODS

APIS

LICENSE

  • ISC