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

create-error-types

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-error-types - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

39

build/src/main.d.ts

@@ -1,4 +0,13 @@

import { ErrorName, OnCreate, ErrorType, ErrorParams } from 'error-type'
import {
ErrorName,
OnCreate,
ErrorInstance,
ErrorConstructor,
ErrorParams,
} from 'error-type'
export interface Options<T extends ErrorParams = ErrorParams> {
export interface Options<
ErrorNamesArg extends ErrorName = ErrorName,
ErrorParamsArg extends ErrorParams = ErrorParams,
> {
/**

@@ -32,3 +41,3 @@ * URL where users should report internal errors/bugs.

*/
onCreate?: OnCreate<T>
onCreate?: OnCreate<ErrorNamesArg, ErrorParamsArg>
}

@@ -50,4 +59,7 @@

*/
export type Result<T extends ErrorParams = ErrorParams> = {
[errorName in ErrorName]: typeof ErrorType<T>
export type Result<
ErrorNamesArg extends ErrorName = ErrorName,
ErrorParamsArg extends ErrorParams = ErrorParams,
> = {
[errorName in ErrorNamesArg]: ErrorConstructor<errorName, ErrorParamsArg>
} & {

@@ -74,3 +86,9 @@ /**

export type { ErrorName, OnCreate, ErrorType, ErrorParams }
export type {
ErrorName,
OnCreate,
ErrorInstance,
ErrorConstructor,
ErrorParams,
}

@@ -90,4 +108,7 @@ /**

*/
export default function createErrorTypes<T extends ErrorParams = ErrorParams>(
options?: Options<T>,
): Result<T>
export default function createErrorTypes<
ErrorNamesArg extends ErrorName = ErrorName,
ErrorParamsArg extends ErrorParams = ErrorParams,
>(
options?: Options<ErrorNamesArg, ErrorParamsArg>,
): Result<ErrorNamesArg, ErrorParamsArg>
{
"name": "create-error-types",
"version": "1.0.5",
"version": "1.0.6",
"type": "module",

@@ -49,3 +49,3 @@ "exports": "./build/src/main.js",

"dependencies": {
"error-type": "^1.3.1",
"error-type": "^2.0.0",
"is-plain-obj": "^4.1.0",

@@ -52,0 +52,0 @@ "normalize-exception": "^1.6.0"

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