Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

devlop

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devlop - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

4

lib/default.js

@@ -5,4 +5,6 @@ export function deprecate(fn) {

export function equal() {}
export function ok() {}
export function equal() {}
export function unreachable() {}

@@ -71,1 +71,15 @@ /**

): asserts value
/**
* Assert that a code path never happens.
*
* > 👉 **Important**: only asserts when the `development` condition is used,
* > does nothing in production.
*
* @param {Error | string | null | undefined} [message]
* Message for assertion error (default: `'Unreachable'`).
* @returns {never}
* Nothing; always throws.
* @throws {AssertionError}
* Throws when `value` is falsey.
*/
export function unreachable(message?: Error | string | null | undefined): never

@@ -193,2 +193,19 @@ import {dequal} from 'dequal'

/**
* Assert that a code path never happens.
*
* > 👉 **Important**: only asserts when the `development` condition is used,
* > does nothing in production.
*
* @param {Error | string | null | undefined} [message]
* Message for assertion error (default: `'Unreachable'`).
* @returns {never}
* Nothing; always throws.
* @throws {AssertionError}
* Throws when `value` is falsey.
*/
export function unreachable(message) {
assert(false, false, true, 'ok', 'Unreachable', message)
}
/**
* @param {boolean} bool

@@ -195,0 +212,0 @@ * Whether to skip this operation.

{
"name": "devlop",
"version": "1.0.0",
"version": "1.1.0",
"description": "Do things in development and nothing otherwise",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -20,2 +20,3 @@ # devlop

* [`ok(value[, message])`](#okvalue-message)
* [`unreachable(message?)`](#unreachablemessage)
* [Types](#types)

@@ -60,3 +61,3 @@ * [Compatibility](#compatibility)

```js
import {deprecate, equal, ok} from 'https://esm.sh/devlop@1'
import {deprecate, equal, ok, unreachable} from 'https://esm.sh/devlop@1'
// For development code:

@@ -70,3 +71,3 @@ // import {deprecate, equal, ok} from 'https://esm.sh/devlop@1?conditions=development'

<script type="module">
import {deprecate, equal, ok} from 'https://esm.sh/devlop@1?bundle'
import {deprecate, equal, ok, unreachable} from 'https://esm.sh/devlop@1?bundle'
// For development code:

@@ -175,3 +176,3 @@ // import {deprecate, equal, ok} from 'https://esm.sh/devlop@1?bundle&conditions=development'

This package exports the identifiers [`deprecate`][api-deprecate],
[`equal`][api-equal], and [`ok`][api-ok].
[`equal`][api-equal], [`ok`][api-ok], and [`unreachable`][api-unreachable].
There is no default export.

@@ -244,6 +245,3 @@

— value to assert
* `expected` (`unknown`)
— baseline
* `message` (`Error` or `string`, default: default: `'Expected value to be
truthy'`)
* `message` (`Error` or `string`, default: `'Expected value to be truthy'`)
— message for assertion error

@@ -259,2 +257,22 @@

### `unreachable(message?)`
Assert that a code path never happens.
> 👉 **Important**: only asserts when the `development` condition is used,
> does nothing in production.
###### Parameters
* `message` (`Error` or `string`, default: `'Unreachable'`)
— message for assertion error
###### Returns
Never (`never`).
###### Throws
Throws (`AssertionError`), always.
## Types

@@ -347,1 +365,3 @@

[api-ok]: #okvalue-message
[api-unreachable]: #unreachablemessage
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc