@tapjs/intercept
Advanced tools
Comparing version 0.0.0-4 to 0.0.0-5
@@ -149,2 +149,6 @@ import { TapPlugin, TestBase } from '@tapjs/core'; | ||
}; | ||
/** | ||
* Implementation class providing the {@link Interceptor#intercept}, | ||
* {@link Interceptor#capture}, and {@link Interceptor#captureFn} methods. | ||
*/ | ||
export declare class Interceptor { | ||
@@ -154,3 +158,9 @@ #private; | ||
/** | ||
* Intercept and track object property sets and gets | ||
* Intercept and track object property sets and gets. | ||
* | ||
* If a PropertyDescriptor is set, then it will be used as the replacement | ||
* value. Otherwise, the original descriptor will be used. | ||
* | ||
* If the `strictMode` param is set, then attempts to write to read-only | ||
* properties will throw an error. | ||
*/ | ||
@@ -178,2 +188,5 @@ intercept<T extends object>(obj: T, prop: keyof T, desc?: PropertyDescriptor, strictMode?: boolean): InterceptResultsMethod; | ||
* The results hang off the function as the 'calls' property. | ||
* | ||
* The added `fn.args()` method will return an array of the arguments | ||
* passed to each call since the last time it was inspected. | ||
*/ | ||
@@ -185,3 +198,6 @@ captureFn<F extends (this: any, ...a: any[]) => any>(original: F): ((...a: any[]) => any) & { | ||
} | ||
/** | ||
* plugin method that instantiates an {@link Interceptor} | ||
*/ | ||
export declare const plugin: TapPlugin<Interceptor>; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,2 +6,6 @@ "use strict"; | ||
const stack_1 = require("@tapjs/stack"); | ||
/** | ||
* Implementation class providing the {@link Interceptor#intercept}, | ||
* {@link Interceptor#capture}, and {@link Interceptor#captureFn} methods. | ||
*/ | ||
class Interceptor { | ||
@@ -13,3 +17,9 @@ #t; | ||
/** | ||
* Intercept and track object property sets and gets | ||
* Intercept and track object property sets and gets. | ||
* | ||
* If a PropertyDescriptor is set, then it will be used as the replacement | ||
* value. Otherwise, the original descriptor will be used. | ||
* | ||
* If the `strictMode` param is set, then attempts to write to read-only | ||
* properties will throw an error. | ||
*/ | ||
@@ -192,2 +202,5 @@ intercept(obj, prop, desc, strictMode = true) { | ||
* The results hang off the function as the 'calls' property. | ||
* | ||
* The added `fn.args()` method will return an array of the arguments | ||
* passed to each call since the last time it was inspected. | ||
*/ | ||
@@ -221,4 +234,7 @@ captureFn(original) { | ||
exports.Interceptor = Interceptor; | ||
/** | ||
* plugin method that instantiates an {@link Interceptor} | ||
*/ | ||
const plugin = t => new Interceptor(t); | ||
exports.plugin = plugin; | ||
//# sourceMappingURL=index.js.map |
@@ -149,2 +149,6 @@ import { TapPlugin, TestBase } from '@tapjs/core'; | ||
}; | ||
/** | ||
* Implementation class providing the {@link Interceptor#intercept}, | ||
* {@link Interceptor#capture}, and {@link Interceptor#captureFn} methods. | ||
*/ | ||
export declare class Interceptor { | ||
@@ -154,3 +158,9 @@ #private; | ||
/** | ||
* Intercept and track object property sets and gets | ||
* Intercept and track object property sets and gets. | ||
* | ||
* If a PropertyDescriptor is set, then it will be used as the replacement | ||
* value. Otherwise, the original descriptor will be used. | ||
* | ||
* If the `strictMode` param is set, then attempts to write to read-only | ||
* properties will throw an error. | ||
*/ | ||
@@ -178,2 +188,5 @@ intercept<T extends object>(obj: T, prop: keyof T, desc?: PropertyDescriptor, strictMode?: boolean): InterceptResultsMethod; | ||
* The results hang off the function as the 'calls' property. | ||
* | ||
* The added `fn.args()` method will return an array of the arguments | ||
* passed to each call since the last time it was inspected. | ||
*/ | ||
@@ -185,3 +198,6 @@ captureFn<F extends (this: any, ...a: any[]) => any>(original: F): ((...a: any[]) => any) & { | ||
} | ||
/** | ||
* plugin method that instantiates an {@link Interceptor} | ||
*/ | ||
export declare const plugin: TapPlugin<Interceptor>; | ||
//# sourceMappingURL=index.d.ts.map |
import { plugin as TeardownPlugin } from '@tapjs/after'; | ||
import { at, captureString } from '@tapjs/stack'; | ||
/** | ||
* Implementation class providing the {@link Interceptor#intercept}, | ||
* {@link Interceptor#capture}, and {@link Interceptor#captureFn} methods. | ||
*/ | ||
export class Interceptor { | ||
@@ -9,3 +13,9 @@ #t; | ||
/** | ||
* Intercept and track object property sets and gets | ||
* Intercept and track object property sets and gets. | ||
* | ||
* If a PropertyDescriptor is set, then it will be used as the replacement | ||
* value. Otherwise, the original descriptor will be used. | ||
* | ||
* If the `strictMode` param is set, then attempts to write to read-only | ||
* properties will throw an error. | ||
*/ | ||
@@ -188,2 +198,5 @@ intercept(obj, prop, desc, strictMode = true) { | ||
* The results hang off the function as the 'calls' property. | ||
* | ||
* The added `fn.args()` method will return an array of the arguments | ||
* passed to each call since the last time it was inspected. | ||
*/ | ||
@@ -216,3 +229,6 @@ captureFn(original) { | ||
} | ||
/** | ||
* plugin method that instantiates an {@link Interceptor} | ||
*/ | ||
export const plugin = t => new Interceptor(t); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@tapjs/intercept", | ||
"version": "0.0.0-4", | ||
"version": "0.0.0-5", | ||
"description": "a built-in tap extension for t.intercept() and t.capture()", | ||
@@ -47,6 +47,6 @@ "main": "./dist/cjs/index.js", | ||
"peerDependencies": { | ||
"@tapjs/core": "0.0.0-4" | ||
"@tapjs/core": "0.0.0-5" | ||
}, | ||
"dependencies": { | ||
"@tapjs/after": "0.0.0-4", | ||
"@tapjs/after": "0.0.0-5", | ||
"@tapjs/stack": "0.0.0-2" | ||
@@ -53,0 +53,0 @@ }, |
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
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
90546
861
+ Added@tapjs/after@0.0.0-5(transitive)
+ Added@tapjs/core@0.0.0-5(transitive)
+ Added@tapjs/test@0.0.0-5(transitive)
+ Addedtap-parser@14.0.0-0(transitive)
- Removed@tapjs/after@0.0.0-4(transitive)
- Removed@tapjs/core@0.0.0-4(transitive)
- Removed@tapjs/test@0.0.0-4(transitive)
- Removedtap-parser@13.0.2-1(transitive)
Updated@tapjs/after@0.0.0-5