Skip to content

Commit d9d9195

Browse files
committedSep 27, 2022
Require Node.js 14
1 parent 03ca45e commit d9d9195

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed
 

Diff for: ‎.github/workflows/main.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13+
- 18
14+
- 16
1315
- 14
14-
- 12
1516
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-node@v2
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-node@v3
1819
with:
1920
node-version: ${{ matrix.node-version }}
2021
- run: npm install

Diff for: ‎index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export interface Options {
1+
export type Options = {
22
/**
33
Prettify the file paths in the stack:
44
@@ -16,7 +16,7 @@ export interface Options {
1616
`/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15` → `unicorn.js:2:15`
1717
*/
1818
readonly basePath?: string;
19-
}
19+
};
2020

2121
/**
2222
Clean up error stack traces. Removes the mostly unhelpful internal Node.js entries.

Diff for: ‎index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os from 'os';
1+
import os from 'node:os';
22
import escapeStringRegexp from 'escape-string-regexp';
33

44
const extractPathRegex = /\s+at.*[(\s](.*)\)?/;
@@ -24,10 +24,10 @@ export default function cleanStack(stack, {pretty = false, basePath} = {}) {
2424

2525
// Electron
2626
if (
27-
match.includes('.app/Contents/Resources/electron.asar') ||
28-
match.includes('.app/Contents/Resources/default_app.asar') ||
29-
match.includes('node_modules/electron/dist/resources/electron.asar') ||
30-
match.includes('node_modules/electron/dist/resources/default_app.asar')
27+
match.includes('.app/Contents/Resources/electron.asar')
28+
|| match.includes('.app/Contents/Resources/default_app.asar')
29+
|| match.includes('node_modules/electron/dist/resources/electron.asar')
30+
|| match.includes('node_modules/electron/dist/resources/default_app.asar')
3131
) {
3232
return false;
3333
}

Diff for: ‎index.test-d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ if (error.stack) {
77
expectType<string>(cleanStack(error.stack));
88
expectType<string>(cleanStack(error.stack, {pretty: true}));
99
expectType<string>(cleanStack(error.stack, {basePath: 'foo'}));
10-
// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
1110
expectType<undefined>(cleanStack(undefined));
1211
}

Diff for: ‎package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
},
1313
"type": "module",
1414
"exports": "./index.js",
15+
"types": "./index.d.ts",
1516
"engines": {
16-
"node": ">=12"
17+
"node": ">=14.16"
1718
},
1819
"scripts": {
1920
"test": "xo && ava && tsd"
@@ -34,9 +35,9 @@
3435
"escape-string-regexp": "5.0.0"
3536
},
3637
"devDependencies": {
37-
"ava": "^3.15.0",
38-
"tsd": "^0.14.0",
39-
"xo": "^0.38.2"
38+
"ava": "^4.3.3",
39+
"tsd": "^0.24.1",
40+
"xo": "^0.52.3"
4041
},
4142
"browser": {
4243
"os": false

Diff for: ‎readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Also works in Electron.
88

99
## Install
1010

11-
```
12-
$ npm install clean-stack
11+
```sh
12+
npm install clean-stack
1313
```
1414

1515
## Usage

Diff for: ‎test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os from 'os';
1+
import os from 'node:os';
22
import test from 'ava';
33
import cleanStack from './index.js';
44

0 commit comments

Comments
 (0)
Please sign in to comment.