stack-utils: Add ignoredPackages to options and bump version (#46815)

* stack-utils: Add `ignoredPackages` to options

* Update index.d.ts

* Update stack-utils-tests.ts
This commit is contained in:
Cameron Little 2020-09-21 21:18:47 +02:00 committed by GitHub
parent 3900b3a45d
commit eaf94a92b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
// Type definitions for stack-utils 1.0
// Type definitions for stack-utils 2.0
// Project: https://github.com/tapjs/stack-utils#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@ -21,6 +21,7 @@ declare class StackUtils {
declare namespace StackUtils {
interface Options {
internals?: RegExp[];
ignoredPackages?: string[];
cwd?: string;
wrapCallSite?(callSite: CallSite): CallSite;
}

View File

@ -1,7 +1,7 @@
/// <reference types="node" />
import StackUtils = require('stack-utils');
const stack = new StackUtils({cwd: process.cwd(), internals: StackUtils.nodeInternals()});
const stack = new StackUtils({cwd: process.cwd(), internals: StackUtils.nodeInternals(), ignoredPackages: ["foobar"]});
const stackStr = new Error().stack;
if (stackStr) {