Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed xtend dependency #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ node_js:
- '9'
- '8'
- '6'
- '4'
- '0.12'
- '0.10'
- '0.8'
- '0.6'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Def let’s revert this.

before_install:
- 'nvm install-latest-npm'
install:
Expand Down
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var acorn = require('acorn')
var xtend = require('xtend')

var CJSParser = acorn.Parser
.extend(require('./lib/bigint'))
Expand All @@ -9,7 +8,7 @@ var ESModulesParser = CJSParser

function mapOptions (opts) {
if (!opts) opts = {}
return xtend({
return Object.assign({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the object.assign package if you want back support to 0.6

ecmaVersion: 2019,
allowHashBang: true,
allowReturnOutsideFunction: true
Expand All @@ -21,7 +20,7 @@ function getParser (opts) {
return opts.sourceType === 'module' ? ESModulesParser : CJSParser
}

module.exports = exports = xtend(acorn, {
module.exports = exports = Object.assign({}, acorn, {
parse: function parse (src, opts) {
return getParser(opts).parse(src, mapOptions(opts))
},
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"dependencies": {
"acorn": "^6.0.2",
"acorn-dynamic-import": "^4.0.0",
"acorn-walk": "^6.1.0",
"xtend": "^4.0.1"
"acorn-walk": "^6.1.0"
},
"devDependencies": {
"acorn-bigint": "^0.3.1",
Expand Down