Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
github.com/chaijs/assertion-error
AssertionError and AssertionResult classes.
Assertion Error is a module that contains two classes: AssertionError
, which
is an instance of an Error
, and AssertionResult
which is not an instance of
Error.
These can be useful for returning from a function - if the function "succeeds"
return an AssertionResult
and if the function fails return (or throw) an
AssertionError
.
Both AssertionError
and AssertionResult
implement the Result
interface:
interface Result {
name: 'AssertionError' | 'AssertionResult'
ok: boolean
toJSON(...args: unknown[]): Record<string, unknown>
}
So if a function returns AssertionResult | AssertionError
it is easy to check
which one is returned by checking either .name
or .ok
, or check instanceof Error
.
assertion-error
is available on npm.
$ npm install --save assertion-error
assertion_error
is available on Deno.land
import {AssertionError, AssertionResult} from 'https://deno.land/x/assertion_error@2.0.0/mod.ts'
FAQs
Unknown package
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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.