0.1.4 • Published 6 years ago

spreading v0.1.4

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

spreading

A spread module

Install

yarn add spreading

Description

This module will perform spread operations.

You can:

  • Combine objects
  • Get the key value from the combined objects
  • ...and more...in the future!

A work-in-progress module.

Built by: Mario Lo

Example

import {
    spreading,
    getKey
} from 'spreading';


(() => {
    const combine1 = {
        a: 1,
        b: 2,
        c: 3
    };

    const combine2 = {
        c: 4,
        d: 5
    };

    const combine3 = {
        d: 6,
        e: 7,
        f: 8
    };

    const spreadinged = spreading(combine1, combine2, combine3);
    console.log(spreadinged);
    // Object { a: 1, b: 2, c: 4, d: 6, e: 7, f: 8 }

    const getKeyed = getKey('d', combine1, combine2, combine3);
    console.log(getKeyed);
    // 6
})();

Functions

spreading

Combines multiple objects

Returns an object

getKey

Combines multiple objects and returns the value of the key

Returns the key value if found Returns null if not found

Parameters

spreading(target[, source, source, ...etc]);
getKey(key, target[, source, source, ...etc])
Parameter NameTypeRequiredDefault ValueDescription
targetobjecttruenullMain object that will perform operations on
sourceobjecttruenullAn object that will combine with the target
keystringtruenullA key to locate in the source object(s)

Contributing

Please open a new issue and mention me to get the ball rolling. Thanks!

Future Features

TBD

Feature Request

Please message hello@websitesbymario.com for feature requests.

Bug Report

Please message hello@websitesbymario.com to report bugs.

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago