![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@paulpopat/safe-type
Advanced tools
import { Assert, IsObject, IsString, IsType, Checker } from "@paulpopat/safe-type";
function Thing(argument: unknown) {
Assert(argument, IsString);
// We now know this is a string and inference will tell us as much
}
function ThingWithoutException(argument: unknown) {
if (!IsString(argument)) {
console.log("The argument is not a string");
return;
}
// Do something cool
}
// If we want a usable type from a runtime checker then we use IsType
type String = IsType<typeof IsString>;
// If we want to accept a runtime checker as an argument then we have this
function DoSomething<T>(argument: unknown, checker: Checker<T>) {
Assert(argument, checker);
}
DoSomething({ test: "value" }, IsObject({ test: IsString }))
It is as simple as that!
Inference is fully operational, no casting will be required.
Find below a list of all available checkers:
Tools to work with the checkers to allow for type based controls.
FAQs
Typesafety with strong inference
We found that @paulpopat/safe-type 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.