Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@jalik/extend
Advanced tools
A utility to merge objects.
Useful when you need to merge two or more objects into one.
This library is tested with unit tests.
In this example, all objects are merged into the first object, so the first object is modified, if you don't want to modify the object, pass en empty object {}
as the first argument.
Note that objects are merged based on their order, so the 2nd object is merged in the first, then the 3rd is merged in the first, and so on... Keep in mind that first objects may be overridden by following objects.
import {extend} from "@jalik/extend";
const coldColors = {
blue: "#0000FF",
green: "#00FF00"
};
const hotColors = {
red: "#FF0000",
yellow: "#FFF000"
};
const customColors = {
cyan: "#5BF8FF",
pink: "#FF4CFB"
};
// Merge all colors in a new object
const mixedColors = extend({}, hotColors, coldColors, customColors);
In the previous example, all objects were flat, but it works also with deep objects and nested attributes.
import {extendRecursively} from "@jalik/extend";
const colorSet1 = {
cold: {
blue: "#0000FF",
green: "#00FF00"
},
hot: {
red: "#FF0000",
yellow: "#FFF000"
},
custom: {
cyan: "#5BF8FF",
pink: "#FF4CFB"
}
};
const colorSet2 = {
cold: {
blue: "#0011AA",
green: "#00AA11"
},
hot: {
red: "#AA0011",
yellow: "#AAA111"
}
};
// Merge all colors in a new object
const mixedColors = extendRecursively({}, colorSet1, colorSet2);
History of releases is in the changelog.
The code is released under the MIT License.
v1.0.3
FAQs
A utility to merge flat objects.
The npm package @jalik/extend receives a total of 25 weekly downloads. As such, @jalik/extend popularity was classified as not popular.
We found that @jalik/extend demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.