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 #40

Merged
merged 1 commit into from
Jan 10, 2019
Merged
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: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

var defaultOptions = require('./lib/default-options');
var Instrumentor = require('./lib/instrumentor');
var extend = require('xtend');

/**
* Instrument power assert feature into code. ECMAScript AST in, ECMAScript AST out.
Expand All @@ -24,7 +23,7 @@ var extend = require('xtend');
* @throws {EspowerError} if `options` is not valid
*/
function espower (ast, options) {
var instrumentor = new Instrumentor(extend(defaultOptions(), options));
var instrumentor = new Instrumentor(Object.assign(defaultOptions(), options));
return instrumentor.instrument(ast);
}

Expand All @@ -39,7 +38,7 @@ function espower (ast, options) {
* @throws {EspowerError} if `options` is not valid
*/
espower.createVisitor = function createVisitor (ast, options) {
var instrumentor = new Instrumentor(extend(defaultOptions(), options));
var instrumentor = new Instrumentor(Object.assign(defaultOptions(), options));
return instrumentor.createVisitor(ast);
};

Expand Down
3 changes: 1 addition & 2 deletions lib/instrumentor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var Transformation = require('./transformation');
var EspowerError = require('./espower-error');
var typeName = require('type-name');
var find = require('array-find');
var extend = require('xtend');


function Instrumentor (options) {
Expand Down Expand Up @@ -60,7 +59,7 @@ Instrumentor.prototype.createVisitor = function (ast) {
var matcher = find(that.matchers, function (matcher) { return matcher.test(currentNode); });
if (matcher) {
// entering target assertion
assertionVisitor = new AssertionVisitor(matcher, extend({
assertionVisitor = new AssertionVisitor(matcher, Object.assign({
storage: storage,
transformation: transformation,
globalScope: globalScope,
Expand Down
Loading