1.0.9 • Published 9 months ago

nv-random-fixed-shape-json v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

nv-random-fixed-shape-json

  • nv-random-fixed-shape-json

install

  • npm install nv-random-fixed-shape-json

usage

example

            > const {
            ...    boolean,
            ...    int,float,number, 
            ...    key,
            ...    string, 
            ...    ////
            ...    B,I,F,N,S,NU
            ... } = require("nv-random-fixed-shape-json");
            > 
            > var shape = {
            ...      [key()]:number(),
            ...      [key()]:int(5,10),
            ...      [key(3)]:string(),
            ...      [key()]:boolean(),
            ...      [key()]: {[key()]:null},
            ...      [key()]: [
            ...            ...B(2),
            ...            ...I(3),
            ...            ...NU(2),
            ...            ...F(1),
            ...            ...N(6),
            ...            ...S(2)
            ...     ]
            ... }
            
            > shape
            {
              synagogue: -14412607,
              brine: 8,
              bal: 'plasterwork_impoverish_delphinium',
              freesia: true,
              argument: { othello: null },
              naysaying: [
                false,
                true,
                -1874269,
                12132522,
                5096160,
                null,
                null,
                -3471398.3568044417,
                4634029.298741187,
                -8389831.337015994,
                11670773.82455339,
                -4209616.481058372,
                9717601.59993913,
                -16629946,
                'amphibology_complicate_tapa',
                'chechako_reface_bailey'
              ]
            }
            > 
    

APIS

            const boolean  = ()=> _rand_bl.bl();
            const int      = (s=-(2**24)+1,e=2**24) => _rnd_num.int(s,e);
            const float    = (s=-(2**24)+1,e=2**24) => _rnd_num.float(s,e);
            const number   = (s=-(2**24)+1,e=2**24) => _rnd_num.number(s,e);
            const string   = (len)=>{
            const key      = (len)=>{
            const B  = (n=1) => Array.from({length:n}).map(r=>boolean());
            const S  = (n=1) => Array.from({length:n}).map(r=>string());
            const I  = (n=1) => Array.from({length:n}).map(r=>int());
            const F  = (n=1) => Array.from({length:n}).map(r=>float());
            const N  = (n=1) => Array.from({length:n}).map(r=>number());
            const NU = (n=1) => Array.from({length:n}).map(r=>null);

LICENSE

  • ISC