Skip to content

Commit

Permalink
eslint | util._extend is deprecated since 2016
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed Nov 4, 2020
1 parent 52d2171 commit d243266
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
5 changes: 2 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
*/
"use strict";

var Browser = require("./browser"),
const Browser = require("./browser"),
EventEmitter = require("./AwaitEventEmitter"),
debug = require("debug")("phantomas:core"),
loader = require("./loader"),
puppeteer = require("puppeteer"),
path = require("path"),
Results = require("../core/results"),
util = require("util"),
VERSION = require("./../package").version;

/**
Expand All @@ -35,7 +34,7 @@ function phantomas(url, opts) {
debug("URL: <%s>", url);

// options handling
options = util._extend({}, opts || {}); // use util._extend to avoid #563
options = Object.assign({}, opts || {}); // avoid #563
options.url = options.url || url || false;

debug("Options: %s", JSON.stringify(options));
Expand Down
7 changes: 3 additions & 4 deletions lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Handles loading of modules and extensions
*/
const debug = require("debug"),
extend = require("util")._extend,
fs = require("fs");

/**
Expand Down Expand Up @@ -35,7 +34,7 @@ function loadCoreModules(scope) {

modules.forEach((name) => {
var log = debug("phantomas:modules:" + name),
_scope = extend({}, scope);
_scope = Object.extend({}, scope);

_scope.log = log;

Expand All @@ -55,7 +54,7 @@ function loadExtensions(scope) {

extensions.forEach((name) => {
var log = debug("phantomas:extensions:" + name),
_scope = extend({}, scope);
_scope = Object.extend({}, scope);

_scope.log = log;

Expand All @@ -69,7 +68,7 @@ function loadModules(scope) {

extensions.forEach((name) => {
var log = debug("phantomas:modules:" + name),
_scope = extend({}, scope);
_scope = Object.extend({}, scope);

_scope.log = log;

Expand Down
7 changes: 3 additions & 4 deletions test/modules/requestsMonitor-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/**
* Test requestsMonitor core module
*/
var vows = require("vows"),
const vows = require("vows"),
assert = require("assert"),
mock = require("./mock"),
extend = require("util")._extend;
mock = require("./mock");

function sendReq(url, extra) {
return function () {
Expand All @@ -15,7 +14,7 @@ function sendReq(url, extra) {
ret = entry;
});
phantomas.sendRequest(
extend(
Object.extend(
{
url: url,
},
Expand Down

0 comments on commit d243266

Please sign in to comment.