yugo

1.0.0 • Public • Published

yugo

Build Status License

Description

🍥 yugo is simple JavaScript utility for conditionally joining objects.
For example, Manage the StyleSheet of React Native.

Inspired by classnames.

What's yugo?

Installation

npm i yugo

Usage

Use with node.js, browserify, webpack:

var yugo = require(yugo);

Join Objects. Overwrite.
Caution : Do Not Use Nested Object. Destructive.

yugo({a: 'a'}, {b: 'b'}, {b: 'c'}); // => {a: 'a', b: 'c'}

Conditionaly Join Objects. Use Array.

yugo({a: 'a'}, [{b: 'b'}, true], {c: 'c'}); // => {a: 'a', b: 'b', c: 'c'}
 
yugo({a: 'a'}, [{b: 'b'}, false], {c: 'c'}); // => {a: 'a', c: 'c'}

Package Sidebar

Install

npm i yugo

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • ideyuta