
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@ollopa/trust
Advanced tools
Utility library to add Rust idioms into
npm install @ollopa/trust
yarn add @ollopa/trust
Add "experimentalDecorators": true,
to your tsconfig.json
file.
The purpose of this library is to give Typescript ergonomic Rust idioms.
Please open a RFC issue if an API can be improved in any way.
Very open for suggestions on a better API for this.
WIP. Needs range
, default
, etc.
const token: { type: 'semi' | 'identifier' | 'unknown', value: string } = getToken()
const result = match(token.type,
// match arms
['semi', handleSemi(token)],
['identifier', handleIdentifier(token)],
['unknown', handleUnknown(token)],
)
match
returns an Option
because of limitations with typing. For example...
match('some string',
['yeet', 'yoot']
)
...will never match to anything and therefore will return an Option.None
.
Utility type to create a sum type.
type ASTNode =
Var<'int' | 'string' | 'infix', { token: string }> // the `token` data is common across all nodes
& ( // Enum variants
Var<'int', { value: number }> |
Var<'string', { value: string }> |
Var<'infix', { operator: '+' | '-', left: ASTNode, right: ASTNode }>
)
FAQs
Rust idioms in Typescript
The npm package @ollopa/trust receives a total of 1,925 weekly downloads. As such, @ollopa/trust popularity was classified as popular.
We found that @ollopa/trust 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.