Nonlinear Programming Methods

    @pairohit/helper
    TypeScript icon, indicating that this package has built-in type declarations

    5.6.2 • Public • Published

    Helper function available:

    Available functions

    Core Function
    Array splitArrayInto
    arrayElmCounter
    containsInArray
    isDistinctiveArray
    minArray
    maxArray
    swapElmArray
    Email isEmail
    Halt halt d -> HaltCounter
    HttpStatusCode httpStatusCode
    Math minmax
    Text textLimitor
    Case
    onlyAlphanumeric
    Time Dates
    lastseen
    Timeline
    Uid genUniqueId
    genRandomUniqueId
    Random randomInteger
    randomFloat
    shuffleArray
    randomAlphabet
    randomNaturalArray
    RandomDropRateIndex
    Sleep sleep

    d-> = depent on

    Examples

    Timeline Demo

    
    async function example1() {
      console.log("** started **");
      let hc = new HaltCounter(0);
    
      let looper = setInterval(() => {
        hc.count++;
        console.log("count: " + hc.count);
      }, 1000);
    
      await halt(hc, 5, {
        every: 500, // check hc.count every 500ms
        maxTimeout: 10000, // after 10s if hc.count don't become 5 halt function will reject
      });
    
      // things below will be in halt untill the hc.count becomes 5
      console.log("** ended **");
      clearInterval(looper);
    }
    
    example1();
    
    

    Keywords

    none

    Install

    npm i @pairohit/helper

    DownloadsWeekly Downloads

    22

    Version

    5.6.2

    License

    MIT

    Unpacked Size

    192 kB

    Total Files

    83

    Last publish

    Collaborators

    • pairohit305