diff --git a/lib/sinon/util/core/is-restorable.js b/lib/sinon/util/core/is-restorable.js new file mode 100644 index 000000000..4fc3a9f2e --- /dev/null +++ b/lib/sinon/util/core/is-restorable.js @@ -0,0 +1,7 @@ +"use strict"; + +function isRestorable(obj) { + return typeof obj === "function" && typeof obj.restore === "function" && obj.restore.sinon; +} + +module.exports = isRestorable; diff --git a/lib/sinon/util/core/restore.js b/lib/sinon/util/core/restore.js index 3e4abeb21..4ea4a73ed 100644 --- a/lib/sinon/util/core/restore.js +++ b/lib/sinon/util/core/restore.js @@ -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) {