Wondering what’s next for npm?Check out our public roadmap! »

    @pakal/assign
    TypeScript icon, indicating that this package has built-in type declarations

    0.2.1 • Public • Published

    @pakal/assign

    Source Code Version MIT License Bundle Size TypeScript

    Assign is package from Pakal library

    Install

    $ yarn add @pakal/assign

    Or

    $ npm install --save @pakal/assign

    Use

    Module

    import {
      default as assign
    } from '@pakal/assign';

    Browser

    <script src="https://unpkg.com/@pakal/assign/bundle.umd.min.js"></script>
    let {
      assign
    } = _;

    Examples

     let target = {};
     let a = {length: 4,3: 'c', 5: 'e'};
     let b = 'foo';
     let c = [55, 33];
     let d = {1: 'a', foo: 'bar'};"
     
     assign(target, a, b, c, d) === target; // => true
     console.log(target);
     // => {
     //  0: 55
     //  1: "a"
     //  2: "o"
     //  3: "c"
     //  foo: "bar"
     // }
     let target = {a: 2, c: 3};
     let source = {a: 1, b: 2};
     
     assign(target, source); // => {a: 1, b: 2, c: 3}

    Note: Unlike Object.assign this method will assign ArrayLike as Array.

    License

    Copyright © Yisrael Eliev, Licensed under the MIT license.

    Install

    npm i @pakal/assign

    DownloadsWeekly Downloads

    10

    Version

    0.2.1

    License

    MIT

    Unpacked Size

    44.8 kB

    Total Files

    15

    Last publish

    Collaborators

    • avatar