Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to ESM
Browse files Browse the repository at this point in the history
This updates the package to use EMS modules and require a minimum of
node 12.
stianjensen committed Jan 17, 2022
1 parent 536b9a2 commit b3bc257
Showing 17 changed files with 991 additions and 1,147 deletions.
11 changes: 4 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
'use strict';

const escapeStringRegexp = require('escape-string-regexp');
import escapeStringRegexp from 'escape-string-regexp';
import { builtinModules } from 'module';

const cwd = typeof process === 'object' && process && typeof process.cwd === 'function'
? process.cwd()
: '.'

const natives = [].concat(
require('module').builtinModules,
builtinModules,
'bootstrap_node',
'node',
).map(n => new RegExp(`(?:\\((?:node:)?${n}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${n}(?:\\.js)?:\\d+:\\d+$)`));
@@ -18,7 +17,7 @@ natives.push(
/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/
);

class StackUtils {
export default class StackUtils {
constructor (opts) {
opts = {
ignoredPackages: [],
@@ -334,5 +333,3 @@ const re = new RegExp(
);

const methodRe = /^(.*?) \[as (.*?)\]$/;

module.exports = StackUtils;
Loading

0 comments on commit b3bc257

Please sign in to comment.