Socket
Socket
Sign inDemoInstall

http-assert-plus

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.1.0

assert.d.ts

2

assert.js

@@ -106,3 +106,3 @@ function assert(value, err) {

assert(items && typeof items.includes === 'function', new TypeError('Expected first arg to have an includes method'));
assert(items.includes(item) === false, prepareErr(notIncludes, defaults, ...err));
assert(!items.includes(item), prepareErr(notIncludes, defaults, ...err));
};

@@ -109,0 +109,0 @@

{
"name": "http-assert-plus",
"version": "1.0.4",
"version": "1.1.0",
"description": "More assertions with status codes",

@@ -12,9 +12,10 @@ "main": "./assert.js",

},
"repository": "https://github.com/someimportantcompany/http-assert-plus",
"homepage": "https://github.com/someimportantcompany/http-assert-plus#readme",
"bugs": "https://github.com/someimportantcompany/http-assert-plus/issues",
"repository": "https://github.com/jdrydn/http-assert-plus",
"homepage": "https://github.com/jdrydn/http-assert-plus#readme",
"bugs": "https://github.com/jdrydn/http-assert-plus/issues",
"author": "jdrydn <james@jdrydn.com> (https://jdrydn.com)",
"license": "MIT",
"files": [
"assert.js"
"assert.js",
"assert.d.ts"
],

@@ -25,6 +26,6 @@ "keywords": [

],
"dependencies": {},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.26.0",
"babel-eslint": "^10.1.0",
"eslint": "^5.16.0",
"eslint": "^6.8.0",
"eslint-plugin-mocha": "^5.3.0",

@@ -37,3 +38,3 @@ "eslint-plugin-sort-requires": "^2.1.0",

"engines": {
"node": ">= 8.0.0",
"node": ">= 12.0.0",
"npm": ">= 6.0.0"

@@ -55,3 +56,3 @@ },

"spec": [
"*.test.js"
"./*.test.js"
],

@@ -62,3 +63,4 @@ "ui": "bdd"

"exclude": [
"*.test.js"
"./*.d.ts",
"./*.test.js"
],

@@ -65,0 +67,0 @@ "reporter": [

# http-assert-plus
[![NPM](https://badge.fury.io/js/http-assert-plus.svg)](https://npm.im/http-assert-plus)
[![CI](https://github.com/someimportantcompany/http-assert-plus/actions/workflows/ci.yml/badge.svg?branch=master&event=push)](https://github.com/someimportantcompany/http-assert-plus/actions/workflows/ci.yml)
[![Coverage](https://coveralls.io/repos/github/someimportantcompany/http-assert-plus/badge.svg)](https://coveralls.io/github/someimportantcompany/http-assert-plus)
[![CI](https://github.com/jdrydn/http-assert-plus/actions/workflows/ci.yml/badge.svg?branch=master&event=push)](https://github.com/jdrydn/http-assert-plus/actions/workflows/ci.yml)
<!-- [![Coverage](https://coveralls.io/repos/github/jdrydn/http-assert-plus/badge.svg)](https://coveralls.io/github/jdrydn/http-assert-plus) -->

@@ -13,3 +13,3 @@ More assertions with status codes.

const username = 'jdrydn';
assert(username === 'someimportantcompany', 403, 'Authorization failed', {
assert(username === 'not-jdrydn', 403, 'Authorization failed', {
code: 'NOT_AUTHORIZED',

@@ -20,3 +20,3 @@ username,

// Error: Authorization failed
// at createErr (http-assert-plus/README.md:13:7) {
// at http-assert-plus/README.md:13:7 {
// code: 'NOT_AUTHORIZED',

@@ -117,3 +117,3 @@ // statusCode: 403,

// Error: Array does not strict-equal
// at REPL:1:27 (http-assert-plus/README.md:113:27) {
// at http-assert-plus/README.md:113:27 {
// statusCode: 400,

@@ -133,1 +133,3 @@ // status: 400,

```
If you don't use a construct such as `new Error`, when reading stacktraces just ignore the first line as it'll always be the `assert` function :wink:
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc