Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@seda-protocol/utils
Advanced tools
This library contains utility functions that are used throughout SEDA Typescript projects. It's part of the explorer monorepo as this tends to use most of the code which makes testing it a little easier.
This library contains utility functions that are used throughout SEDA Typescript projects. It's part of the explorer monorepo as this tends to use most of the code which makes testing it a little easier.
There are two main entrypoints to this library:
@seda-protocol/utils
The @seda-protocol/utils
entrypoint contains the main library code and types. You can import it into the application code directly and make use of the provided functions.
Example:
import { tryAsync } from "@seda-protocol/utils";
const result = await tryAsync(async () => {
const response = await fetch("https://api.seda.xyz/v1/health");
return response.json();
});
if (result.isErr) {
console.error(result.error);
return;
}
// Safe to access the value
const data = result.value;
@seda-protocol/utils/testing
The @seda-protocol/utils/testing
entrypoint contains custom matchers which can be used in tests. Most likely you will want to create a setup.ts
file which will import this library and pass that file to Bun's test runner with the --preload
flag.
Example:
// setup.ts
import "@seda-protocol/utils/testing";
bun test --preload=./setup.ts
In addition to the matchers this entrypoint also exports other utilities which might be useful in tests.
Example:
import { unwrapResult } from "@seda-protocol/utils/testing";
const result = doCoolThingWhichMightFail();
// Directly access the value, will fail if the result is an error
const value = unwrapResult(result);
As we target Bun as the runtime the library directly exposes the TypeScript files and doesn't any build/transpilation step.
This library should list dependencies as peerDependencies. This allows consuming projects to have more control over the dependency versions.
FAQs
This library contains utility functions that are used throughout SEDA Typescript projects. It's part of the explorer monorepo as this tends to use most of the code which makes testing it a little easier.
We found that @seda-protocol/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.