![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
@openally/result
Advanced tools
Readme
[WIP] Another Rust's Result implementation (inspired by ts-results)
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
$ npm i @openally/result
# or
$ yarn add @openally/result
import fs from "node:fs";
import { Result, Ok, Err } from "@openally/result";
function readFile(path: string): Result<string, "invalid path"> {
if (existsSync(path)) {
return Ok(fs.readFileSync(path, "utf8"));
}
return Err("invalid path");
}
const fileContentStr = readFile("test.txt").unwrap();
console.log(fileContentStr);
Unwrap value (throw if error).
Ok(1).unwrap(); // 1
Err("oops").unwrap(); // Error: Tried to unwrap Error: oops
Unwrap with a default value (if an error is detected).
Ok(1).unwrapOr(5); // 1
Err("oops").unwrapOr(5); // 5
Map for an Ok value.
Ok(1)
.map((v) => v + 1)
.unwrap(); // 2
Map for an Error value.
Ok(1)
.andThen((value) => Ok(value + 1))
.unwrap(); // 2
MIT
FAQs
Another inspired Rust's Result implementation.
The npm package @openally/result receives a total of 705 weekly downloads. As such, @openally/result popularity was classified as not popular.
We found that @openally/result demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.