Comparing version 0.2.3 to 0.2.4
declare type Interceptor<Args extends any[], ReturnType, ContextType> = { | ||
/** An optional name for the interceptor */ | ||
name?: string; | ||
/** Callback for each loop when used by the hook */ | ||
loop?: (...args: Args) => void; | ||
/** Callback when an error occurs during the hook's call */ | ||
error?: (err: Error) => void; | ||
/** Callback when a result is found for a hook's invocation */ | ||
result?: (r: ReturnType extends Promise<infer AwaitedValue> ? AwaitedValue : ReturnType) => void; | ||
/** Callback when a hook's call is complete */ | ||
done?: () => void; | ||
/** Callback when a hook is tapped */ | ||
tap?: (tap: Tap<Args, ReturnType, ContextType>) => void; | ||
} & ({ | ||
/** If context should be omitted from the 'call'. This is the default */ | ||
context?: false; | ||
/** Callback when the hook is tapped without context */ | ||
call?: (...args: Args) => void; | ||
} | { | ||
/** If context should be included in the 'call' */ | ||
context: true; | ||
/** Callback when the hook is tapped with context */ | ||
call?: (context: ContextType, ...args: Args) => void; | ||
}); | ||
declare type Tap<Args extends any[], ReturnType, ContextType = unknown> = { | ||
key: Symbol; | ||
key: symbol; | ||
name: string; | ||
@@ -43,2 +53,3 @@ before?: string | Array<string>; | ||
} | ||
/** A manager for all intercepts inside of a tap */ | ||
declare class InterceptionManager<Args extends any[], ReturnType, ContextType = Record<string, any>> { | ||
@@ -45,0 +56,0 @@ protected interceptions: Array<Interceptor<Args, ReturnType, ContextType>>; |
@@ -8,5 +8,4 @@ 'use strict'; | ||
return check.includes(value); | ||
} else { | ||
return check === value; | ||
} | ||
return check === value; | ||
} | ||
@@ -13,0 +12,0 @@ |
{ | ||
"name": "tapable-ts", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "A TS implementation of tapable", | ||
@@ -10,3 +10,7 @@ "main": "./dist/hooks.js", | ||
"build": "rollup -c", | ||
"test": "jest" | ||
"test": "jest", | ||
"release": "auto shipit -vv", | ||
"labelCheck": "auto pr-check", | ||
"lint": "eslint src --cache", | ||
"prepare": "is-ci || husky install" | ||
}, | ||
@@ -38,5 +42,12 @@ "files": [ | ||
"devDependencies": { | ||
"@design-systems/eslint-config": "^2.17.8", | ||
"@types/jest": "^27.5.0", | ||
"auto": "10.31.0", | ||
"esbuild": "^0.14.38", | ||
"husky": "^7.0.0", | ||
"is-ci": "^3.0.0", | ||
"jest": "^28.1.0", | ||
"jest-junit": "^15.0.0", | ||
"lint-staged": "^11.0.0", | ||
"prettier": "^2.3.2", | ||
"rollup": "^2.72.1", | ||
@@ -43,0 +54,0 @@ "rollup-plugin-dts": "^4.2.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80020
778
740
16