
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.
@types/simple-swizzle
Advanced tools
TypeScript definitions for simple-swizzle
npm install --save @types/simple-swizzle
This package contains type definitions for simple-swizzle (https://github.com/qix-/node-simple-swizzle).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simple-swizzle.
export = swizzle;
/**
* [Swizzle](https://en.wikipedia.org/wiki/Swizzling_(computer_graphics)) your function arguments.
*
* @example
* import swizzle = require('simple-swizzle');
*
* function myFunc(...args: Array<number | number[]>): number[] {
* const argsArr = swizzle(args);
* // ...
* return argsArr;
* }
*
* myFunc(1, [2, 3], 4); // [1, 2, 3, 4]
* myFunc(1, 2, 3, 4); // [1, 2, 3, 4]
* myFunc([1, 2, 3, 4]); // [1, 2, 3, 4]
*/
declare function swizzle<TElement extends unknown>(arguments: ArrayLike<TElement | ArrayLike<TElement>>): TElement[];
declare namespace swizzle {
/**
* Functions can also be wrapped to automatically swizzle arguments and be passed the resulting array.
*
* @example
* import swizzle = require('simple-swizzle');
*
* const swizzledFn = swizzle.wrap((args: number[]): number[] {
* // ...
* return args;
* });
*
* swizzledFn(1, [2, 3], 4); // [1, 2, 3, 4]
* swizzledFn(1, 2, 3, 4); // [1, 2, 3, 4]
* swizzledFn([1, 2, 3, 4]); // [1, 2, 3, 4]
*/
function wrap<TFn extends (arguments: any[]) => unknown>(
fn: TFn,
): (
...args: Parameters<TFn>[0] extends Array<infer TElement> ? Array<TElement | TElement[]> : never
) => ReturnType<TFn>;
}
These definitions were written by BendingBender.
FAQs
TypeScript definitions for simple-swizzle
We found that @types/simple-swizzle 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.