🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@robinpath/assert

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@robinpath/assert

Testing assertions: equal, deepEqual, truthy, falsy, type checks, includes, matches, throws, and more

latest
npmnpm
Version
0.3.0
Version published
Weekly downloads
27
-22.86%
Maintainers
4
Weekly downloads
 
Created
Source

@robinpath/assert

Testing assertions: equal, deepEqual, truthy, falsy, type checks, includes, matches, throws, and more

Category Functions Auth License

Why use this module?

The assert module lets you:

  • Assert two values are strictly equal (===)
  • Assert two values are not equal
  • Assert deep equality of two values
  • Assert value is truthy
  • Assert value is falsy

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

robinpath add @robinpath/assert

Quick Start

No credentials needed — start using it right away:

assert.notEqual $a $b

Available Functions

FunctionDescription
assert.equalAssert two values are strictly equal (===)
assert.notEqualAssert two values are not equal
assert.deepEqualAssert deep equality of two values
assert.truthyAssert value is truthy
assert.falsyAssert value is falsy
assert.isNullAssert value is null or undefined
assert.isNotNullAssert value is not null/undefined
assert.isTypeAssert typeof value matches expected type
assert.includesAssert array/string includes a value
assert.matchesAssert string matches a regex pattern
assert.throwsAssert that a function throws
assert.lengthOfAssert array/string has specific length
assert.hasPropertyAssert object has a specific property
assert.isAboveAssert number is above threshold
assert.isBelowAssert number is below threshold

Examples

Assert two values are not equal

assert.notEqual $a $b

Assert deep equality of two values

assert.deepEqual $obj1 $obj2

Assert value is truthy

assert.truthy $val

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/assert";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  assert.notEqual $a $b
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

License

MIT

Keywords

assert

FAQs

Package last updated on 06 May 2026

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