Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import {
```typescript
import type {
CallSite, // NodeJS.CallSite
Func, // (...args: any[]) => any
Options, // @mnrendra/stack-trace options
SkippedStacks, // @mnrendra/validate-skipped-stacks input
ValidSkippedStacks // @mnrendra/validate-skipped-stacks output
Expand Down
3,621 changes: 1,699 additions & 1,922 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export {

export type {
CallSite,
Func,
Options
} from './types'

Expand Down
8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { CallSite, Options } from './types'
import type { CallSite, Func, Options } from './types'

import { createTarget } from './utils'

/**
* A utility to enable stack tracing of the `NodeJs.CallSite` object, allowing
* dynamic tracing of invocations.
*
* @param {Function|null} [targetFunction] - An optional function to serve as
* the target.
* @param {Func|null} [targetFunction] - An optional function to serve as the
* target.
* @param {Options} [options] - An optional set of options to configure the
* output.
*
Expand All @@ -16,7 +16,7 @@ import { createTarget } from './utils'
* @see https://github.com/mnrendra/stack-trace#readme
*/
const main = (
targetFunction?: Function | null,
targetFunction?: Func | null,
{
limit = 10
}: Options = {
Expand Down
1 change: 1 addition & 0 deletions src/types/Func.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type Func = (...args: any[]) => any
9 changes: 6 additions & 3 deletions src/types/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ export interface Options {
/**
* The `Error.stackTraceLimit` property specifies the number of stack frames
* collected by a stack trace.
*
* The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.
*
* If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
* The default value is `10` but may be set to any valid JavaScript number.
* Changes will affect any stack trace captured after the value has been
* changed.
*
* If set to a non-number value, or set to a negative number, stack traces
* will not capture any frames.
*
* @default 10
*
Expand Down
2 changes: 2 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { CallSite } from './CallSite'
import type { Func } from './Func'
import type { Options } from './Options'
import type { Target } from './Target'

export type {
CallSite,
Func,
Options,
Target
}