
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@crbroughton/msw-builder
Advanced tools
A small set of helper functions for Mock Service Worker (MSW)
msw-builder is a helper library that exposes small functions when
working with Mock Service Worker (MSW) & Zod. These helper functions
utilise ts-deepmerge
. The supplied schema is used as a base,
then merged with whatever overrides you wish to supply.
The goal of this library is to simplfy MSW mocking patterns, especially copy-pasta mocking of JSON responses.
To use, simply define your zod schema (ensure you parse at the end):
const singleObjSchema = z.object({
id: z.number().default(1),
}).parse({})
Once defined, you can use any of the following functions:
// creates a single object from the schema
const { create } = mswBuilder(singleObjSchema)
const result = create({ id: 1 }) // is a single object
// creates an array
const { createArray } = mswBuilder(singleObjSchema)
const result = createArray(2, { id: 2 }) // is an array of 2 results
// creates an unique array (probably the most helpful for mocking)
const { createUniArray } = mswBuilder(singleObjSchema)
const result = createUniArray([
{
id: 2,
},
{
id: 3,
},
])
To install dependencies:
bun install
This project was created using bun init
in bun v1.0.0. Bun is a fast all-in-one JavaScript runtime.
FAQs
A small set of helper functions for Mock Service Worker (MSW)
We found that @crbroughton/msw-builder 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.