Skip to content

Commit

Permalink
standard
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Feb 1, 2024
1 parent c1754f9 commit 1bde19d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion sloppy-require-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ function parseCJS (src, result) {
const seen = []
const seenAddons = []

let addons = false
let i = src.indexOf('require')
let j = i > -1 ? src.indexOf('/*') : -1

Expand Down
14 changes: 6 additions & 8 deletions test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ test('script that falls back', function (t) {
})

test('detects addons', function (t) {
{
const res = parse(`
const some = require('something')
const addon = require.addon()'
const addon2 = require.addon('./here')
`, 'script')
const res = parse(`
const some = require('something')
const addon = require.addon()'
const addon2 = require.addon('./here')
`, 'script')

t.alike(res.addons.map(a => a.input), ['.', './here'])
}
t.alike(res.addons.map(a => a.input), ['.', './here'])
})

0 comments on commit 1bde19d

Please sign in to comment.