outer-join-by
v1.1.4
Published
Outer join two arrays of object by a key, and return a correct typed array of objects
Downloads
4
Readme
outer-join-by
Outer join two arrays of object by a key, and return a correct typed array of objects.
Usage
import { deepStrictEqual } from "assert";
import outerJoinBy from ".";
it("join by name", () => {
const subscribers = [
{ email: "[email protected]", name: "snomiao", joinAt: +new Date("2022-06-14T02:56:57.749Z") },
];
const likes = [{ name: "snomiao", like: ["coding", "reading", "parkour"] }];
const expected = [
{
email: "[email protected]",
name: "snomiao",
like: ["coding", "reading", "parkour"],
joinAt: +new Date("2022-06-14T02:56:57.749Z"),
},
];
const result = outerJoinBy("name", subscribers, likes);
deepStrictEqual(result, expected);
});
About
License
GPLv3 - The GNU General Public License v3.0 - GNU Project - Free Software Foundation
Author
Author: snomiao [email protected] Website: snomiao.com
Sponsors
- None yet.
Claim your sponsorship by donating snomiao <Email: [email protected]>
Contribute
The main repo is in here, any issue and PR's welcome.