Skip to content

Commit 67c2291

Browse files
committed
feat: update unassert to 2.0.0
1 parent dc086e1 commit 67c2291

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
'use strict';
1313

14-
const unassert = require('unassert');
14+
const { unassertAst } = require('unassert');
1515
const through = require('through2');
1616
const PluginError = require('plugin-error');
1717
const BufferStreams = require('bufferstreams');
@@ -41,8 +41,8 @@ function applyUnassertWithSourceMap (file, encoding, opt) {
4141
const inMap = file.sourceMap;
4242
const code = file.contents.toString(encoding);
4343

44-
const ast = acorn.parse(code, { ecmaVersion: 2020, sourceType: 'module', locations: true });
45-
const instrumented = escodegen.generate(unassert(ast), {
44+
const ast = acorn.parse(code, { ecmaVersion: 'latest', sourceType: 'module', locations: true });
45+
const instrumented = escodegen.generate(unassertAst(ast), {
4646
file: file.relative,
4747
sourceMap: file.relative,
4848
sourceMapWithCode: true
@@ -70,8 +70,8 @@ function applyUnassertWithSourceMap (file, encoding, opt) {
7070
}
7171

7272
function applyUnassertWithoutSourceMap (code) {
73-
const ast = acorn.parse(code, { ecmaVersion: 2020, sourceType: 'module' });
74-
return escodegen.generate(unassert(ast));
73+
const ast = acorn.parse(code, { ecmaVersion: 'latest', sourceType: 'module' });
74+
return escodegen.generate(unassertAst(ast));
7575
}
7676

7777
function transform (file, encoding, opt) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy