Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Mendoza decoder in TypeScript.
npm install mendoza
or
pnpm install mendoza
or
yarn add mendoza
Basic example:
import {applyPatch} from "mendoza"
let left = {…};
let patch = […];
let right = applyPatch(left, patch);
Incremental patcher:
import {incremental} from "mendoza"
const {Value, rebaseValue, wrap, unwrap, getType, applyPatch} = incremental
// Create an empty initial version:
const ROOT = wrap(null, null);
// Input of patches:
let patches = […];
// `origin` can be whatever you want to identify where a change comes from:
let origin = 0;
// Reference to the latest version:
let value = ROOT;
// Rebasing is for maintaing history across deleted versions:
let rebaseTarget;
for (let patch of patches) {
// Apply the patch:
let newValue = applyPatch(value, patch, origin);
// Rebase if needed:
if (rebaseTarget) {
newValue = rebaseValue(rebaseTarget, newValue);
}
// If the document was deleted, store the previous version so we can rebase:
if (getType(newValue) === "null") {
rebaseTarget = value;
} else {
rebaseTarget = null;
}
value = newValue;
origin++;
}
// Return the final full object:
console.log(unwrap(value));
MIT © Sanity.io
Run the "CI & Release" workflow. Make sure to select the main branch and check "Release new version".
Semantic release will only release on configured branches, so it is safe to run release on any branch.
FAQs
Mendoza, differ for structured documents
The npm package mendoza receives a total of 102,965 weekly downloads. As such, mendoza popularity was classified as popular.
We found that mendoza demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 64 open source maintainers 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.