
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.
iron-oxide
Advanced tools
Rust style exception handling in TypeScript
Documentation is hosted as an mdbook at iron-oxide.js.org.
An Option
represents success or the presence of a value. It comes in two variants:
None
to indicate failure or the lack of a valueSome(value)
to indicate the presence of the given valueExample:
import { Option, None, Some } from 'iron-oxide';
function find<T>(array: T[], predicate: (el: T) => boolean): Option<T> {
for (const el of array) {
if (predicate(el)) {
return Some(el);
}
}
return None();
}
A Result
is like Option
, but it also can represent the failure state with a reason. It also comes in two variants:
Err(error)
to indicate an error state, along with a message of whyOk(value)
to indicate the success stateExample:
import { Result, Ok, Err } from 'iron-oxide';
function parseInt(n: string, radix: number = 10): Result<number, string> {
const value = Number.parseInt(n, radix);
if (isNaN(value)) {
return Err(`Unable to parse ${n} as an integer`);
}
return Ok(value);
}
A match
statement is like a switch statement on steroids. It can be used similarly to switch, but works with more than just primitive values. Namely, you can hand it a primitive value, an object, an array, or a function which returns a boolean.
import { match } from 'iron-oxide';
function isEvenOrOdd(n: number) {
return match (n, [
[0, () => 'neitherEvenNorOdd'],
[x => x % 2 === 0, () => 'even'],
[x => x % 2 !== 0, () => 'odd']
]);
}
FAQs
Rust style exception handling in TypeScript
The npm package iron-oxide receives a total of 0 weekly downloads. As such, iron-oxide popularity was classified as not popular.
We found that iron-oxide 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.