Skip to content

Commit

Permalink
Extract isRestorable to own file
Browse files Browse the repository at this point in the history
  • Loading branch information
mroderick committed Apr 30, 2018
1 parent 6aad05a commit ad673fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 7 additions & 0 deletions lib/sinon/util/core/is-restorable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use strict";

function isRestorable(obj) {
return typeof obj === "function" && typeof obj.restore === "function" && obj.restore.sinon;
}

module.exports = isRestorable;
5 changes: 1 addition & 4 deletions lib/sinon/util/core/restore.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
"use strict";

var isRestorable = require("./is-restorable");
var walk = require("./walk");

function isRestorable(obj) {
return typeof obj === "function" && typeof obj.restore === "function" && obj.restore.sinon;
}

module.exports = function restore(object) {
if (object !== null && typeof object === "object") {
walk(object, function (prop) {
Expand Down

0 comments on commit ad673fe

Please sign in to comment.