package
A minimalist utility library.
npm install ulGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 4 packages.
36.2 kB
Includes dependencies.
A minimalist utility library.
# Using npm
npm install --save ul
# Using yarn
yarn add ulimport Ul from "ul";
// Input data
let obj = {
n: null,
v: 1
};
let def = {
n: 1,
v: 10,
a: 20
};
let tmp;
// Merge the two objects and store the result in tmp
console.log(tmp = Ul.deepMerge(obj, def));
// => { n: null, v: 1, a: 20 }
// Clone the tmp object -- the clone will have a
// different reference
console.log(tmp === Ul.clone(tmp));
merge(dst, src)One-level merge. Faster than deepMerge.
dst: The destination object.src: The source object (usually defaults).deepMerge()Recursively merges the objects from the arguments, returning a new object.
Usage: Ul.deepMerge(obj1, obj2, obj3, obj4, ..., objN)
clone(item)Creates a deep clone of the provided item.
item: The item that should be clonedhome()Gets the home directory path on any platform. The value can also be
accessed using Ul.HOME_DIR.
There are few ways to get help:
Have an idea? Found a bug? See how to contribute.
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Starring and sharing the projects you like :rocket:
—I love books! I will remember you after years if you buy me one. :grin: :book:
—You can make one-time donations via PayPal. I'll probably buy a
coffee tea. :tea:
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
Thanks! :heart:
Bitcoin—You can send me bitcoins at this address (or scanning the code below): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
