Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@samual/assert

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@samual/assert

Assertion library.

Source
npmnpm
Version
0.0.1-bb57997
Version published
Weekly downloads
17
21.43%
Maintainers
1
Weekly downloads
 
Created
Source

Samual's Assertion Library

Requires Node.js 20.10+, 22.0+, 24.0+, or above.

Example

import { assert, expect } from "@samual/assert"

// Throws if `someValue` is falsy
assert(someValue)

// `expect()` throws if `someOtherValue` is nullish or just returns the value
doSomething(expect(someOtherValue))
// This is like doing `doSomething(someOtherValue!)` in TypeScript but enforced
// in JavaScript

This package is also available on JSR.

Keywords

assertions

FAQs

Package last updated on 15 Dec 2025

Did you know?

Socket

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.

Install

Related posts