Neverending Prototype Mode

    assign-if

    0.1.1 • Public • Published

    Assign If

    call Object.assign if the passed expression evaluates to true.

    Usage

    const assignIf = require('assign-if');
    
    const evaluation = assignIf({a: 1, b: 2}, {c: 3}, 5 > 4);
    //=> {success: true, object: {a: 1, b: 2, c: 3}}
    
    const evaluation2 = assignIf({a: 1, b: 2}, {c: 3}, 1 == 2);
    //=> {success: false, object: {a: 1, b: 2}}

    License

    • MIT

    Keywords

    none

    Install

    npm i assign-if

    DownloadsWeekly Downloads

    3

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    2.84 kB

    Total Files

    5

    Last publish

    Collaborators

    • molnarmark