
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@lopatnov/join
Advanced tools
Object join technics.
npm install @lopatnov/join
<script src="https://lopatnov.github.io/join/dist/join.min.js"></script>
import { join, JoinTypes } from "@lopatnov/join";
var library = require("@lopatnov/join");
var join = library.join;
var JoinTypes = library.JoinTypes;
enum JoinTypes {
none = 0b0000,
left = 0b1000, // take unique left object properties
right = 0b0001, // take unique right object properties
innerLeft = 0b0100, // take non-unique (inner) properties from left object
innerRight = 0b0010, // take non-unique (inner) properties from right object
innerJoin = none | innerLeft | innerRight | none, // innerLeft + innerRight = deep merge inner join of two objects
leftJoin = left | innerLeft | innerRight | none,
rightJoin = none | innerLeft | innerRight | right,
fullJoin = left | innerLeft | innerRight | right,
expand = left | none | innerRight | right
}
JoinTypes.expand
is default join type
// 1. Set join Type
function join(joinType?: JoinTypes) => (local function)<TContext>(context: TContext)
// 2. Set context (left object)
(local function)<TContext>(context: TContext) => (local function)<TJoinObject>(joinObject: TJoinObject)
// 3. Set join object (right object) and gets result
(local function)<TJoinObject>(joinObject: TJoinObject): TContext & TJoinObject
const rightJoin = join(JoinTypes.right);
const contextJoinBy = rightJoin({
sample1: "One",
sample2: "Two",
sample3: "Three",
});
const result = contextJoinBy({
sample2: "Dos",
sample3: "Tres",
sample4: "Quatro",
});
console.log(result); // { sample4: "Quatro" }
const leftJoin = join(JoinTypes.left);
const contextJoinBy = leftJoin({
sample1: "One",
sample2: "Two",
sample3: "Three",
});
const result = contextJoinBy({
sample2: "Dos",
sample3: "Tres",
sample4: "Quatro",
});
console.log(result); // { sample1: "One" }
const complexJoin = join(JoinTypes.left | JoinTypes.innerLeft | JoinTypes.right);
const contextJoinBy = complexJoin({
sample1: "One",
sample2: "Two",
sample3: "Three",
});
const result = contextJoinBy({
sample2: "Dos",
sample3: "Tres",
sample4: "Quatro",
});
console.log(result); // {sample1: "One", sample2: "Two", sample3: "Three", sample4: "Quatro"}
const result = join(JoinTypes.innerJoin)({
sample1: "One",
sample2: "Two",
sample3: {
smile: "cheese",
},
})({
sample2: "Dos",
sample3: {
sorrir: "queijo",
},
sample4: "Quatro",
});
console.log(result); // {sample2: "Dos", sample3: {smile: "cheese", sorrir: "queijo"}}
See, how it's working: https://runkit.com/lopatnov/join
Test it with a runkit: https://npm.runkit.com/@lopatnov/join
License Apache-2.0
Copyright 2020–2021 Oleksandr Lopatnov
FAQs
Object join technics
We found that @lopatnov/join 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.