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

@types/empower

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/empower

TypeScript definitions for empower

  • 1.2.33
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34K
increased by17.85%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/empower

Summary

This package contains type definitions for empower (https://github.com/power-assert-js/empower).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/empower.

index.d.ts

// Type definitions for empower 1.2
// Project: https://github.com/power-assert-js/empower
// Definitions by: vvakame <https://github.com/vvakame>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.5

import { Options as CoreOptions } from "empower-core";
import { Formatter } from "power-assert-formatter";

/**
 * Enhances Power Assert feature to assert function/object.
 *
 * @param originalAssert An instance of standard `assert` function or any assert-like object to enhance.
 * @param formatter A formatter function created by power-assert-formatter.
 * @param options Configuration options. If not passed, default options will be used.
 * @return Enhanced assert function/object.
 */
declare function empower<T>(originalAssert: T, formatter: Formatter, options?: empower.Options): T;

declare namespace empower {
    // The omitted options can be provided, but they will be always overridden.
    type Options = Omit<CoreOptions, "modifyMessageBeforeAssert" | "onError"> & {
        /**
         * If truthy, modify message property of `AssertionError` on rethrow.
         *
         * @default false
         */
        modifyMessageOnRethrow?: boolean | undefined;
        /**
         * If truthy, add `powerAssertContext` property to `AssertionError` on rethrow.
         *
         * @default false
         */
        saveContextOnRethrow?: boolean | undefined;
    };

    /**
     * Returns default options object for `empower` function.
     */
    function defaultOptions(): Required<Options>;
}

export = empower;

Additional Details

Credits

These definitions were written by vvakame.

FAQs

Package last updated on 23 Sep 2023

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

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